-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
gh-108223: Add [NOGIL] marker to sys.version #108239
Conversation
If Python is configured with --disable-gil, add " [NOGIL]" suffix to sys.version. It should help users to check if they are running a regular Python build with a GIL, or a custom Python build with the new experimental no GIL. sys.version is commonly requested in bug reports: knowing if Python was configured with --disable-gil should ease debug. Example on Linux with --disable-gil: $ ./python -VV Python 3.13.0a0 (heads/main-dirty:d63972e289, Aug 21 2023, 21:43:45) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] [NOGIL]
Can't you use |
I think changing the format of |
You mean to leave sys.version unchanged and ask users to dig into sysconfig to check if they are using a NOGIL build or not? |
Yes. |
Sure, I'm worried that if tomorrow NOGIL becomes more popular, users may start reporting bugs without even knowing that they use an experimental NOGIL build. Adding a marker to |
I don't think changing the semantics of |
I wrote It's hard to decide which build options are relevant to a bug report or not, so I wrote Should we include info which can change how C extensions are loaded? Compiler options? Python ABI? If you get a crash in a third party extension, is it useful to know how it was built? (well, sometimes it is: see this fastmath issue :-)). I also added
I'm not sure neither, so I close my issue. We can revisit this idea later ;-) |
Exactly; right now, nogil makes sense. In two years time, who knows what makes sense to include :) |
If Python is configured with --disable-gil, add " [NOGIL]" suffix to sys.version. It should help users to check if they are running a regular Python build with a GIL, or a custom Python build with the new experimental no GIL.
sys.version is commonly requested in bug reports: knowing if Python was configured with --disable-gil should ease debug.
Example on Linux with --disable-gil: