Skip to content

Commit

Permalink
Fix an oversight in r83294. unquote() should reject bytes. Issue pyth…
Browse files Browse the repository at this point in the history
  • Loading branch information
florentx committed Jul 31, 2010
1 parent 62069d3 commit c049fca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Lib/test/test_urllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ def test_unquoting(self):
"%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
Expand Down
2 changes: 1 addition & 1 deletion Lib/urllib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def unquote(string, encoding='utf-8', errors='replace'):
unquote('abc%20def') -> 'abc def'.
"""
if string in (b'', ''):
if string == '':
return string
res = string.split('%')
if len(res) == 1:
Expand Down

0 comments on commit c049fca

Please sign in to comment.