Skip to content

[3.14] gh-144330: Initialize classmethod and staticmethod in new#144498

Merged
vstinner merged 2 commits intopython:3.14from
vstinner:cm_new14
Feb 6, 2026
Merged

[3.14] gh-144330: Initialize classmethod and staticmethod in new#144498
vstinner merged 2 commits intopython:3.14from
vstinner:cm_new14

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Feb 5, 2026

Initialize cm_callable and sm_callable to None in classmethod and staticmethod constructor.

Initialize cm_callable and sm_callable to None in classmethod and
staticmethod constructor.

Co-authored-by: Aniket Singh Yadav <singhyadavaniket43@gmail.com>
@vstinner
Copy link
Member Author

vstinner commented Feb 5, 2026

"Tests / Change detection / Create context from changed files" fails with:

+ git fetch origin +f27896c3191c5ffd85a62ac89a98f72fb14d9c61:remotes/origin/3.14 '--shallow-since=2026-02-05 12:04:04 +0100' --no-tags --prune --no-recurse-submodules
fatal: error processing shallow info: 4

I don't know why.

@StanFromIreland
Copy link
Member

StanFromIreland commented Feb 5, 2026

Maybe a GH outage, it sets github.event.pull_request.commits: 0 causing the error. I suggest trying to re-run in a bit.

@sergey-miryanov
Copy link
Contributor

I hope you don't mind if I ask :)
You did simpler version of 3.13 and 3.14 because #144469 changes user-observable behavior and that change considered as a feature?

@StanFromIreland
Copy link
Member

StanFromIreland commented Feb 5, 2026

I tried it again, still github.event.pull_request.commits is 0. Maybe the have some internal corruption, @webknjaz have you seen this before? I'll try updating the branch, that'll (theoretically) change the number and jog the data.

Edit: that worked, though I still wonder why it occurred in the first place... GitHub doing its thing 🙃

@vstinner
Copy link
Member Author

vstinner commented Feb 6, 2026

You did simpler version of 3.13 and 3.14 because #144469 changes user-observable behavior and that change considered as a feature?

Correct. The change ffa6852 introduces behavior changes, such as:

PyClassMethod_New() and PyStaticMethod_New() now copy attributes of
the wrapped functions: __module__, __name__, __qualname__ and
__doc__.

@vstinner vstinner merged commit 160810d into python:3.14 Feb 6, 2026
45 checks passed
@vstinner vstinner deleted the cm_new14 branch February 6, 2026 09:21
@vstinner vstinner added the needs backport to 3.13 bugs and security fixes label Feb 6, 2026
@miss-islington-app
Copy link

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 6, 2026
pythonGH-144498)

pythongh-144330: Initialize classmethod and staticmethod in new

Initialize cm_callable and sm_callable to None in classmethod and
staticmethod constructor.
(cherry picked from commit 160810d)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Aniket Singh Yadav <singhyadavaniket43@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 6, 2026

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 6, 2026
@sergey-miryanov
Copy link
Contributor

@vstinner Thanks!

vstinner added a commit that referenced this pull request Feb 6, 2026
…144498) (#144537)

[3.14] gh-144330: Initialize classmethod and staticmethod in new (GH-144498)

gh-144330: Initialize classmethod and staticmethod in new

Initialize cm_callable and sm_callable to None in classmethod and
staticmethod constructor.
(cherry picked from commit 160810d)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Aniket Singh Yadav <singhyadavaniket43@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@webknjaz
Copy link
Member

webknjaz commented Feb 6, 2026

Edit: that worked, though I still wonder why it occurred in the first place... GitHub doing its thing 🙃

@StanFromIreland GH updates the ephemeral PR merge pointer on certain events (like pushing a new commit). When there's outages, these events aren't delivered to the respective components, which may cause PR state to go out of sync. Once the outage is over, pushing again should generally fix it, but on a rare occasion GH's internal state is so broken that nothing can salvage it — in such cases the only solution would be creating a new PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants