Skip to content

[C API] Py_mod_multiple_interpreters Added to Limited C API Without Versioning #111698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericsnowcurrently opened this issue Nov 3, 2023 · 2 comments
Assignees
Labels
3.12 only security fixes 3.13 bugs and security fixes topic-C-API topic-subinterpreters type-bug An unexpected behavior, bug, or error

Comments

@ericsnowcurrently
Copy link
Member

ericsnowcurrently commented Nov 3, 2023

Bug report

(See #110968 (comment).)

When I added Py_mod_multiple_interpreters1 to Include/moduleobject.h, I forgot to restrict the limited API version in which it should be there.

The fix should be something similar to what we did in gh-110969, combined with gh-111584. We will need to backport the change to 3.12.

Basically, the change would be something like:

- #define Py_mod_multiple_interpreters 3
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000
+ #  define Py_mod_multiple_interpreters 3
+ #endif

FYI, gh-110968 already dealt with the same issue for the pre-defined slot values (e.g. Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED).

CC @encukou, @vstinner

Linked PRs

Footnotes

  1. I added Py_mod_multiple_interpreters in gh-104148 (1c420e1), along with some pre-defined values (e.g. Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED). The direct motivation was to make an implicit contract in PEP 489 (i.e. "must support subinterpreters") explicit. (See gh-104108.) The indirect motivation was PEP 684.

@ericsnowcurrently ericsnowcurrently added type-bug An unexpected behavior, bug, or error topic-C-API 3.12 only security fixes 3.13 bugs and security fixes labels Nov 3, 2023
@vstinner
Copy link
Member

vstinner commented Nov 3, 2023

Do you plan to propose a PR?

@ericsnowcurrently
Copy link
Member Author

Yeah, I'll probably do that today.

@ericsnowcurrently ericsnowcurrently self-assigned this Nov 3, 2023
ericsnowcurrently added a commit that referenced this issue Nov 6, 2023
…MITED_API (gh-111707)

This should have been done in gh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See gh-110968.)
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 6, 2023
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
(cherry picked from commit 836e0a7)

Co-authored-by: Eric Snow <[email protected]>
hugovk pushed a commit to hugovk/cpython that referenced this issue Nov 8, 2023
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
ericsnowcurrently added a commit that referenced this issue Nov 28, 2023
…r Py_LIMITED_API (gh-111707) (gh-111787)

This should have been done in gh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See gh-110968.)
(cherry picked from commit 836e0a7)

Co-authored-by: Eric Snow <[email protected]>
@vstinner vstinner closed this as completed Dec 2, 2023
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
… Py_LIMITED_API (pythongh-111707)

This should have been done in pythongh-104148.

(A similar fix has already be done for that slot's value macros, and backported to 3.12.  See pythongh-110968.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes topic-C-API topic-subinterpreters type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants