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.

classification
Title: shlex error in posix mode and empty quotes
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Michal Ostrowski, evan_
Priority: normal Keywords:

Created on 2017-01-05 01:27 by Michal Ostrowski, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg284685 - (view) Author: Michal Ostrowski (Michal Ostrowski) Date: 2017-01-05 01:27
Three examples below.  I believe the second is wrong, because it reorders
the "echo" and "," tokens.

>>> list(shlex.shlex('echo b="a",echo bar', posix=True))
['echo', 'b', '=', 'a', ',', 'echo', 'bar']
>>> list(shlex.shlex('echo b="",echo bar', posix=True))
['echo', 'b', '=', 'echo', ',', 'bar']
>>> list(shlex.shlex('echo b="",echo bar'))
['echo', 'b', '=', '""', ',', 'echo', 'bar']
msg284726 - (view) Author: Evan Andrews (evan_) * Date: 2017-01-05 10:56
This is also broken in 3.5.2, but not in 3.6.0:

>>> list(shlex.shlex('echo b="",echo bar', posix=True))
['echo', 'b', '=', '', ',', 'echo', 'bar']

I'm guessing it was fixed incidentally by the changes in issue1521950.
msg284732 - (view) Author: Evan Andrews (evan_) * Date: 2017-01-05 11:15
My mistake, it was addressed directly in issue21999. This is already fixed in 2.7.13 and will be fixed in 3.5.3.
History
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73349
2017-01-05 12:17:20berker.peksagsetstatus: open -> closed
resolution: out of date
stage: resolved
2017-01-05 11:15:05evan_setmessages: + msg284732
2017-01-05 10:56:45evan_setmessages: + msg284726
versions: + Python 3.5
2017-01-05 10:50:22evan_setnosy: + evan_
2017-01-05 01:27:37Michal Ostrowskisettype: behavior
components: + Library (Lib)
versions: + Python 2.7, Python 3.4
2017-01-05 01:27:11Michal Ostrowskicreate