argparse does not accept options taking arguments beginning with dash (regression from optparse)

Open
#53,580 87 comments 0 reactions 1 assignee View on GitHub

@serhiy-storchaka is already working on this.

Since Aug 22, 2025.

Assessment

This issue has not been assessed yet.

Description

stdlib type-feature
BPO 9334
Nosy @rhettinger, @cben, @ericvsmith, @orivej, @merwok, @bitdancer, @andersk, @vadmium, @spaceone, @vporton, @maggyero, @tirkarthi, @gaborbernat
Files
  • final.patch: patch for issue 9334
  • python-argparse-error.patch
  • argparse_opt.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-12-26.23:41:14.505>
    created_at = <Date 2010-07-22.22:15:36.970>
    labels = ['3.7', 'type-feature', 'library']
    title = 'argparse does not accept options taking arguments beginning with dash (regression from optparse)'
    updated_at = <Date 2022-01-12.23:59:10.962>
    user = 'https://github.com/andersk'
    

    bugs.python.org fields:

    activity = <Date 2022-01-12.23:59:10.962>
    actor = 'andersk'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-12-26.23:41:14.505>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2010-07-22.22:15:36.970>
    creator = 'andersk'
    dependencies = []
    files = ['29548', '47302', '47404']
    hgrepos = []
    issue_num = 9334
    keywords = ['patch']
    message_count = 71.0
    messages = ['111221', '111224', '111227', '111228', '111230', '111279', '111367', '111669', '111670', '111673', '111691', '128014', '128025', '128047', '128055', '128062', '128071', '128072', '128076', '128078', '128090', '128091', '128094', '128104', '128134', '128179', '128266', '128728', '132220', '132260', '150310', '150320', '169712', '169978', '184174', '184177', '184178', '184180', '184211', '184425', '184987', '239435', '251815', '251862', '263211', '263216', '276486', '276503', '276524', '276634', '307193', '307209', '307210', '307213', '307786', '309685', '309691', '309693', '310540', '322678', '331729', '331732', '331736', '404229', '409125', '409221', '409222', '409223', '409225', '409227', '410445']
    nosy_count = 31.0
    nosy_names = ['rhettinger', 'cben', 'amcnabb', 'bethard', 'eric.smith', 'orivej', 'eric.araujo', 'r.david.murray', 'memeplex', 'gfxmonk', 'evaned', 'andersk', 'abacabadabacaba', 'gdb', 'nelhage', 'drm', 'davidben', 'martin.panter', 'paul.j3', 'skilletaudio', 'Christophe.Guillon', 'danielsh', 'spaceone', 'Clint Olsen', 'porton', 'Socob', 'maggyero', 'karzes', 'xtreak', 'fennec15', 'gaborjbernat']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue9334'
    versions = ['Python 3.7']
    

    Dominant language
    Python
    Stars
    77.2k
    Forks
    36k
    Avg merge
    1d 9h
    Merged PRs (30d)
    558

    Contributor guide

    Open the contributing guide

    First steps

    1. Read the whole issue, then the project's contributing guide.
    2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
    3. Fork the repository and make your change on a branch.
    4. Open a pull request that references the issue number.

    More from python/cpython

    All issues in python/cpython

    Similar issues

    More Python issues

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.