[New-bugs-announce] [issue25815] Improper subprocess output of arguments with braces in them on windows

Anthony Sottile report at bugs.python.org
Sun Dec 6 21:50:00 EST 2015


New submission from Anthony Sottile:

First some expected output:

```
# from cmd.exe
C:\Users\Anthony>echo hi{1}
hi{1}
# from MINGW
$ echo hi{1}
hi{1}
```

```
# On ubuntu
$ echo 'hi{1}'
hi{1}
$ python3.5 -c "import subprocess; print(subprocess.check_output(('echo', 'hi{1}')))"
b'hi{1}\n'
```

Now for the unexpected output (produced only by python on windows) (notice the missing braces)

```
C:\Python27\python.exe -c "import subprocess; print(subprocess.check_output(('echo', 'hi{1}')))"
hi1
C:\Python34\python.exe -c "import subprocess; print(subprocess.check_output(('echo', 'hi{1}')))"
b'hi1\n'
C:\Python35\python.exe -c "import subprocess; print(subprocess.check_output(('echo', 'hi{1}')))"
b'hi1\n'
```

Peculiarly, these all produce the output I expect:

```
C:\Python35\python.exe -c "import subprocess; print(subprocess.check_output(('echo', 'hi {1}')))"
b'hi {1}\n'
C:\Python35\python.exe -c "import subprocess; print(subprocess.check_output(('echo', 'hi{1}'), shell=True))"
b'hi{1}\r\n'
```

I don't have access to 3.6, but I imagine the issue exists there too.

----------
components: Windows
messages: 256043
nosy: Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Improper subprocess output of arguments with braces in them on windows
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25815>
_______________________________________


More information about the New-bugs-announce mailing list