diff --git a/changelogs/fragments/local_popen_text.yml b/changelogs/fragments/local_popen_text.yml new file mode 100644 index 00000000000..76053d2cdf0 --- /dev/null +++ b/changelogs/fragments/local_popen_text.yml @@ -0,0 +1,2 @@ +bugfixes: + - local connection plugin - The command-line used to create subprocesses is now always ``str`` to avoid issues with debuggers and profilers. diff --git a/lib/ansible/plugins/connection/local.py b/lib/ansible/plugins/connection/local.py index 934ef52738c..af5e8d66d00 100644 --- a/lib/ansible/plugins/connection/local.py +++ b/lib/ansible/plugins/connection/local.py @@ -101,9 +101,9 @@ class Connection(ConnectionBase): display.debug("opening command with Popen()") if isinstance(cmd, (text_type, binary_type)): - cmd = to_bytes(cmd) + cmd = to_text(cmd) else: - cmd = map(to_bytes, cmd) + cmd = map(to_text, cmd) pty_primary = None stdin = subprocess.PIPE