diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-04-12 23:34:06 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-04-12 23:34:06 (GMT) |
commit | abdeeff3d1fa505fa1d49970cb7a70446f3e2b75 (patch) | |
tree | 23131ed5d3928e8056f1cc28c6818b3ac43dd73a /Lib/urllib/request.py | |
parent | bd3e362089c9fab1028a1bf58b4e762851a32244 (diff) | |
parent | 26430419703f925a9b6206ec96780ae899b6dd06 (diff) | |
download | cpython-abdeeff3d1fa505fa1d49970cb7a70446f3e2b75.zip cpython-abdeeff3d1fa505fa1d49970cb7a70446f3e2b75.tar.gz cpython-abdeeff3d1fa505fa1d49970cb7a70446f3e2b75.tar.bz2 |
merge heads
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 220dfe4..6b29901 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -163,7 +163,7 @@ class Request: origin_req_host=None, unverifiable=False): # unwrap('<URL:type://host/path>') --> 'type://host/path' self.full_url = unwrap(url) - self.full_url, fragment = splittag(self.full_url) + self.full_url, self.fragment = splittag(self.full_url) self.data = data self.headers = {} self._tunnel_host = None @@ -202,7 +202,10 @@ class Request: return self.data def get_full_url(self): - return self.full_url + if self.fragment: + return '%s#%s' % (self.full_url, self.fragment) + else: + return self.full_url def get_type(self): return self.type @@ -1106,7 +1109,7 @@ class AbstractHTTPHandler(BaseHandler): except socket.error as err: raise URLError(err) - r.url = req.full_url + r.url = req.get_full_url() # This line replaces the .msg attribute of the HTTPResponse # with .headers, because urllib clients expect the response to # have the reason in .msg. It would be good to mark this |