New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popen with shell=True yield mangled repr output #87942
Comments
When using Popen with shell=True, the output of the repr is not particularly user friendly. When using the form However, when running with For example, trying to run
The original change appears to be motivated by https://bugs.python.org/issue38724 and the PR here: |
Actually, the problem is independent of the value of "shell", the __repr__ function from the initial PR that introduced it expects "args" to be a sequence and converts it to a list. |
There's a PR up with removed Hopefully this can get merged before things starting getting crazy with the 3.10 release crunch. |
There also appears to be an issue when args are provided as a Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:20) In [1]: from subprocess import Popen In [2]: from pathlib import Path In [3]: p = Path('/usr/local/bin/gtrue') In [4]: x = Popen(p) In [5]: repr(x) TypeError Traceback (most recent call last)
<ipython-input-5-5091dd558c19> in <module>
----> 1 repr(x) ~/opt/miniconda3/envs/core/lib/python3.9/subprocess.py in __repr__(self) TypeError: 'PosixPath' object is not iterable |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: