python-trio / python-trio/trio

Error in trio's sys.excepthook when maximum recursion depth exceeded

Open
#1,818 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.3k
Forks
431
Avg merge
2d 17h
Merged PRs (30d)
6

Description

The following code triggers an error in the trio-injected sys.excepthook:

import trio

def f():
    try:
        f()
    except:
        raise Exception("foo")

f()

That is, if we "import trio" before running f(), we'll see an Error in sys.excepthook: before the main exception; if we don't import trio before running f(), the exception is printed just fine as normal, with no error in sys.excepthook.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the supplied recursion-depth reproducer with and without import trio to confirm the differing traceback behavior. Trace Trio's sys.excepthook integration and identify where the hook handles the resulting exception; done means the example no longer reports an error in sys.excepthook and still prints the main exception normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.