1. Armin Rigo
  2. cpython-withatomic

Commits

Florent Xicluna  committed e17b160

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

  • Participants
  • Parent commits 6b23aa3
  • Branches default

Comments (0)

Files changed (2)

File Lib/test/test_urllib.py

View file
  • Ignore whitespace
                          "%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

File Lib/urllib/parse.py

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