try... except with unknown error types
steve+comp.lang.python at pearwood.info
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