Terry J. Reedy <tjre...@udel.edu> added the comment:

My suspicion about posix=False was wrong.

>>> shlex.split(''' 1 "'a' 'b'" ''', posix=False)
['1', '"\'a\' \'b\'"']  # len(...[1]) = 9
>>> shlex.split(''' 1 '"a" "b"' ''')
['1', '"a" "b"']  # len = 7
f:\dev\3x>py -c "import sys; print(sys.argv)" 1 "'a' 'b'"
['-c', '1', "'a' 'b'"]  # Matches 'True'

>>> shlex.split(''' 1 '"a" "b"' ''', posix=False)
['1', '\'"a" "b"\'']
>>> shlex.split(''' 1 '"a" "b"' ''')
['1', '"a" "b"']  # Similar difference
f:\dev\3x>py -c "import sys; print(sys.argv)" 1 '"a" "b"'
['-c', '1', "'a", "b'"]  # crazy inversion and 3 args, matches neither

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue5680>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to