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

2021-06-02 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-06-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 5a8ddcc4524dca3880d7fc2818814ffae1cfb8a2 by Gregory P. Smith in 
branch '3.9':
[3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338) (GH-26510)
https://github.com/python/cpython/commit/5a8ddcc4524dca3880d7fc2818814ffae1cfb8a2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-06-02 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +25106
pull_request: https://github.com/python/cpython/pull/26510

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-28 Thread miss-islington


miss-islington  added the comment:


New changeset db0c5b786df961785ae8c803f5572ae0c8dadcc7 by M. Kocher in branch 
'master':
bpo-43776: Remove list call from args in Popen repr (GH-25338)
https://github.com/python/cpython/commit/db0c5b786df961785ae8c803f5572ae0c8dadcc7


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-28 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +3.9regression

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread mkocher


mkocher  added the comment:

There also appears to be an issue when args are provided as a `pathlib.Path` 
instance.


Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:20) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help.

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)
 in 
> 1 repr(x)

~/opt/miniconda3/envs/core/lib/python3.9/subprocess.py in __repr__(self)
990 obj_repr = (
991 f"<{self.__class__.__name__}: "
--> 992 f"returncode: {self.returncode} args: {list(self.args)!r}>"
993 )
994 if len(obj_repr) > 80:

TypeError: 'PosixPath' object is not iterable

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-23 Thread mkocher


mkocher  added the comment:

There's a PR up with removed `list` call as well as improved test coverage for 
the case where args is passed into Popen as a string. 

Hopefully this can get merged before things starting getting crazy with the 
3.10 release crunch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-11 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-10 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-10 Thread mkocher


Change by mkocher :


--
keywords: +patch
pull_requests: +24073
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25338

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-08 Thread William Pickard


William Pickard  added the comment:

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.

--
nosy: +WildCard65

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2021-04-08 Thread mkocher


New submission from mkocher :

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 ``. 

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.

``

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com