Guido van Rossum added the comment:
I don't think this is worth fixing; you'll get an I/O error as soon as
I/O is attempted, which is upon the first read() for input, or upon the
firsh (implicit or explicit) flush() on output. You can't tell whether
a fd is valid or not without attempting I/O on
Christian Heimes added the comment:
Python 2.5 and probably 2.6 suffer from the same problem although it's
harder to trigger it.
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license"
New submission from Christian Heimes:
The bug is related to http://bugs.python.org/issue1415 and occurs only
with the latest patch from #1415.
Writing to an invalid fd doesn't raise an exception:
>>> f = open(100, 'w')
>>> f.fileno()
100
>>> f.write("test")
4
However reading or opening an inva