On 9/21/2013 6:15 PM, R. David Murray wrote:
On Sat, 21 Sep 2013 17:16:41 -0400, Terry Reedy
wrote: When an AttributeError is raised in a __del__ method, it is caught and ignored, except that it is not completely ignored but is replaced by a warning message sent to stderr. Example:
class C(): def __del__(self): raise AttributeError
c=C() del c Exception AttributeError: AttributeError() in
> ignored This is a replacement for a traceback. In later Python versions, the full traceback is printed.
The above is 3.3.2. In 3.4.0a2, the traceback of the ignored exception
is indeed printed.
Exception ignored in:
In the general case it represents a bug in the code that should be fixed. Most such errors arise from the vagaries of module finalization (such as your issue 19021),
Lets call that a buglet ;-). Not really harmful, but annoying. Accepting that even such buglets 'should' be fixed in the stdllib, so that the message does not appear, is there any reason *not* to make it a RuntimeWarning so that users who care about clean output can filter it out while waiting for us to fix it? This would be a separate issue from #12085.
but not all of them do: the rest represent real bugs in __del__ methods (which are executed asynchronously in the general case).
Which is why the message should be printed, so the developer can decide. -- Terry Jan Reedy