Antoine Pitrou <[email protected]> added the comment:
I don't think mimicking EBADF is very useful. Reading from a closed socket is
usually a programming error, so it's not the kind of error you'll want to catch
at runtime.
AttributeError may not be very pretty though, so perhaps a ValueError can be
raised as with closed files:
>>> f = open("LICENSE")
>>> f.close()
>>> f.read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: I/O operation on closed file.
----------
type: behavior -> enhancement
versions: -Python 2.7, Python 3.2
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9177>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com