This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Matthew Gamble
Recipients Matthew Gamble, eric.smith
Date 2019-05-13.23:36:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557790611.88.0.765723766237.issue36897@roundup.psfhosted.org>
In-reply-to
Content
The point is that it's not possible to use the output of shlex.shlex to try to match the behaviour of a POSIX-compliant shell by reliably splitting up a user's input into multiple commands. In the first case I presented (no escape character), the user entered two commands. In the second case, the user entered a single command with two arguments. However, there's no way to differentiate the two situations based on the output of shlex.

It's also worth noting that the output is the same with this too:

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

I tested this code on python 3.6.7 and 3.7.2, and didn't see any deprecation warnings at all. I also checked the history of shlex.py:

https://github.com/python/cpython/commits/master/Lib/shlex.py

The last commit was from 2017, and I don't see any usages of DeprecationWarning inside that file. I'm also not sure how r-strings are relevant, as I don't see any regular expressions used inside of the shlex class.
History
Date User Action Args
2019-05-13 23:36:51Matthew Gamblesetrecipients: + Matthew Gamble, eric.smith
2019-05-13 23:36:51Matthew Gamblesetmessageid: <1557790611.88.0.765723766237.issue36897@roundup.psfhosted.org>
2019-05-13 23:36:51Matthew Gamblelinkissue36897 messages
2019-05-13 23:36:51Matthew Gamblecreate