]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43776: Remove list call from args in Popen repr (GH-25338)
authorM. Kocher <michael.kocher@me.com>
Wed, 28 Apr 2021 08:16:38 +0000 (01:16 -0700)
committerGitHub <noreply@github.com>
Wed, 28 Apr 2021 08:16:38 +0000 (01:16 -0700)
commitdb0c5b786df961785ae8c803f5572ae0c8dadcc7
tree5af87d347bf4a64b2266d04346a74ce2931d755a
parentf9bedb630e8a0b7d94e1c7e609b20dfaa2b22231
bpo-43776: Remove list call from args in Popen repr (GH-25338)

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
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]