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.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder: [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issue
View: 13696
Assigned To: Nosy List: lilydjwg, martin.panter, orsenthil, pitrou
Priority: normal Keywords:

Created on 2011-06-07 07:10 by lilydjwg, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg137791 - (view) Author: lilydjwg (lilydjwg) * Date: 2011-06-07 07:10
On redirecting to a url like '/login', at around line 556 of request.py it will raise an HTTPError. The sys.verrsion is

  Python 3.2 (r32:88445, Apr 15 2011, 11:20:08) 
  [GCC 4.5.2 20110127 (prerelease)] on linux2
msg137802 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-06-07 11:04
Well, the HTTP RFC does indicate that the redirection URI (in the Location header: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30) must be an absolute URI, but I also agree that using a relative URI in that context is a common use-case supported by browsers, and it would be good to support it in the stdlib too.
msg240464 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-04-11 06:35
Already fixed in 3.2 it seems
History
Date User Action Args
2022-04-11 14:57:18adminsetgithub: 56484
2015-04-11 06:35:18martin.pantersetstatus: open -> closed

superseder: [urllib.request.HTTPRedirectHandler.http_error_302] Relative Redirect issue
versions: - Python 3.3
nosy: + martin.panter

messages: + msg240464
resolution: duplicate
stage: needs patch -> resolved
2011-06-07 11:04:54pitrousetversions: + Python 3.3
nosy: + orsenthil, pitrou

messages: + msg137802

type: behavior
stage: needs patch
2011-06-07 07:10:17lilydjwgcreate