classification
Title: urllib.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.3, Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: lilydjwg, orsenthil, pitrou
Priority: normal Keywords:

Created on 2011-06-07 07:10 by lilydjwg, last changed 2011-06-07 11:04 by pitrou.

Messages (2)
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.
History
Date User Action Args
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