Serhiy Storchaka added the comment: But the same issue exists with regular files.
>>> with open('/dev/full', 'wb') as f: ... f.write(b'x'*10000) ... Traceback (most recent call last): File "<stdin>", line 2, in <module> OSError: [Errno 28] No space left on device And using Python implementation for detailed traceback: >>> import _pyio >>> with _pyio.open('/dev/full', 'wb') as f: ... f.write(b'x'*10000) ... Traceback (most recent call last): File "<stdin>", line 2, in <module> File "/home/serhiy/py/cpython/Lib/_pyio.py", line 1184, in write self._flush_unlocked() File "/home/serhiy/py/cpython/Lib/_pyio.py", line 1211, in _flush_unlocked n = self.raw.write(self._write_buf) OSError: [Errno 28] No space left on device During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 2, in <module> File "/home/serhiy/py/cpython/Lib/_pyio.py", line 451, in __exit__ self.close() File "/home/serhiy/py/cpython/Lib/_pyio.py", line 767, in close self.flush() File "/home/serhiy/py/cpython/Lib/_pyio.py", line 1204, in flush self._flush_unlocked() File "/home/serhiy/py/cpython/Lib/_pyio.py", line 1211, in _flush_unlocked n = self.raw.write(self._write_buf) OSError: [Errno 28] No space left on device What behavior you expect? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22350> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com