Message301872
The following code causes an assertion failure in PyErr_WriteUnraisable() (in
Python/errors.c):
class BadException(Exception):
__module__ = None
class BadClass:
def __del__(self):
raise BadException
foo = BadClass()
del foo
this is because PyErr_WriteUnraisable() assumes that __module__ is a string,
and passes it to _PyUnicode_EqualToASCIIId(), which asserts it received a string.
what is the wanted behavior in such a case?
should we ignore the bad __module__ and print '<unknown>' as the module name
in the traceback? |
|
| Date |
User |
Action |
Args |
| 2017-09-11 12:49:19 | Oren Milman | set | recipients:
+ Oren Milman |
| 2017-09-11 12:49:19 | Oren Milman | set | messageid: <1505134159.81.0.794494335089.issue31418@psf.upfronthosting.co.za> |
| 2017-09-11 12:49:19 | Oren Milman | link | issue31418 messages |
| 2017-09-11 12:49:19 | Oren Milman | create | |
|