Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Parts of traceback is lost when reraising exceptions #10
This issue was reported by @adamcik at IRC after review of the Pykka source code.
At https://github.com/jodal/pykka/blob/master/pykka/gevent.py#L37 a
At https://github.com/jodal/pykka/blob/master/pykka/future.py#L93 a exception thrown in a
The exceptions should be reraised using the three-argument
raise exc_class, exc_instance, traceback
raise _Timeout, _Timeout(e), sys.exc_info()
In cases where the exception is thrown in one thread and reraised in another thread, the first thread must make sure to pass on both the exception object and the traceback, found at
I would suggest changing the future.py code to pass around (value, exc_info) instead of just value. This seems more robust than assuming that any value that is an exception should be raised. Looking at other code bases that handle this type of re-raise issues there seem to be some gotchas here with respect to circular loops created by data in the traceback that you will probably have to avoid.