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.

Title: urllib.request.HTTPRedirectHandler raises HTTPError when Location header is relative
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
Status: closed Resolution: duplicate
Dependencies: Superseder: [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issue
View: 13696
Assigned To: orsenthil Nosy List: jspenguin, martin.panter, orsenthil, pitrou
Priority: normal Keywords:

Created on 2012-05-10 01:28 by jspenguin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit jspenguin, 2012-05-10 01:28 Test script
Messages (3)
msg160319 - (view) Author: jspenguin (jspenguin) Date: 2012-05-10 01:28
If a server returns a relative URL in the 'Location:' header, HTTPRedirectHandler will fail because it checks the scheme of the URL before it calls urljoin() to convert it to an absolute URL.
msg160330 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-05-10 09:24
See issue12275. Seems like a common request.
msg240463 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-04-11 06:33
Looks like this was a 3.2 regression, but was fixed in Issue 13696.
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 58972
2015-04-11 06:33:59martin.pantersetstatus: open -> closed

superseder: [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issue

nosy: + martin.panter
messages: + msg240463
resolution: duplicate
stage: resolved
2012-05-10 09:24:20pitrousetnosy: + pitrou
messages: + msg160330
2012-05-10 03:01:39orsenthilsetassignee: orsenthil

nosy: + orsenthil
2012-05-10 01:28:07jspenguincreate