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: no way to get http result status from urllib
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, phr
Priority: normal Keywords:

Created on 2008-02-21 09:52 by phr, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg62613 - (view) Author: paul rubin (phr) Date: 2008-02-21 09:52
I don't see any way in the docs to get the status of an http request, in
particular I want to know whether it's a 404.  It does show up in the
guts of the library so maybe I can extract it somehow, but there should
be a simple documented way.

Also, the urllib doc says the info() method returns a mimetools.Message
instance, but what actually comes back is an httplib.HTTPMessage
instance.  I guess that's a subclass, but it's confusing.  The doc
should describe what actually comes back.
msg62656 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-02-21 20:19
I've committed a patch for this in the trunk, the addinfourl object has
a "code" attribute there.
History
Date User Action Args
2022-04-11 14:56:31adminsetgithub: 46404
2008-02-21 20:19:49georg.brandlsetstatus: open -> closed
resolution: out of date
messages: + msg62656
nosy: + georg.brandl
2008-02-21 09:52:52phrcreate