2010/9/29 Antoine Pitrou <solip...@pitrou.net>:
>
> Hello,
>
>> I'd like to ask your opinion on this change; I think it should be reverted
>> or at least made silent by default.  Basically, it prints a warning like
>>
>>       gc: 2 uncollectable objects at shutdown:
>>           Use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them.
>>
>> at interpreter shutdown if gc.garbage is nonempty.
>
> I would like to piggy-back on this discussion to suggest further
> warnings (either by default, or switchable).
>
> One feature I've often considered would be to add a warning in FileIO
> and socket dealloc if these objects haven't been closed explicitly. In
> most situations, relying on garbage collection to shutdown OS resources
> (here, file descriptors) is something we like to discourage.
> Furthermore, it can produce real bugs, especially under Windows when
> coupled with refererence cycles created by traceback objects (the
> random test_tarfile failures on the Windows buildbots were a symptom of
> that; their cause would have been obvious with such warnings).
>
> What do you think?

It seems like a slippery slope. Sometimes you really don't care like
when you're just hacking together a quick script.


-- 
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to