[issue28392] shlex - non-posix-mode: error in Multiple occurances of quotes substrings/words

R. David Murray report at bugs.python.org
Sun Oct 9 11:02:55 EDT 2016


R. David Murray added the comment:

>>> shlex.split('"Do""This""Separate"', posix=False)
  ['"Do"', '"This"', '"Separate"']
  >>> shlex.split('Do"SeparateThis"', posix=False)
  ['Do"SeparateThis"']

Both of these are as documented.  The first has three separate words, since each word that starts with a leading " is split at the closing quote (thus producing a new word that starts with a ").  The last is one word, because the first " is internal to the word that starts at 'Do'.

In any case, if you find something that disagrees with the docs, we'll just change the docs, because posix=False exists only for backward compatibility so whatever the code actually does is by definition correct at this point.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list