A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-September/074747.html below:

[Python-Dev] urllib exception compatibility

[Python-Dev] urllib exception compatibilityJim Jewett jimjjewett at gmail.com
Thu Sep 27 02:35:36 CEST 2007
urllib goes to goes to some trouble to ensure that it raises IOError,
even when the underlying exception comes from another module.[*]  I'm
wondering if it would make sense to just have those modules'
exceptions inherit from IOError.

In particular, should socket.error, ftp.Error and
httplib.HTTPException (used in Py3K) inherit from IOError?

I'm also wondering whether it would be acceptable to change the
details of the exceptions.  For example, could

            raise IOError, ('ftp error', msg), sys.exc_info()[2]

be reworded, or is there there too much risk that someone is checking
for an "errno" of 'ftp error'?


[*]  This isn't a heavily tested path; some actually fail with a
TypeError since 2.5, because IOError no longer accepts argument tuples
longer than 3.  http://bugs.python.org/issue1209  Fortunately, this
makes me less worried about changing the contents of the specific
attributes to something more useful...

-jJ
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4