Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-103219: Fix optional args incorrectly being processed as required args#123931

Closed
savannahostrowski wants to merge 4 commits into
python:mainpython/cpython:mainfrom
savannahostrowski:gh-103219savannahostrowski/cpython:gh-103219Copy head branch name to clipboard
Closed

GH-103219: Fix optional args incorrectly being processed as required args#123931
savannahostrowski wants to merge 4 commits into
python:mainpython/cpython:mainfrom
savannahostrowski:gh-103219savannahostrowski/cpython:gh-103219Copy head branch name to clipboard

Conversation

@savannahostrowski

@savannahostrowski savannahostrowski commented Sep 11, 2024

Copy link
Copy Markdown
Member

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.

@savannahostrowski savannahostrowski added tests Tests in the Lib/test dir stdlib Standard Library Python modules in the Lib/ directory needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Sep 11, 2024
@savannahostrowski savannahostrowski changed the title GH-103219: Update handling of nargs=* being incorrectly required GH-103219: Fix optional args incorrectly being processed as required args Sep 11, 2024
@serhiy-storchaka

Copy link
Copy Markdown
Member

See also #124306 which fixes the bug in other way. It actually fixes several bugs, so I think that it is more correct way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes stdlib Standard Library Python modules in the Lib/ directory tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.