Message230950
When there's an unraisable exception (e.g. in __del__), and there's an exception in __repr__ as well, PyErr_WriteUnraisable returns after writing "Exception ignored in:" immediately.
I'd expect it to fall back to the default __repr__ instead.
See the attached example script.
Output with 3.4:
=== Obj ===
Exception ignored in: <bound method Obj.__del__ of <__main__.Obj object at 0x7fd842deb4a8>>
Traceback (most recent call last):
File "test.py", line 4, in __del__
raise Exception('in del')
Exception: in del
=== BrokenObj ===
Exception ignored in: (no newline)
Output with 2.7:
=== Obj ===
Exception Exception: Exception('in del',) in <bound method Obj.__del__ of <__main__.Obj object at 0x7fa824dbfa50>> ignored
=== BrokenObj ===
Exception Exception: Exception('in del',) in ignored
The output with 2.7 is a bit more useful, but still confusing. |
|
Date |
User |
Action |
Args |
2014-11-10 10:22:49 | The Compiler | set | recipients:
+ The Compiler |
2014-11-10 10:22:49 | The Compiler | set | messageid: <1415614969.23.0.620237340846.issue22836@psf.upfronthosting.co.za> |
2014-11-10 10:22:49 | The Compiler | link | issue22836 messages |
2014-11-10 10:22:49 | The Compiler | create | |
|