This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author behindthebrain
Recipients behindthebrain
Date 2021-03-19.02:44:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616121895.83.0.21835485789.issue43548@roundup.psfhosted.org>
In-reply-to
Content
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.")
```
History
Date User Action Args
2021-03-19 02:44:55behindthebrainsetrecipients: + behindthebrain
2021-03-19 02:44:55behindthebrainsetmessageid: <1616121895.83.0.21835485789.issue43548@roundup.psfhosted.org>
2021-03-19 02:44:55behindthebrainlinkissue43548 messages
2021-03-19 02:44:55behindthebraincreate