New submission from Nick Coghlan: The exception chaining in the codecs subsystem is currently losing the details of the original traceback.
Compare this traceback from Python 3.3: >>> codecs.decode(b"abcdefgh", "hex_codec") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.3/encodings/hex_codec.py", line 20, in hex_decode return (binascii.a2b_hex(input), len(input)) binascii.Error: Non-hexadecimal digit found With the current behaviour of Python 3.4: >>> codecs.decode(b"abcdefgh", "hex") binascii.Error: Non-hexadecimal digit found The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> binascii.Error: decoding with 'hex' codec failed (Error: Non-hexadecimal digit found) The original traceback header and details are missing in the latter. It should look more like the following: >>> try: ... 1/0 ... except Exception as e: ... raise Exception("Explicit chaining") from e ... Traceback (most recent call last): File "<stdin>", line 2, in <module> ZeroDivisionError: division by zero The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 4, in <module> Exception: Explicit chaining ---------- assignee: ncoghlan components: Interpreter Core keywords: 3.4regression messages: 207142 nosy: ncoghlan priority: deferred blocker severity: normal stage: test needed status: open title: Codec exception chaining is losing traceback details type: behavior versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20105> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com