try... except with unknown error types

Steven D'Aprano steve+comp.lang.python at
Mon Aug 22 02:30:37 CEST 2011

Chris Angelico wrote:

> A new and surprising mode of network failure would be indicated by a
> new subclass of IOError or EnvironmentError. 


I don't see why you expect this, when *existing* network-related failures

>>> import socket
>>> issubclass(socket.error, EnvironmentError)

(Fortunately that specific example is fixed in Python 3.)

Besides, there's a world of difference between "should be" and "are".


More information about the Python-list mailing list