Index: Lib/urllib/robotparser.py =================================================================== --- Lib/urllib/robotparser.py (revision 83172) +++ Lib/urllib/robotparser.py (working copy) @@ -129,8 +129,11 @@ 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 = parsed_url[2] + if parsed_url[4]: + url += "?" + parsed_url[4] + url = urllib.parse.quote(url) if not url: url = "/" for entry in self.entries: Index: Lib/test/test_robotparser.py =================================================================== --- Lib/test/test_robotparser.py (revision 83172) +++ Lib/test/test_robotparser.py (working copy) @@ -205,7 +205,18 @@ RobotTest(13, doc, good, bad, agent="googlebot") +# 14. For issue #6325 (query string support) +doc = """ +User-agent: * +Disallow: /some/path?name=value +""" +good = ['/some/path'] +bad = ['/some/path?name=value'] + +RobotTest(14, doc, good, bad) + + class NetworkTestCase(unittest.TestCase): def testPasswordProtectedSite(self):