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.

Title: getopt.gnu_getopt() loses dash argument
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, muntyan
Priority: normal Keywords:

Created on 2008-11-29 05:03 by muntyan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg76583 - (view) Author: Yevgen Muntyan (muntyan) Date: 2008-11-29 05:03
If you feed a dash as an argument to getopt.gnu_getopt() then it gets
lost, because the code only checks if the argument starts with a dash,
not if it's more than a dash (unlike getopt.getopt() which is correct).


>>> import getopt
>>> getopt.gnu_getopt('-', '')
([], [])
>>> getopt.getopt('-', '')
([], '-')
msg76989 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-05 09:23
Fixed in r67572. I won't backport this.
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48708
2008-12-05 09:23:43georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg76989
nosy: + georg.brandl
2008-11-29 05:03:59muntyancreate