Roundup Robot added the comment:
New changeset 395e190ead36 by Raymond Hettinger in branch 'default':
Issue #24113: Remove unreachable code in shlex.
https://hg.python.org/cpython/rev/395e190ead36
--
nosy: +python-dev
___
Python tracker
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
priority: normal - low
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24113
___
Changes by Berker Peksag berker.pek...@gmail.com:
--
stage: needs patch - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24113
___
___
Berker Peksag added the comment:
Thanks for the report.
Users should either be permitted to set debug on via an optional __init__
parameter,
This is already possible via the debug attribute
(https://docs.python.org/3/library/shlex.html#shlex.shlex.debug), so I don't
think adding a debug
Andrew Barnert added the comment:
Presumably ESR thought that information was useful enough to send Guido a patch
to add it. But apparently nobody's missed it in the 15 years it's been checked
in but unreachable. If anyone needed to know the `instream` and `lineno` right
after initialization,
New submission from Michael Smith:
In its __init__ method, shlex.shlex sets self.debug = 0. An `if self.debug:`
statement follows shortly thereafter and without allowing the user to change
self.debug.
The code inside the if statement is unreachable. Users should either be
permitted to set
Michael Smith added the comment:
Hat tip abarnert on StackOverflow for digging in.
http://stackoverflow.com/questions/29996208/putting-shlex-in-debug-mode
This code was introduced in https://hg.python.org/cpython/rev/81a121d21340
--
___
Python