testing-cabal / traceback2

Backport of the Python stdlib traceback module
Other
5 stars 9 forks source link

bpo-28603 Fix tracebacks for unhashable exceptions #11

Closed zaneb closed 6 years ago

zaneb commented 7 years ago

TracebackException checks for loops between exceptions to prevent an infinite traceback. It does this by putting the already-seen exception into a set. This means that unhashable exception objects will cause an error - an error that itself can likely not be printed because of the presence of the unhashable exception in the chain.

In this case, we don't actually care about equality of the objects as defined by the class designer; we want to check that we don't encounter the self-same exception object, from a chain that is necessarily all in memory at the same time. We can trivially do so by comparing identities instead of equality.

An equivalent patch was merged in the CPython standard library.

zaneb commented 6 years ago

The build error was from trying to pip install requests on Python 3.2, and isn't related.

berkerpeksag commented 6 years ago

Thanks!