GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-118814: Fix the TypeVar constructor when name is passed by keyword by serhiy-storchaka · Pull Request #122664 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 4, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for positional-or-keyword parameter is passed by keyword. There was only one such case in the stdlib -- the TypeVar constructor.

  • Issue: TypeVar with bad arguments segfault/misbehavior #118814

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
pythongh-118814: Fix the TypeVar constructor when name is passed by k…
dc5949e
…eyword

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Aug 4, 2024
@serhiy-storchaka
serhiy-storchaka requested review from AlexWaygood and JelleZijlstra as code owners August 4, 2024 11:09
@bedevere-app bedevere-app Bot mentioned this pull request Aug 4, 2024
TypeVar with bad arguments segfault/misbehavior #118814
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 4, 2024
@serhiy-storchaka serhiy-storchaka mentioned this pull request Aug 4, 2024
gh-118814: Fix crash in _PyArg_UnpackKeywordsWithVararg #122558
Closed
@picnixz

picnixz commented Aug 4, 2024

Copy link
Copy Markdown
Member

I think I also tried that approach but got a segfault with the example I showed. Could you check whether I may have missed something (or did something incorrect?):

vararg_with_many_args

    a: object
    b: object
    c: object
    d: object
    *args: object
    e: bool
    f: bool = False
    g: bool = False

and test:

  • Calling ac_tester.vararg_with_many_args(1, 2, 3, 4, e=5)
  • Calling ac_tester.vararg_with_many_args(1, 2, 3, 4, e=5, f=6)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka

serhiy-storchaka commented Aug 4, 2024

Copy link
Copy Markdown
Member Author

Oh, yes. There are several more bugs in Argument Clinic.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
Add also tests for Argument Clinic.
2a3677d
@serhiy-storchaka
serhiy-storchaka requested a review from erlend-aasland as a code owner August 5, 2024 06:38
@serhiy-storchaka

serhiy-storchaka commented Aug 5, 2024

Copy link
Copy Markdown
Member Author

But they are only Argument Clinic bugs and not related to this issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
serhiy-storchaka merged commit 540fcc6 into python:main Aug 7, 2024
@miss-islington-app

miss-islington-app Bot commented Aug 7, 2024

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Aug 7, 2024
@serhiy-storchaka
serhiy-storchaka deleted the TypeVar-constructor branch August 7, 2024 20:30
@miss-islington-app

miss-islington-app Bot commented Aug 7, 2024

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 540fcc62f5da982b79504221cac01bfab8b73ba1 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned serhiy-storchaka Aug 7, 2024
@miss-islington-app

miss-islington-app Bot commented Aug 7, 2024

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 540fcc62f5da982b79504221cac01bfab8b73ba1 3.12
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Aug 7, 2024
@serhiy-storchaka
[3.13] pythongh-118814: Fix the TypeVar constructor when name is pass…
5d0a55d
…ed by keyword (pythonGH-122664)

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc6)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app

bedevere-app Bot commented Aug 7, 2024

Copy link
Copy Markdown

GH-122806 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Aug 7, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Aug 7, 2024
@serhiy-storchaka
[3.12] pythongh-118814: Fix the TypeVar constructor when name is pass…
87c6e9d
…ed by keyword (pythonGH-122664)

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc6)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app

bedevere-app Bot commented Aug 7, 2024

Copy link
Copy Markdown

GH-122807 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Aug 7, 2024
@serhiy-storchaka serhiy-storchaka removed their assignment Aug 7, 2024
erlend-aasland
erlend-aasland reviewed Aug 7, 2024
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka added a commit that referenced this pull request Aug 8, 2024
@serhiy-storchaka
[3.13] gh-118814: Fix the TypeVar constructor when name is passed by …
1fd1c6c
…keyword (GH-122664) (GH-122806)

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc6)
serhiy-storchaka added a commit that referenced this pull request Aug 8, 2024
@serhiy-storchaka
[3.12] gh-118814: Fix the TypeVar constructor when name is passed by …
f2cc8ad
…keyword (GH-122664) (GH-122807)

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc6)
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
@serhiy-storchaka @blhsing
pythongh-118814: Fix the TypeVar constructor when name is passed by k…
5890a6c
…eyword (pythonGH-122664)

Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland left review comments
@JelleZijlstra JelleZijlstra Awaiting requested review from JelleZijlstra JelleZijlstra is a code owner
@AlexWaygood AlexWaygood Awaiting requested review from AlexWaygood AlexWaygood is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@serhiy-storchaka @picnixz @erlend-aasland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.