Richard Oudkerk added the comment:
> I think you're missing the point. The implementation is wrong as it
> does not do what documentation says which is "A double quotation mark
> preceded by a backslash is interpreted as a literal double quotation
> mark."
That docstring describes how the string returned by list2cmdline() is
interpreted by the MS C runtime. I assume you mean this bit:
3) A double quotation mark preceded by a backslash is
interpreted as a literal double quotation mark.
This looks correct to me: it implies that list2cmdline() must convert a double
quotation mark to a double quotation mark preceded by a backslash. e.g.
>>> print(subprocess.list2cmdline(['"']))
\"
> How the output of list2cmdline interacts with the cmd.exe is another
> issue (It just happens here that if implementation of list2cmdline were
> in line with its documentation then there wouldn't be any subsequent
> problem with cmd.exe).
As I said, list2cmdline() behaves as expected. Whatever else happens, "|" must
be escaped with "^" or else cmd will interpret it specially.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue18649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com