When my process ends, I get output to stderr that looks like:
Exception exceptions.TypeError: "'NoneType' object is not callable" in <function <lambda> at 0x5507d70> ignored
My understanding is that this is caused by exceptions being generated during garbage collection (del() ?) or the weakref callback which I know is being used in this application.
What are some methods for finding out where this is coming from ?
The issue here isn’t with lambdas: lambda functions do have debug information.
(
a.__code__in python3.)The problem is with the fallback exception formatting: it’s not showing a stack trace, which is where this information is normally shown.
If you want to try to improve this, the problem seems to be in Python/errors.c, in PyErr_WriteUnraisable(). I don’t know if there are any deeper issues making this difficult, but I suspect not. The traceback should be in “tb” after PyErr_Fetch() is called.