[issue18649] list2cmdline function in subprocess module handles \" sequence wrong

Piotr Dobrogost report at bugs.python.org
Sun Aug 4 00:00:42 CEST 2013


New submission from Piotr Dobrogost:

According to the docstring of list2cmdline function in subprocess module the sequence of a backslash followed by a double quote mark should denote double quote mark in the output string. However it's not the case

Python 2.7.4 (default, Apr  6 2013, 19:55:15) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import subprocess
    >>> print subprocess.list2cmdline(r'\"1|2\"')
    \ \" 1 | 2 \ \"

The same behavior is in Python 3.3.1.

See "On Windows, how can I protect arguments to shell scripts using Python 2.7 subprocess?"(http://stackoverflow.com/q/4970194/95735) question on Stack Overflow.

----------
components: Library (Lib)
messages: 194307
nosy: Arve.Knudsen, exarkun, piotr.dobrogost, r.david.murray
priority: normal
severity: normal
status: open
title: list2cmdline function in subprocess module handles \" sequence wrong
versions: Python 2.7, Python 3.3

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


More information about the Python-bugs-list mailing list