try... except with unknown error types
nagle at animats.com
Thu Sep 1 06:22:23 CEST 2011
On 8/21/2011 5:30 PM, Steven D'Aprano wrote:
> 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.)
I think I reported that some years ago.
There were some other errors in the URL and SSL area that
weren't subclasses of EnvironmentError. It's also possible
to get UnicodeError from URL operations.
More information about the Python-list