summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-07-28 16:30:46 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-07-28 16:30:46 (GMT)
commit42b0c2f74068d74694187d229f65fcce0ae19643 (patch)
treec2a02aa73ab05d8516352e5e8f4c81810fd2d28b /Lib/urllib
parentb8f96c16036f34d8e913cca95c5ad07a592b161d (diff)
downloadcpython-42b0c2f74068d74694187d229f65fcce0ae19643.zip
cpython-42b0c2f74068d74694187d229f65fcce0ae19643.tar.gz
cpython-42b0c2f74068d74694187d229f65fcce0ae19643.tar.bz2
Merged revisions 83209 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83209 | senthil.kumaran | 2010-07-28 21:57:56 +0530 (Wed, 28 Jul 2010) | 3 lines Fix Issue6325 - robotparse to honor urls with query strings. ........
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/robotparser.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py
index bafb611..30baa05 100644
--- a/Lib/urllib/robotparser.py
+++ b/Lib/urllib/robotparser.py
@@ -129,8 +129,10 @@ class RobotFileParser:
return True
# search for given user agent matches
# the first match counts
- url = urllib.parse.quote(
- urllib.parse.urlparse(urllib.parse.unquote(url))[2])
+ parsed_url = urllib.parse.urlparse(urllib.parse.unquote(url))
+ url = urllib.parse.urlunparse(('','',parsed_url.path,
+ parsed_url.params,parsed_url.query, parsed_url.fragment))
+ url = urllib.parse.quote(url)
if not url:
url = "/"
for entry in self.entries: