Uh oh!
There was an error while loading. Please reload this page.
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]
vstinner
commented
Aug 21, 2023
erlend-aasland
commented
Aug 22, 2023
Can't you use |
erlend-aasland
commented
Aug 22, 2023
I think changing the format of |
vstinner
commented
Aug 22, 2023
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? |
erlend-aasland
commented
Aug 22, 2023
Yes. |
vstinner
commented
Aug 22, 2023
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 |
erlend-aasland
commented
Aug 22, 2023
I don't think changing the semantics of |
vstinner
commented
Aug 22, 2023
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 ;-) |
erlend-aasland
commented
Aug 22, 2023
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: