Skip to content

[3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338)#26510

Merged
gpshead merged 1 commit into
python:3.9from
gpshead:backport-db0c5b7-3.9
Jun 3, 2021
Merged

[3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338)#26510
gpshead merged 1 commit into
python:3.9from
gpshead:backport-db0c5b7-3.9

Conversation

@gpshead

@gpshead gpshead commented Jun 3, 2021

Copy link
Copy Markdown
Member

Removes the list call in the Popen repr.

Current implementation:

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

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

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

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

With the new changes the repr yields:

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

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

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

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

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

Co-authored-by: M. Kocher michael.kocher@me.com

https://bugs.python.org/issue43776

…5338)

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 db0c5b7)

Co-authored-by: M. Kocher <michael.kocher@me.com>
@bedevere-bot bedevere-bot added the type-bug An unexpected behavior, bug, or error label Jun 3, 2021
@gpshead gpshead self-assigned this Jun 3, 2021
@gpshead gpshead merged commit 5a8ddcc into python:3.9 Jun 3, 2021
@gpshead gpshead deleted the backport-db0c5b7-3.9 branch June 3, 2021 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants