[New-bugs-announce] [issue36897] shlex doesn't differentiate escaped characters in output

Matthew Gamble report at bugs.python.org
Sun May 12 20:59:51 EDT 2019


New submission from Matthew Gamble <mgamble at fontis.com.au>:

The output of the following invocations are exactly the same:

list(shlex.shlex('a ; b', posix=True, punctuation_chars=True))

list(shlex.shlex('a \; b', posix=True, punctuation_chars=True))

They both output the following:

['a', ';', 'b']

This makes it impossible to determine when the user wanted to escape the semi-colon for some reason, such as if they were using find's `-exec` argument.

----------
components: Library (Lib)
messages: 342276
nosy: Matthew Gamble
priority: normal
severity: normal
status: open
title: shlex doesn't differentiate escaped characters in output
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36897>
_______________________________________


More information about the New-bugs-announce mailing list