From c8ad571e279927ab6b2a0c1208c1c3644acfa195 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 22:26:39 +0100 Subject: [PATCH] [PR #11030/b471a4a9 backport][stable-12] Fix typing failure in CI (#11034) Fix typing failure in CI (#11030) * Fix typing failure in CI. * Add changelog fragment. (cherry picked from commit b471a4a90deeab9453daaa97ecd7ef0403dac025) Co-authored-by: Felix Fontein --- changelogs/fragments/11030-wsl-typing.yml | 2 ++ plugins/connection/wsl.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/11030-wsl-typing.yml diff --git a/changelogs/fragments/11030-wsl-typing.yml b/changelogs/fragments/11030-wsl-typing.yml new file mode 100644 index 0000000000..38d25f97e7 --- /dev/null +++ b/changelogs/fragments/11030-wsl-typing.yml @@ -0,0 +1,2 @@ +bugfixes: + - "wsl connection plugin - rename variable to fix type checking (https://github.com/ansible-collections/community.general/pull/11030)." diff --git a/plugins/connection/wsl.py b/plugins/connection/wsl.py index c6318caba4..baf8730d71 100644 --- a/plugins/connection/wsl.py +++ b/plugins/connection/wsl.py @@ -613,14 +613,14 @@ class Connection(ConnectionBase): display.vvv(f"EXEC {cmd}", host=self.get_option("remote_addr")) - cmd = to_bytes(cmd, errors="surrogate_or_strict") + cmd_b = to_bytes(cmd, errors="surrogate_or_strict") no_prompt_out = b"" no_prompt_err = b"" become_output = b"" try: - chan.exec_command(cmd) + chan.exec_command(cmd_b) if self.become and self.become.expect_prompt(): password_prompt = False become_success = False