ENOSPC doesn't cause exception?

Jeff Epler jepler at unpythonic.net
Fri Sep 27 15:54:19 EDT 2002

Can someone tell me why this doesn't cause an exception?
$ python -c print > /dev/full

(/dev/full is a special device found on at least some kinds of Linux,
which always returns -ENOSPC when written)

if I use 'strace', I can see that -ENOSPC is returned from write():
$ strace -e write python -c print > /dev/full
write(1, "\n", 1)                       = -1 ENOSPC (No space left on device)

I would expect this to print something like
Traceback (most recent call last):
  File "<string>", line 1, in ?
OSError: [Errno 28] No space left on device

I tested this on Python 1.5.2 and Python 2.3a0 CVS, so it doesn't appear
to be anything new...


More information about the Python-list mailing list