New submission from behind thebrain <behindthebr...@zoho.eu>:

If pdb encounters most exception types, it handles them as would be expected. 
However, if pdb encounters a RecursionError: maximum recursion depth exceeded 
while calling a Python object, then it will continue to execute the code 
accurately, but the debugger itself will no longer interactively wait for user 
input, but instead, just speed through the rest of execution. The code below 
reproduces the error on python 3.7, 3.8, and 3.9.

```python3
import sys
import inspect

sys.setrecursionlimit(50)


def except_works() -> None:
    raise Exception


try:
    except_works()
except Exception as e:
    print("Exception was:", e)


def funcy(depth: int) -> None:
    print(f"Stack depth is:{len(inspect.stack())}")
    if depth == 0:
        return
    funcy(depth - 1)


try:
    funcy(60)
except Exception as e:
    print("Exception was:", e)

print("This executes without the debugger navigating to it.")
```

----------
components: Interpreter Core
files: runawaystepping.py
messages: 389051
nosy: behindthebrain
priority: normal
severity: normal
status: open
title: RecursionError depth exceptions break pdb's interactive tracing.
versions: Python 3.8
Added file: https://bugs.python.org/file49891/runawaystepping.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43548>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to