diff -r 0842c5411ed6 Lib/test/test_robotparser.py --- a/Lib/test/test_robotparser.py Mon Mar 18 09:59:15 2013 +0100 +++ b/Lib/test/test_robotparser.py Tue Mar 19 00:07:22 2013 -0700 @@ -234,6 +234,17 @@ RobotTest(15, doc, good, bad) +# 16. +doc = """ +User-agent: * +Allow: /some/path? +Disallow: /another/path? +""" + +good = ['/some/path?'] +bad = ['/another/path?'] + +RobotTest(16, doc, good, bad) class NetworkTestCase(unittest.TestCase): diff -r 0842c5411ed6 Lib/urllib/robotparser.py --- a/Lib/urllib/robotparser.py Mon Mar 18 09:59:15 2013 +0100 +++ b/Lib/urllib/robotparser.py Tue Mar 19 00:07:22 2013 -0700 @@ -157,6 +157,7 @@ if path == '' and not allowance: # an empty value means allow all allowance = True + path = urllib.parse.urlunparse(urllib.parse.urlparse(path)) self.path = urllib.parse.quote(path) self.allowance = allowance