Issue 33849: Caught infinite recursion resets the trace function
Created on 2018-06-12 22:24 by belopolsky, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg319409 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2018-06-12 22:24 | |
Consider the following code:
import sys
def trace(frame, event, arg):
pass
def f():
f()
sys.settrace(trace)
print(sys.gettrace())
try:
f()
except RuntimeError:
pass
print(sys.gettrace())
When I run it, I get
<function trace at 0x108865158>
None
Apparently, the infinite recursion somehow resets the trace function. This interferes with the coverage tools.
|
|||
| msg319410 - (view) | Author: Alexander Belopolsky (belopolsky) * ![]() |
Date: 2018-06-12 22:29 | |
It looks like this has been known for quite some time. See issue10933. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:01 | admin | set | github: 78030 |
| 2018-06-12 22:30:31 | belopolsky | set | status: open -> closed stage: needs patch -> resolved |
| 2018-06-12 22:30:19 | belopolsky | set | superseder: Tracing disabled when a recursion error is triggered (even if properly handled) resolution: duplicate |
| 2018-06-12 22:29:40 | belopolsky | set | messages: + msg319410 |
| 2018-06-12 22:24:35 | belopolsky | create | |
