diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-04-12 23:22:29 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-04-12 23:22:29 (GMT) |
commit | b17abb1af9e36c728e4fc9e27a9fd9441d3f77a2 (patch) | |
tree | 7e424e947cbf556f5b39cc97dc2d22d66333155f /Lib/urllib/request.py | |
parent | a3e449da3757a87945d62d104cb53ff8a8646257 (diff) | |
parent | 26430419703f925a9b6206ec96780ae899b6dd06 (diff) | |
download | cpython-b17abb1af9e36c728e4fc9e27a9fd9441d3f77a2.zip cpython-b17abb1af9e36c728e4fc9e27a9fd9441d3f77a2.tar.gz cpython-b17abb1af9e36c728e4fc9e27a9fd9441d3f77a2.tar.bz2 |
merge from 3.1
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 ebbebe9..5325d62 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -180,7 +180,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 @@ -219,7 +219,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 @@ -1135,7 +1138,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 |