[issue35370] Add _PyEval_SetTrace(tstate, func, arg) function

STINNER Victor report at bugs.python.org
Fri Mar 13 11:50:27 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

Fabio: I added _PyEval_SetProfile() and _PyEval_SetTrace() which take a tstate parameter. These functions have a constraint: the caller must hold the GIL. Is it an acceptable constraint for you?

That's not something new, it's already the code in Python 3.8, it's just that it wasn't documented. In Python 3.7, it was less important: Python 3.8 added a call to PySys_Audit() which can execute arbitrary Python code.

Anyway, touching Python internals without holding the GIL is risky: see bpo-1021318 for example.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35370>
_______________________________________


More information about the Python-bugs-list mailing list