[issue1724822] provide a shlex.split alternative for Windows shell syntax

Philip Jenvey report at bugs.python.org
Sun Mar 6 02:29:59 CET 2011


Philip Jenvey <pjenvey at underboss.org> added the comment:

The code I linked to above implements those semantics in pure Python. It follows Microsoft's "Parsing C Command-Line Arguments" rules like CommandLineToArgvW does

Here's updated links, the older links seemed to have broken:

https://fisheye3.atlassian.com/browse/jython/trunk/jython/Lib/subprocess.py?r=6636#to566

tests: https://fisheye3.atlassian.com/browse/jython/trunk/jython/Lib/test/test_subprocess_jy.py?r=6464#to41

This code is basically the inverse of subprocess's list2cmdline

I don't mind incorporating this code into the stdlib, but we need to figure out where it would go. There was a discussion on stdlib-sig last year related to this topic, about the need for quoting and unquoting command lines.

We have some of this functionality for posix systems scattered throughout shlex and the pipes module, and then there's subprocess.list2cmdline. I think we could use a new module with all this functionality in one place.

----------

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


More information about the Python-bugs-list mailing list