René's URL Explorer Experiment


Title: GH-103219: Fix optional args incorrectly being processed as required args by savannahostrowski · Pull Request #123931 · python/cpython · GitHub

Open Graph Title: GH-103219: Fix optional args incorrectly being processed as required args by savannahostrowski · Pull Request #123931 · python/cpython

X Title: GH-103219: Fix optional args incorrectly being processed as required args by savannahostrowski · Pull Request #123931 · python/cpython

Description: This PR addresses a pretty old bug where optional args were incorrectly marked as required and adds a corresponding test case. We now more thoroughly check to see that an arg is 1) required, 2) has no default value, and 3) nargs is not set to * or ? before adding it to the list of required args. It looks like this bug at least dates back to 3.9, but since those releases are just for security fixes at this point, I've marked this for backport to 3.12 and 3.13. Issue: gh-103219

Open Graph Description: This PR addresses a pretty old bug where optional args were incorrectly marked as required and adds a corresponding test case. We now more thoroughly check to see that an arg is 1) required, 2) has...

X Description: This PR addresses a pretty old bug where optional args were incorrectly marked as required and adds a corresponding test case. We now more thoroughly check to see that an arg is 1) required, 2) has...

Opengraph URL: https://github.com/python/cpython/pull/123931

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b1fa83f5-2184-f4e4-f4ea-ddeea378cd55
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8460:D064:2D08420:3D7DF08:6B005B32
html-safe-noncecab23f6c9f553101baf2f14a740b5ad86f35c693a434b8ce2bafd12928eb0eaa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDYwOkQwNjQ6MkQwODQyMDozRDdERjA4OjZCMDA1QjMyIiwidmlzaXRvcl9pZCI6IjUyNjA5Nzk3NjE3NTY0NzUzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2f728bbb095b21c92cf5a597454bcf30649d1f51a06fdce2de709476b6c1c028
hovercard-subject-tagpull_request:2065065674
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/123931/files
twitter:imagehttps://avatars.githubusercontent.com/u/8949415?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/8949415?s=400&v=4
og:image:altThis PR addresses a pretty old bug where optional args were incorrectly marked as required and adds a corresponding test case. We now more thoroughly check to see that an arg is 1) required, 2) has...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
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

Links:

Skip to contenthttps://github.com/python/cpython/pull/123931/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F123931%2Ffiles
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%2Fpull%2F123931%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/123931/files
Reloadhttps://github.com/python/cpython/pull/123931/files
Reloadhttps://github.com/python/cpython/pull/123931/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
savannahostrowskihttps://github.com/savannahostrowski
python:mainhttps://github.com/python/cpython/tree/main
savannahostrowski:gh-103219https://github.com/savannahostrowski/cpython/tree/gh-103219
Conversation 1 https://github.com/python/cpython/pull/123931
Commits 4 https://github.com/python/cpython/pull/123931/commits
Checks 0 https://github.com/python/cpython/pull/123931/checks
Files changed https://github.com/python/cpython/pull/123931/files
Please reload this pagehttps://github.com/python/cpython/pull/123931/files
GH-103219: Fix optional args incorrectly being processed as required args https://github.com/python/cpython/pull/123931/files#top
Show all changes 4 commits https://github.com/python/cpython/pull/123931/files
f09ef42 Update handling of nargs=* being incorrectly required savannahostrowski Sep 11, 2024 https://github.com/python/cpython/pull/123931/commits/f09ef423c572a43743e72cec65e6a2cd600aaa01
dfef7d1 📜🤖 Added by blurb_it. blurb-it[bot] Sep 11, 2024 https://github.com/python/cpython/pull/123931/commits/dfef7d13ed042ecbf7b802f1d156b9da92462599
d9d1d38 Update test name savannahostrowski Sep 11, 2024 https://github.com/python/cpython/pull/123931/commits/d9d1d38534efd4fc7859bfd4dfdc1c6e81c57f47
60aa444 Merge branch 'main' into gh-103219 savannahostrowski Sep 11, 2024 https://github.com/python/cpython/pull/123931/commits/60aa444efc661649b23bb73c8f54b7863efb20cd
Clear filters https://github.com/python/cpython/pull/123931/files
Please reload this pagehttps://github.com/python/cpython/pull/123931/files
Please reload this pagehttps://github.com/python/cpython/pull/123931/files
argparse.py https://github.com/python/cpython/pull/123931/files#diff-205ef24c9374465bf35c359abce9211d3aa113e986a1e3d41569eb29d07df479
test_argparse.py https://github.com/python/cpython/pull/123931/files#diff-c7651634d84a017884451f95f6535a1d2efbeacee1cca7cc1e27fdc748804aa1
2024-09-11-03-21-56.gh-issue-103219.F5atBD.rst https://github.com/python/cpython/pull/123931/files#diff-acb9bec476c30ef90d1791490436c5d25b178e23b887429fc5ee0a58ee7f46a3
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L370
Lib/argparse.pyhttps://github.com/python/cpython/pull/123931/files#diff-205ef24c9374465bf35c359abce9211d3aa113e986a1e3d41569eb29d07df479
View file https://github.com/savannahostrowski/cpython/blob/60aa444efc661649b23bb73c8f54b7863efb20cd/Lib/argparse.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/123931/{{ revealButtonHref }}
https://github.com/python/cpython/pull/123931/files#diff-205ef24c9374465bf35c359abce9211d3aa113e986a1e3d41569eb29d07df479
https://github.com/python/cpython/pull/123931/files#diff-205ef24c9374465bf35c359abce9211d3aa113e986a1e3d41569eb29d07df479
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L371
Lib/test/test_argparse.pyhttps://github.com/python/cpython/pull/123931/files#diff-c7651634d84a017884451f95f6535a1d2efbeacee1cca7cc1e27fdc748804aa1
View file https://github.com/savannahostrowski/cpython/blob/60aa444efc661649b23bb73c8f54b7863efb20cd/Lib/test/test_argparse.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/123931/{{ revealButtonHref }}
https://github.com/python/cpython/pull/123931/files#diff-c7651634d84a017884451f95f6535a1d2efbeacee1cca7cc1e27fdc748804aa1
https://github.com/python/cpython/pull/123931/files#diff-c7651634d84a017884451f95f6535a1d2efbeacee1cca7cc1e27fdc748804aa1
Misc/NEWS.d/next/Library/2024-09-11-03-21-56.gh-issue-103219.F5atBD.rsthttps://github.com/python/cpython/pull/123931/files#diff-acb9bec476c30ef90d1791490436c5d25b178e23b887429fc5ee0a58ee7f46a3
View file https://github.com/savannahostrowski/cpython/blob/60aa444efc661649b23bb73c8f54b7863efb20cd/Misc/NEWS.d/next/Library/2024-09-11-03-21-56.gh-issue-103219.F5atBD.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/123931/{{ revealButtonHref }}
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.