Commits

Florent Xicluna committed e17b160

Fix an oversight in r83294. unquote() should reject bytes. Issue #9301.

Comments (0)

Files changed (2)

Lib/test/test_urllib.py

                          "%s" % result)
         self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, None)
         self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, ())
+        self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, b'')
 
     def test_unquoting_badpercent(self):
         # Test unquoting on bad percent-escapes

Lib/urllib/parse.py

 
     unquote('abc%20def') -> 'abc def'.
     """
-    if string in (b'', ''):
+    if string == '':
         return string
     res = string.split('%')
     if len(res) == 1: