[issue4233] open(0, closefd=False) prints 3 warnings

STINNER Victor report at bugs.python.org
Sat Nov 1 02:12:24 CET 2008


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

@christian: Your patch doesn't work: if close() if called twice, the 
file is really closed :-/

Here is a new patch:
 - _FileIO.close() sets self->fd to -1 but don't show a warning anymore 
because the operation is valid: it does really close the _FileIO object
 - add two tests for two problems: read is now blocked if the file is 
closed, and the warning displayed by FileIO.__del__

----------
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file11921/fileio_closefd.patch

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


More information about the Python-bugs-list mailing list