]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338) (GH-26510)
authorGregory P. Smith <greg@krypto.org>
Thu, 3 Jun 2021 04:15:26 +0000 (21:15 -0700)
committerGitHub <noreply@github.com>
Thu, 3 Jun 2021 04:15:26 +0000 (21:15 -0700)
commit5a8ddcc4524dca3880d7fc2818814ffae1cfb8a2
treedd41018682a99af6c4725af4c97f63aa67138db1
parent5df4abd6b033a5f1e48945c6988b45e35e76f647
[3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338) (GH-26510)

Removes the `list` call in the Popen `repr`.

Current implementation:

For cmd = `python --version`,  with `shell=True`.

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

For `shell=False` and args=`['python', '--version']`, the output is correct:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

With the new changes the `repr`  yields:

For cmd = `python --version`,  with `shell=True`:

```bash
<Popen: returncode: None args: 'python --version'>
```

For `shell=False` and args=`['python', '--version']`, the output:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

Automerge-Triggered-By: GH:gpshead.
(cherry picked from commit db0c5b786df961785ae8c803f5572ae0c8dadcc7)

Co-authored-by: M. Kocher <michael.kocher@me.com>
Co-authored-by: M. Kocher <michael.kocher@me.com>
Lib/subprocess.py
Lib/test/test_subprocess.py
Misc/NEWS.d/next/Library/2021-04-12-00-00-00.bpo-43776.p14y7a.rst [new file with mode: 0644]