From d95cc754836762be6571aa44bcad1a01cf6def1d Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Sun, 8 Aug 2010 11:27:53 +0000 Subject: Fix Issue8280 - urllib2's Request method will remove fragements in the url. This is how it should work,wget and curl work like this way too. Old behavior was wrong. --- Lib/urllib/request.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/urllib/request.py') diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 012814c948..0a083b859d 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -99,7 +99,7 @@ from urllib.error import URLError, HTTPError, ContentTooShortError from urllib.parse import ( urlparse, urlsplit, urljoin, unwrap, quote, unquote, splittype, splithost, splitport, splituser, splitpasswd, - splitattr, splitquery, splitvalue, to_bytes, urlunparse) + splitattr, splitquery, splitvalue, splittag, to_bytes, urlunparse) from urllib.response import addinfourl, addclosehook # check for SSL @@ -163,6 +163,7 @@ class Request: origin_req_host=None, unverifiable=False): # unwrap('') --> 'type://host/path' self.full_url = unwrap(url) + self.full_url, fragment = splittag(self.full_url) self.data = data self.headers = {} self._tunnel_host = None -- cgit v1.2.1