[issue11095] subprocess popen broken for bytes and backslash

Eric Smith report at bugs.python.org
Wed Feb 2 09:19:51 CET 2011


Eric Smith <eric at trueblade.com> added the comment:

1: subprocess.call is documented as taking a string, not bytes. If you think it should also take bytes, I suggest opening a separate bug as a feature request.

2: You're running into both Python and the shell escaping. If you have an odd number of backslashes, then python is converting '\a' into an ascii BEL character:
http://docs.python.org/py3k/reference/lexical_analysis.html#string-literals
For the remaining backslashes, Python is converting every 2 into a single backslash when it does its escaping, and the shell is doing the same thing, as is echo. That accounts for 8 backslashes becoming a single backslash in the output.

----------
nosy: +eric.smith
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

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


More information about the Python-bugs-list mailing list