Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

when testing encodings for ansible - windows hosts error occurs [venv/lib/python3.12/site-packages/testinfra/backend/ansible.py:62: KeyError]

オープン
#786 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
ansible, python

調査の方向性

Start with test_infra.py and trace the failure through testinfra/backend/ansible.py:get_encoding, backend/base.py, and utils/ansible_runner.py:run_module. Reproduce the encoding check against a Windows host and inspect the captured Ansible result. Done means the Windows encoding test no longer raises the reported KeyError or related failure.

索引モデルが issue の本文から書いたものです。

説明

image

>       result = host.ansible(
            "win_shell",
            f"Get-Content -Path '{file_path}' | Out-String",
            check=False,
            become=True,
            become_user="vlan8user",
            become_method="runas",
        )

test_infra.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
venv/lib/python3.12/site-packages/testinfra/modules/ansible.py:43: in wrapper
    return func(self, *args, **kwargs)
venv/lib/python3.12/site-packages/testinfra/modules/ansible.py:110: in __call__
    result = self._host.backend.run_ansible(
venv/lib/python3.12/site-packages/testinfra/backend/ansible.py:72: in run_ansible
    result = self.ansible_runner.run_module(
venv/lib/python3.12/site-packages/testinfra/utils/ansible_runner.py:411: in run_module
    with open(fpath, "r", encoding=get_encoding()) as f:
venv/lib/python3.12/site-packages/testinfra/backend/ansible.py:70: in get_encoding
    return self.encoding
venv/lib/python3.12/site-packages/testinfra/backend/base.py:303: in encoding
    self._encoding = self.get_encoding()
venv/lib/python3.12/site-packages/testinfra/backend/base.py:283: in get_encoding
    cmd = self.run(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <testinfra.backend.ansible.AnsibleBackend object at 0x7f0793cdf9e0>
command = "python3 -c 'import locale;print(locale.getpreferredencoding())'"
args = ('python3',), kwargs = {'encoding': None}
out = {'ansible_facts': {'discovered_interpreter_python': '/usr/bin/python3'}, 'changed': False, 'module_stderr': 'Exception...Operation: (:) [], RuntimeException\r\n    + FullyQualifiedErrorId : BadExpression\r\n \r\n', 'module_stdout': '', ...}

    def run(
    ```
主要言語
Python
スター
2.5k
フォーク
360
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pytest-dev/pytest-testinfra のほかの issue

pytest-dev/pytest-testinfra の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。