[issue43776] Popen with shell=True yield mangled repr output

mkocher report at bugs.python.org
Thu Apr 8 14:42:23 EDT 2021


New submission from mkocher <Michael.Kocher at me.com>:

When using Popen with shell=True, the output of the repr is not particularly user friendly. 

When using the form `p = Popen('python --version'.split())`, the output is reasonably output in a user friendly form of `<Popen: returncode: None args: ['python', '--version']>`. 

However, when running with `shell=True`, the output is mangled.

For example, trying to run `python --help` via `p = Popen('python --version', shell=True)` yields the following output.

`<Popen: returncode: None args: ['p', 'y', 't', 'h', 'o', 'n', ' ', '-', '-',...>`

The original change appears to be motivated by https://bugs.python.org/issue38724 

and the PR here:

https://github.com/python/cpython/pull/17151/files

----------
components: Library (Lib)
messages: 390542
nosy: mkocher
priority: normal
severity: normal
status: open
title: Popen with shell=True yield mangled repr output
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43776>
_______________________________________


More information about the Python-bugs-list mailing list