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 <rep...@bugs.python.org>
<http://bugs.python.org/issue18649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to