Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support chaining in the exception formatter #11

Open
mgedmin opened this issue Dec 21, 2017 · 0 comments
Open

Support chaining in the exception formatter #11

mgedmin opened this issue Dec 21, 2017 · 0 comments

Comments

@mgedmin
Copy link
Member

mgedmin commented Dec 21, 2017

In zodbbrowser's test suite I monkey-patch traceback.print_exception and traceback.format_exception so I can see the additional bits that zope.exception formatter provides (__traceback_info__ etc.) when an uncaught exception happens in a background thread.

On Python 3 this causes a problem:

Unhandled exception in thread started by <bound method Thread._bootstrap of <Thread(server, started daemon 140073167124224)>>
Traceback (most recent call last):
  ...
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 879, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.4/threading.py", line 921, in _bootstrap_inner
    (self.name, _format_exc()), file=self._stderr)
  File "/usr/lib/python3.4/traceback.py", line 256, in format_exc
    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
TypeError: format_exception() got an unexpected keyword argument 'chain'

So: I would like to add support for exception chaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant