r83319 - in python/branches/py3k/Lib: test/test_urllib.py urllib/parse.py
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
Author: florent.xicluna Date: Sat Jul 31 10:56:55 2010 New Revision: 83319 Log: Fix an oversight in r83294. unquote() should reject bytes. Issue #9301. Modified: python/branches/py3k/Lib/test/test_urllib.py python/branches/py3k/Lib/urllib/parse.py Modified: python/branches/py3k/Lib/test/test_urllib.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib.py (original) +++ python/branches/py3k/Lib/test/test_urllib.py Sat Jul 31 10:56:55 2010 @@ -557,6 +557,7 @@ "%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 Modified: python/branches/py3k/Lib/urllib/parse.py ============================================================================== --- python/branches/py3k/Lib/urllib/parse.py (original) +++ python/branches/py3k/Lib/urllib/parse.py Sat Jul 31 10:56:55 2010 @@ -338,7 +338,7 @@ unquote('abc%20def') -> 'abc def'. """ - if string in (b'', ''): + if string == '': return string res = string.split('%') if len(res) == 1:
participants (1)
-
florent.xicluna