Author terry.reedy
Recipients Saimadhav.Heblikar, asvetlov, cheryl.sabella, ggenellina, gpolo, louielu, markroseman, mcepl, mrabarnett, rhettinger, terry.reedy, veganaiZe, wolma
Date 2019-06-02.01:20:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559438453.54.0.335802186596.issue5680@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-06-02 01:20:53terry.reedysetrecipients: + terry.reedy, rhettinger, ggenellina, gpolo, mcepl, mrabarnett, asvetlov, markroseman, wolma, Saimadhav.Heblikar, louielu, cheryl.sabella, veganaiZe
2019-06-02 01:20:53terry.reedysetmessageid: <1559438453.54.0.335802186596.issue5680@roundup.psfhosted.org>
2019-06-02 01:20:53terry.reedylinkissue5680 messages
2019-06-02 01:20:53terry.reedycreate