Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AttributeError: 'ArgumentParser' object has no attribute 'title' #128205

Closed as not planned
@khalfella

Description

@khalfella

Bug report

Bug description:

    some_parser = subparsers.add_parser('something',
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/argparse.py", line 1236, in add_parser
    parser = self._parser_class(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/argparse.py", line 1827, in __init__
    self._add_container_actions(parent)
  File "/usr/lib/python3.12/argparse.py", line 1568, in _add_container_actions
    cont = title_group_map[group._container.title]
                           ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ArgumentParser' object has no attribute 'title'

After updating to latest python version on gentoo Python 3.12.8 I started seeing this failure. This might be related to fix in GH-125210. Manually reverting this change fixed the issue for me.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dir

    Projects

    Status

    Doc issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions