-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
PYTHON_GIL=1 and -Xgil=1 should work in non-free-threading builds #123275
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Comments
hugovk
added
topic-free-threading
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
labels
Aug 24, 2024
corona10
pushed a commit
that referenced
this issue
Sep 5, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 5, 2024
…eaded builds (pythongh-123276) (cherry picked from commit 84ad264) Co-authored-by: Peter Bierma <[email protected]>
corona10
pushed a commit
that referenced
this issue
Sep 6, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 6, 2024
…-123754) (cherry picked from commit fe24b71) Co-authored-by: Peter Bierma <[email protected]>
corona10
pushed a commit
that referenced
this issue
Sep 6, 2024
…) (gh-123755) gh-123275: Add tests for `PYTHON_GIL=1` and `-Xgil=1` (gh-123754) (cherry picked from commit fe24b71) Co-authored-by: Peter Bierma <[email protected]>
@ZeroIntensity Thanks for the work! |
@tonybaloney |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
In a non-free-threading build of Python 3.13, using environment variables or CLI arguments to ensure the GIL is used results in an error:
This is user-hostile behavior that makes it more difficult to write tests and set up test environments. It makes sense that
PYTHON_GIL=0
or-Xgil=0
must fail for non-free-threading builds, but there's no reason why a user requesting that the GIL be enabled in a build where the GIL is always enabled should be an error rather than a no-op.I bumped into this while working on the test suite for PyStack, where it has forced me into this nasty hack:
instead of what I had originally wanted to do:
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
-Xgil=1
andPYTHON_GIL=1
on non-free-threaded builds #123276-Xgil=1
andPYTHON_GIL=1
on non-free-threaded builds (gh-123276) #123753PYTHON_GIL=1
and-Xgil=1
#123754PYTHON_GIL=1
and-Xgil=1
(gh-123754) #123755The text was updated successfully, but these errors were encountered: