You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
argparse.ArgumentParser does not raise on duplicated subparsers, even though it does on duplicated flags #83897
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=Noneclosed_at=Nonecreated_at=<Date2020-02-21.18:20:54.496>labels= ['library', '3.9']
title='argparse.ArgumentParser does not raise on duplicated subparsers, even though it does on duplicated flags'updated_at=<Date2020-02-22.11:04:34.546>user='https://github.com/anntzer'
@ppolewicz PRs are nearly always merged into main and only sometimes backported. Tracker version labels indicate the version(s) reported for, not necessarily the versions patched. Since we moved the repository to github, PR titles indicate the version(s) actually patched (with 'main' the default). The tracker move to github messed up merge reporting for old PRs. I repointed the PR for this issue to the gh number so it is listed immediately above.
Activity
anntzer commentedon Feb 21, 2020
If one tries to add twice the same flag to an ArgumentParser, one gets a helpful exception:
results in
However, adding twice the same subparser raises no exception:
even though the two subparsers shadow one another in the same way as two identical flags.
rhettinger commentedon Feb 21, 2020
Would you like to work-up a patch to fix this?
anntzer commentedon Feb 22, 2020
Sure, #18605 it is.
Duplicated alias for commands are skipped
ppolewicz commentedon Nov 11, 2022
Please note that this issue is labeled as
3.9and fix for it was submitted in February 2020, but the fix was actually released with3.11terryjreedy commentedon Aug 16, 2023
@ppolewicz PRs are nearly always merged into main and only sometimes backported. Tracker version labels indicate the version(s) reported for, not necessarily the versions patched. Since we moved the repository to github, PR titles indicate the version(s) actually patched (with 'main' the default). The tracker move to github messed up merge reporting for old PRs. I repointed the PR for this issue to the gh number so it is listed immediately above.
serhiy-storchaka commentedon Oct 22, 2024
This was actually a duplicate of #59061.