[issue10093] Warn when files are not explicitly closed

Benjamin Peterson report at bugs.python.org
Fri Oct 29 16:09:32 CEST 2010


Benjamin Peterson <benjamin at python.org> added the comment:

2010/10/29 Marc-Andre Lemburg <report at bugs.python.org>:
>
> Marc-Andre Lemburg <mal at egenix.com> added the comment:
>
> Antoine Pitrou wrote:
>>
>> Antoine Pitrou <pitrou at free.fr> added the comment:
>>
>>> The warning will trigger without any reason.
>>
>> Well, by now you should have understood the reason, so I conclude that
>> you are either 1) deaf 2) stupid 3) deliberately obnoxious.
>>
>> This is my last answer to you on this topic. Goodbye.
>
> Ignoring your insults, I think the problem is that you fail to see
> point or address it:
>
> Warnings in Python are meant to tell programmers that something
> should be fixed. The warnings in the examples I gave do not point
> to cases that need to be fixed, in fact, they are very common
> idioms used in Python books, examples and tutorials.

They're not particularly good idioms then. Leaving files open
haphazardly leads to subtle bugs as our test suite has shown.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10093>
_______________________________________


More information about the Python-bugs-list mailing list