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: urllib.urlopen should put the http-error-code in .info()
Type: enhancement Stage:
Components: None Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, kxroberto
Priority: normal Keywords:

Created on 2005-02-07 09:12 by kxroberto, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg61178 - (view) Author: kxroberto (kxroberto) Date: 2005-02-07 09:12
urllib.urlopen / open_http should put the
http-error-code somewhere in .info() 

the "fancy" error handling may be ok. But the errcode &
errmsg should not get lost and always be accessible ex
post.
In current style bare urllib.urlopen is hard to use.
(web pages are often down). I always need to fumble a
extra urllib.URLopener even for the simplest task.

E.g.:

f=urllib.urlopen('http://www.python.org/')
httpcode=f.info().get_errcode()

msg61274 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-01-20 11:45
For #1178141 I added f.getcode() in r60133.
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41540
2008-01-20 11:45:12georg.brandlsetstatus: open -> closed
resolution: out of date
messages: + msg61274
nosy: + georg.brandl
2005-02-07 09:12:39kxrobertocreate