[issue35787] shlex.split inserts extra item on backslash space space

2019-01-20 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that the current behavior makes sense. I think "preserve the literal value of the next character" means the space won't be interpreted as a separator. In the first example (I think better written as shlex.split(r'a \ b')), the first space is a separa

[issue35787] shlex.split inserts extra item on backslash space space

2019-01-20 Thread Peter Otten
Peter Otten <__pete...@web.de> added the comment: To me the current shlex behaviour makes sense, and the shell (tested with bash) behaves the same way: $ python3 -c 'import sys; print(sys.argv)' a b ['-c', 'a', 'b'] $ python3 -c 'import sys; print(sys.argv)' a \ b ['-c', 'a', ' ', 'b'] ---

[issue35787] shlex.split inserts extra item on backslash space space

2019-01-20 Thread Max
New submission from Max : I believe in both cases below, the ouptu should be ['a', 'b']; the extra ' ' inserted in the list is incorrect: python3.6 Python 3.6.2 (default, Aug 4 2017, 14:35:04) [GCC 6.3.0 20170516] on linux Type "help", "copyright", "credits" or "license" for more information.