[New-bugs-announce] [issue13037] [Regression] socket.error does not inherit from IOError as documented

Christopher Egner report at bugs.python.org
Fri Sep 23 20:50:42 CEST 2011


New submission from Christopher Egner <cbegner at gmail.com>:

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.

----------
components: IO
messages: 144467
nosy: Christopher.Egner
priority: normal
severity: normal
status: open
title: [Regression] socket.error does not inherit from IOError as documented
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13037>
_______________________________________


More information about the New-bugs-announce mailing list