summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-08-08 11:27:53 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-08-08 11:27:53 (GMT)
commitd95cc754836762be6571aa44bcad1a01cf6def1d (patch)
treeb93a7d02f984ab5820ed90705395ac4d1a2e9fc4 /Lib/urllib
parentad537f23e2e60b92c67fe01855ec1a0a7479df46 (diff)
downloadcpython-d95cc754836762be6571aa44bcad1a01cf6def1d.zip
cpython-d95cc754836762be6571aa44bcad1a01cf6def1d.tar.gz
cpython-d95cc754836762be6571aa44bcad1a01cf6def1d.tar.bz2
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.
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 012814c..0a083b8 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('<URL:type://host/path>') --> '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