Confusing behavior with sys.monitoring.DISABLE
#118327
Labels
type-bug
An unexpected behavior, bug, or error
sys.monitoring.DISABLE
#118327
Bug report
Bug description:
The above script prints:
The first run "leaks" the disabled callback to the second run.
If I uncomment the line:
The script will print:
It stops the "leaking".
This problem can be workarounded by calling
sys.monitoring.restart_events()
at the end oftest()
. But, it is not clear if it is necessary. This cpython test:cpython/Lib/test/test_monitoring.py
Lines 670 to 682 in a5eeb83
does not use
sys.monitoring.restart_events()
.CPython versions tested on:
3.12
Operating systems tested on:
Linux, macOS
The text was updated successfully, but these errors were encountered: