Skip to content

MNT: account for removed opcode in Python 3.16 - #599

Merged
lesteve merged 1 commit into
cloudpipe:masterfrom
tacaswell:mnt/py316
Sep 10, 2026
Merged

MNT: account for removed opcode in Python 3.16#599
lesteve merged 1 commit into
cloudpipe:masterfrom
tacaswell:mnt/py316

Conversation

@tacaswell

Copy link
Copy Markdown
Contributor

This is probably too early to start worrying about this, but CPython removed this opcode in python/cpython#146314 / python/cpython@a3dc784

This is not the most elegant way of fixing this, but it kept the public API as stable as possible.

The tests pass in a py316 build. From a very quick skim of the code it looks like these globals are only used in one function and only used to get the names of things that are global. Given that upstream replaced the delete with push NULL and then store, I think that this will still work as intended.

Please feel free to treat this as an overly enthusiastic bug report rather than a PR 😄 .

a3dc7849a3a171f9615f233fce5300f983db6908 /  gh-145857 removed this
opcode
@tacaswell

Copy link
Copy Markdown
Contributor Author

(force-pushed because I decided I wanted this done with a different email address, the email + signing key are the only changes)

@lesteve lesteve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR 🙏!

Out of pure curiosity, how did you bump into this?

For context the CPython PR: python/cpython#146314. This is only in main right now, so indeed this is specific to CPython 3.16.

I double-checked sys.version_info < (3, 16) works for CPython built from main (I wasn't 100% sure off the top of my head 😅)

❯ ./python
Python 3.16.0a0 (heads/main:f715d25a8f0, Sep 10 2026, 08:12:53) [GCC 16.2.1 20260810] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version_info < (3, 16)
False

I am not a cloudpickle maintainer, but I'll try get a cloudpickle developer to trigger the workflow and review the PR.

@lesteve lesteve changed the title MNT: account for removed opcode MNT: account for removed opcode in Python 3.16 Sep 10, 2026
@lesteve
lesteve merged commit 4af5936 into cloudpipe:master Sep 10, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants