[issue28595] shlex.shlex should not augment wordchars

Evan Andrews report at bugs.python.org
Sat Jun 10 03:00:33 EDT 2017


Evan Andrews added the comment:

Thanks, Vinay. I understand you're busy, and I'm in no particular rush to have this looked at, so feel free to come back to it when you have more time. I've submitted the changes as a PR.

I also have an additional concern - even with this change, there is no way to tell whether a token should be considered special or text:

    >>> import shlex
    >>> def split(line):
    ...     s = shlex.shlex(line, posix=True, punctuation_chars=True)
    ...     s.whitespace_split = True
    ...     return list(s)
    ...
    >>> split('a&&b')
    ['a', '&&', 'b']
    >>> split('a "&&" b')
    ['a', '&&', 'b']

I feel this can be addressed after this as a separate issue but wanted to mention it now so you're aware.

----------

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


More information about the Python-bugs-list mailing list