This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urlopen(url_to_a_non-existing-domain) raises gaierror
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jhylton Nosy List: bavarian, jhylton
Priority: normal Keywords:

Created on 2003-04-18 18:52 by bavarian, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (2)
msg15513 - (view) Author: Joachim Werner (bavarian) Date: 2003-04-18 18:52
In Python 2.1.3 trying to open a URL that does point 
to a non-existing domain with urlopen from urllib2 will 
raise a

urllib2.URLError: <urlopen error host not found>

That's what I'd expect Python 2.2.2 to do, too. But 
with Python 2.2.2 I get a

socket.gaierror: (-2, 'Name or service not known')

Error instead. I think this is a bug because

a) one would not expect urlopen to raise errors other 
than HTTPError and URLError (from what the docs say)

b) it breaks code that relies on the error behaviour of 
Python 2.1.3

Cheers

Joachim
msg15514 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2003-05-04 23:45
Logged In: YES 
user_id=31392

Fixed in rev 1.40.
History
Date User Action Args
2022-04-10 16:08:13adminsetgithub: 38330
2003-04-18 18:52:21bavariancreate