This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [Regression] socket.error does not inherit from IOError as documented
Type: behavior Stage:
Components: IO Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Christopher.Egner
Priority: normal Keywords:

Created on 2011-09-23 18:50 by Christopher.Egner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg144467 - (view) Author: Christopher Egner (Christopher.Egner) Date: 2011-09-23 18:50
http://docs.python.org/library/socket.html#socket.error
"Changed in version 2.6: socket.error is now a child class of IOError."

However, this is not the case.

$ python
Python 2.7.2 (default, Aug 18 2011, 18:26:35) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> isinstance( socket.error, IOError )
False


Catching IOError in except blocks does not catch socket.error, as one might expect according to the documentation.
msg144468 - (view) Author: Christopher Egner (Christopher.Egner) Date: 2011-09-23 18:52
Or I could learn to type...
History
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57246
2011-09-23 18:52:25Christopher.Egnersetstatus: open -> closed
resolution: not a bug
messages: + msg144468
2011-09-23 18:50:41Christopher.Egnercreate