Matthew Gamble <[email protected]> added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36897>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com