René's URL Explorer Experiment


Title: Argparse logs incorrect ambiguous option · Issue #125254 · python/cpython · GitHub

Open Graph Title: Argparse logs incorrect ambiguous option · Issue #125254 · python/cpython

X Title: Argparse logs incorrect ambiguous option · Issue #125254 · python/cpython

Description: Bug report Bug description: Given this example script import argparse class CsvListAction(argparse.Action): """ argparse Action to convert "a,b,c" into ["a", "b", "c"] """ def __call__(self, parser, namespace, values, option_string=None)...

Open Graph Description: Bug report Bug description: Given this example script import argparse class CsvListAction(argparse.Action): """ argparse Action to convert "a,b,c" into ["a", "b", "c"] """ def __call__(self, parser...

X Description: Bug report Bug description: Given this example script import argparse class CsvListAction(argparse.Action): """ argparse Action to convert "a,b,c" into ["a", &quo...

Opengraph URL: https://github.com/python/cpython/issues/125254

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Argparse logs incorrect ambiguous option","articleBody":"# Bug report\n\n### Bug description:\n\nGiven this example script\n\n```python\nimport argparse\nclass CsvListAction(argparse.Action):\n    \"\"\"\n    argparse Action to convert \"a,b,c\" into [\"a\", \"b\", \"c\"]\n    \"\"\"\n\n    def __call__(self, parser, namespace, values, option_string=None):\n        # Conversion to dict removes duplicates while preserving order\n        items = list(dict.fromkeys(values.split(\",\")).keys())\n        setattr(namespace, self.dest, items)\n\n\nparser = argparse.ArgumentParser(description=\"Testing\")\n\nparser.add_argument(\"directory\", type=str, help=\"path to find files\")\nparser.add_argument(\n    \"--output\",\n    type=str,\n    help=\"name of output file to produce\",\n)\n\nname_args_group = parser.add_mutually_exclusive_group()\nname_args_group.add_argument(\n    \"--name-exclude\",\n    action=CsvListAction,\n    help=\"Comma-separated set of name ID(s) to exclude\",\n)\nname_args_group.add_argument(\n    \"--name-include\",\n    action=CsvListAction,\n    help=\"Comma-separated set of name ID(s) to include\",\n)\n\n\nparser.add_argument(\n    \"--path-exclude\",\n    action=CsvListAction,\n    default=[],\n    help=\"Comma-separated set of UNIX glob patterns to exclude\",\n)\nparser.add_argument(\n    \"--path-include\",\n    action=CsvListAction,\n    default=[],\n    help=\"Comma-separated set of UNIX glob patterns to include\",\n)\nparser.parse_args()\n\n```\n**Notice the cli args are `name-exclude` and `name-include`**\n\nRun the following command, which incorrectly puts the arg as `--name`\n`python argparse_mini.py /some/path --output here.txt --name something --path-exclude *request.py`\n\nIf you run it with Python 3.12.2 or below, the resulting log statement is what we expect\n`argparse_mini.py: error: ambiguous option: --name could match --name-exclude, --name-include`\n\nHowever, tested with 3.12.7 and the log statement instead is\n`argparse_mini.py: error: ambiguous option: *request.py could match --name-exclude, --name-include`\n\nwhich is clearly incorrect, as `*request.py` was the argument to a different CLI option\n\n### CPython versions tested on:\n\n3.11, 3.12\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-125273\n* gh-125359\n* gh-125360\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/clavedeluna","@type":"Person","name":"clavedeluna"},"datePublished":"2024-10-10T12:31:43Z","url":"https://github.com/python/cpython/issues/125254"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e0152de6-b12c-ab55-f590-38bb347b8e8a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA0A8:27AD12:F6E55C:14B23CB:6B005C7F
html-safe-noncee0a2c60b671afc391e17f79fee10dc9240583e04d45f64da7d0e8c49223e93ef
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEE4OjI3QUQxMjpGNkU1NUM6MTRCMjNDQjo2QjAwNUM3RiIsInZpc2l0b3JfaWQiOiI2MTQwNDQ2NTkyMzQ1MzMyODYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac115e7ee56c1ac5d683b3e3f615bd48e29063953500a377b3dee34a13723fd31e
hovercard-subject-tagissue:2578710756
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/125254/issue_layout
twitter:imagehttps://opengraph.githubassets.com/11cb88a81c64702d5eb736e903d90574142072686104b7d71a0b9c7e1bd62600/python/cpython/issues/125254
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/11cb88a81c64702d5eb736e903d90574142072686104b7d71a0b9c7e1bd62600/python/cpython/issues/125254
og:image:altBug report Bug description: Given this example script import argparse class CsvListAction(argparse.Action): """ argparse Action to convert "a,b,c" into ["a", "b", "c"] """ def __call__(self, parser...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameclavedeluna
hostnamegithub.com
expected-hostnamegithub.com
None29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseeacd927ba6112e3b01ba99c762bd699a4a4f5df7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/125254#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F125254
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F125254
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/125254
Reloadhttps://github.com/python/cpython/issues/125254
Reloadhttps://github.com/python/cpython/issues/125254
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/125254
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/125254
Argparse logs incorrect ambiguous optionhttps://github.com/python/cpython/issues/125254#top
https://github.com/serhiy-storchaka
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/clavedeluna
clavedelunahttps://github.com/clavedeluna
on Oct 10, 2024https://github.com/python/cpython/issues/125254#issue-2578710756
gh-125254: Fix error report about ambiguous option in argparse #125273https://github.com/python/cpython/pull/125273
[3.13] gh-125254: Fix error report about ambiguous option in argparse (GH-125273) #125359https://github.com/python/cpython/pull/125359
[3.12] gh-125254: Fix error report about ambiguous option in argparse (GH-125273) #125360https://github.com/python/cpython/pull/125360
clavedelunahttps://github.com/clavedeluna
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 10, 2024https://github.com/python/cpython/issues/125254#event-14590510068
ZeroIntensityhttps://github.com/ZeroIntensity
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Oct 10, 2024https://github.com/python/cpython/issues/125254#event-14591748429
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 10, 2024https://github.com/python/cpython/issues/125254#issuecomment-2405148628
@savannahostrowskihttps://github.com/savannahostrowski
serhiy-storchakahttps://github.com/serhiy-storchaka
Argparse issueshttps://github.com/orgs/python/projects/5
on Oct 10, 2024https://github.com/python/cpython/issues/125254#event-14594333320
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 10, 2024https://github.com/python/cpython/issues/125254#event-14594416360
serhiy-storchakahttps://github.com/serhiy-storchaka
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
on Oct 10, 2024https://github.com/python/cpython/issues/125254#event-14594418365
serhiy-storchakahttps://github.com/serhiy-storchaka
Argparse issueshttps://github.com/orgs/python/projects/5
on Oct 10, 2024https://github.com/python/cpython/issues/125254
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 10, 2024https://github.com/python/cpython/issues/125254#event-14594725637
pythongh-125254: Fix error report about ambiguous option in argparsehttps://github.com/serhiy-storchaka/cpython/commit/d4009a23ea75c82a09a6f9f50511c610344d433d
pythongh-125254https://github.com/python/cpython/issues/125254
d4009a2https://github.com/serhiy-storchaka/cpython/commit/d4009a23ea75c82a09a6f9f50511c610344d433d
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 10, 2024https://github.com/python/cpython/issues/125254#issuecomment-2405633770
@clavedelunahttps://github.com/clavedeluna
#58573https://github.com/python/cpython/issues/58573
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 12, 2024https://github.com/python/cpython/issues/125254#event-14616820715
gh-125254: Fix error report about ambiguous option in argparse (GH-12…https://github.com/python/cpython/commit/63cf4e914f879ee28a75c02e867baa7c6047ea2b
gh-125254https://github.com/python/cpython/issues/125254
GH-12…https://github.com/python/cpython/pull/125273
63cf4e9https://github.com/python/cpython/commit/63cf4e914f879ee28a75c02e867baa7c6047ea2b
miss-islingtonhttps://github.com/miss-islington
on Oct 12, 2024https://github.com/python/cpython/issues/125254#event-14616820931
pythongh-125254: Fix error report about ambiguous option in argparse (p…https://github.com/miss-islington/cpython/commit/5db7fd9ca5a2057e7be2be030421cd1231c865c8
pythongh-125254https://github.com/python/cpython/issues/125254
p…https://github.com/python/cpython/pull/125273
5db7fd9https://github.com/miss-islington/cpython/commit/5db7fd9ca5a2057e7be2be030421cd1231c865c8
pythongh-125254: Fix error report about ambiguous option in argparse (p…https://github.com/miss-islington/cpython/commit/8998491b95198ec0e53c6215de8b14c982d9f71f
pythongh-125254https://github.com/python/cpython/issues/125254
p…https://github.com/python/cpython/pull/125273
8998491https://github.com/miss-islington/cpython/commit/8998491b95198ec0e53c6215de8b14c982d9f71f
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 12, 2024https://github.com/python/cpython/issues/125254#event-14616909490
[3.12] gh-125254: Fix error report about ambiguous option in argparse (…https://github.com/python/cpython/commit/aa0cdeb93cedef1e28bc3e4dc6cd4c5c3b1425d6
gh-125254https://github.com/python/cpython/issues/125254
…https://github.com/python/cpython/pull/125273
aa0cdebhttps://github.com/python/cpython/commit/aa0cdeb93cedef1e28bc3e4dc6cd4c5c3b1425d6
[3.13] gh-125254: Fix error report about ambiguous option in argparse (…https://github.com/python/cpython/commit/33c41360c8d0a2019feddb523295ff3d7d47ee3c
gh-125254https://github.com/python/cpython/issues/125254
…https://github.com/python/cpython/pull/125273
33c4136https://github.com/python/cpython/commit/33c41360c8d0a2019feddb523295ff3d7d47ee3c
serhiy-storchakahttps://github.com/serhiy-storchaka
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 12, 2024https://github.com/python/cpython/issues/125254#event-14616910866
github-project-automationhttps://github.com/apps/github-project-automation
Argparse issueshttps://github.com/orgs/python/projects/5
on Oct 12, 2024https://github.com/python/cpython/issues/125254
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/125254
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/125254
serhiy-storchakahttps://github.com/serhiy-storchaka
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Argparse issueshttps://github.com/orgs/python/projects/5
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.