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.

Author martin.panter
Recipients EvensF, docs@python, martin.panter, orsenthil, r.david.murray
Date 2014-09-11.00:01:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
By removing the “addinfourl” methods for HTTP responses, you are making it unnecessarily hard to handle header fields and metadata from the response. I do not know of any other documented way of getting the eventual redirect target, other than geturl(). And code to parse the Content-Type, which I understand is also returned for file: URLs, would start to get ugly (untested):

info = getattr(response, "info", None)
if info:
    type = info().get_content_type()  # Easy!
    import cgi
    type = cgi.parse_header(response.getheader("Content-Type))[0]

Since a HTTP status code only seems to be returned for HTTP responses, deprecating or removing getcode() in favour of “HTTPResponse.status” might be okay, but I think info() and geturl() should stay.

Maybe a “url” attribute is more Pythonic, but as far as I am aware that has never been documented for Python 2 or 3 for any URL type. I would not expect much existing code to be using it, and deprecating geturl() seems like a needless annoyance.
Date User Action Args
2014-09-11 00:01:20martin.pantersetrecipients: + martin.panter, orsenthil, r.david.murray, docs@python, EvensF
2014-09-11 00:01:20martin.pantersetmessageid: <>
2014-09-11 00:01:20martin.panterlinkissue21228 messages
2014-09-11 00:01:20martin.pantercreate