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: "python -m pdb --help" does not work
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, blueyed, miss-islington
Priority: normal Keywords: patch

Created on 2019-08-09 14:52 by blueyed, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15193 merged blueyed, 2019-08-09 14:54
PR 16066 merged miss-islington, 2019-09-12 15:46
PR 16067 merged miss-islington, 2019-09-12 15:46
Messages (4)
msg349291 - (view) Author: daniel hahler (blueyed) * Date: 2019-08-09 14:52
The long options passed to `getopt.getopt` should not include the leading dashes:


    % python -m pdb --help
    Traceback (most recent call last):
      File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/home/daniel/src/pdbpp/pdb.py", line 1672, in <module>
        pdb.main()
      File "/usr/lib/python3.7/pdb.py", line 1662, in main
        opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['--help', '--command='])
      File "/usr/lib/python3.7/getopt.py", line 93, in getopt
        opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
      File "/usr/lib/python3.7/getopt.py", line 157, in do_longs
        has_arg, opt = long_has_args(opt, longopts)
      File "/usr/lib/python3.7/getopt.py", line 174, in long_has_args
        raise GetoptError(_('option --%s not recognized') % opt, opt)
    getopt.GetoptError: option --help not recognized

(it works in Python 2.7)
msg352205 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2019-09-12 15:46
New changeset 855df7f273c3988c72f01e51ba57091887ec38b2 by Benjamin Peterson (Daniel Hahler) in branch 'master':
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
https://github.com/python/cpython/commit/855df7f273c3988c72f01e51ba57091887ec38b2
msg352209 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 16:04
New changeset 7da8c0aee2039685f3eff878610684f94f7f7873 by Miss Islington (bot) in branch '3.7':
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
https://github.com/python/cpython/commit/7da8c0aee2039685f3eff878610684f94f7f7873
msg352210 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 16:05
New changeset 21bfff9a5a766acfbdd899687850f563893a0f9e by Miss Islington (bot) in branch '3.8':
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
https://github.com/python/cpython/commit/21bfff9a5a766acfbdd899687850f563893a0f9e
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81984
2019-09-12 16:05:55miss-islingtonsetmessages: + msg352210
2019-09-12 16:04:36miss-islingtonsetnosy: + miss-islington
messages: + msg352209
2019-09-12 15:46:57miss-islingtonsetpull_requests: + pull_request15690
2019-09-12 15:46:50miss-islingtonsetpull_requests: + pull_request15689
2019-09-12 15:46:40benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg352205

resolution: fixed
stage: patch review -> resolved
2019-08-09 14:54:09blueyedsetkeywords: + patch
stage: patch review
pull_requests: + pull_request14925
2019-08-09 14:52:52blueyedcreate