[issue13543] shlex with string ending in space gives "ValueError: No closing quotation"

ekorn report at bugs.python.org
Fri Dec 9 00:17:07 CET 2011


ekorn <jonovik at gmail.com> added the comment:

FYI, Min RK commented on the IPython issue:
https://github.com/ipython/ipython/issues/1109#issuecomment-3071470

In short, 
shlex.shlex('blob f(" ")', posix=False)
fails, whereas 
shlex.shlex('blob f( " ")', posix=False)

"The problem appears to be that Python source obviously doesn't sit well with non-posix whitespace-split shlex. [...] if you lead all your open-quotes with whitespace, you should be fine (works for all given examples, at least). [...] I have no idea whether this is a Python bug or not, since I don't know what the reference standard is, but this is definitely an IPython bug.  We should not be trying to use shlex to parse Python code as if it were command-line arguments."

----------

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


More information about the Python-bugs-list mailing list