[issue10815] Write to /dev/full does not raise IOError

STINNER Victor report at bugs.python.org
Mon Jan 3 15:41:48 CET 2011


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

This issue is fixed in Python 3.2 beta 2:
--------
$ ./python 
>>> f=open("/dev/full", "wb")
>>> f.write(b'x')
1
>>> f.close()
IOError: [Errno 28] No space left on device
>>> ^D

sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/full'>
sys:1: ResourceWarning: unclosed file <_io.FileIO name='/dev/full' mode='wb'>
--------

If you would like to get the error earlier, disable the buffer (which is not completly possible for a text file, Python requires at least a line buffer).

Backport the fix to Python 3.1 is not a good idea because it may break programs using Python 3.1.

----------
nosy: +haypo
resolution:  -> fixed
status: open -> closed

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


More information about the Python-bugs-list mailing list