[issue5321] I/O error during one-liner gives no (!) diagnostic (and fails to return OS error status)

Antoine Pitrou report at bugs.python.org
Fri Jul 9 20:51:19 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> The issue is that when close() calls flush(), errors are silently
> discarded

This has been fixed in 3.1 and 3.2:

$ ./python -c "with open('/dev/full', 'w') as f: print('a', file=f)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 28] No space left on device

However, it seems sys.stdout has a different treatment:

$ ./python -c "print('a')" > /dev/full
$

----------

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


More information about the Python-bugs-list mailing list