microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.52k stars 673 forks source link

Set ceval.tracing_possible flag for all subinterpreters on Python 3.9. #7879

Closed int19h closed 2 months ago

StellaHuang95 commented 2 months ago

What does this ceval.tracing_possible flag do?

int19h commented 2 months ago

It is an internal flag in the Python interpreter that is set when a tracing callback (which is responsible for things like stepping and breakpoints) is registered. If it is not set, the bytecode interpreter inner loop takes the fast path which is not going to invoke the callback, hence stepping/breakpoints not working.

For Python <3.9, this was a global flag shared by all subinterpreters in the process. In 3.9, it became a per-interpreter flag, but the code was only setting it for the first subinterpreter. I believe that ArcGIS is using multiple subinterpreters, and that is why they are affected by the issue (going by their version history, it started showing up for them when they switched to Python 3.9 for their hosted interpreter).

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud