[issue29132] shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes

Evan report at bugs.python.org
Mon Jan 2 07:56:23 EST 2017


New submission from Evan:

When both punctuation_chars and posix are used, any punctuation directly next to quoted characters is interpreted as a single token.

>>> from shlex import shlex
>>> list(shlex('>"a"', posix=True))
['>', 'a']
>>> list(shlex('>"a"', punctuation_chars=True))
['>', '"a"']
>>> list(shlex('>"a"', posix=True, punctuation_chars=True))
['>a']  # should be ['>', 'a']

----------
components: Library (Lib)
messages: 284480
nosy: evan_, r.david.murray, vinay.sajip
priority: normal
severity: normal
status: open
title: shlex.shlex with punctuation_chars and posix doesn't handle punctuation next to quotes
versions: Python 3.6, Python 3.7

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


More information about the Python-bugs-list mailing list