[Python-Dev] Revert #12085 fix for __del__ attribute error message

Terry Reedy tjreedy at udel.edu
Sun Sep 22 19:35:05 CEST 2013


On 9/21/2013 10:30 PM, Guido van Rossum wrote:
> Exceptions in __del__ point to bugs (sometimes in the stdlib) that
> should be fixed, period. The only reason they do not result in
> exceptions that are properly bubbled up and catchable is because __del__
> is called from a DECREF macro which has no return value.

That is clear enough. What fooled me is the word 'ignored', in both the 
doc and message. How about 'skipped' (for technical reasons)?

> Also, IMO
> writing to stderr is fair game -- reporting errors is what it is for.

So developers who really want to control all screen output should 
redirect or capture it somehow.

> As to making them warnings, I don't know that the warnings machinery is
> easily adaptable for this purpose. Warnings can be suppressed but they
> can also be turned into full exceptions; the latter doesn't really apply
> here (see previous paragraph). But I would not object if someone found a
> way to do this, though I'd prefer the default behavior to remain what it
> is in 3.4 (print a full traceback).

Antoine and Georg think it a dubious idea, so I will not pursue it. 
Developers who encounter messages from the stdlib can report and wait 
for a fix.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list