mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Fix Issue9301 - urllib.parse.unquote and unquote_to_byte to raise TypeError for None.
This commit is contained in:
parent
99212f61db
commit
79e17f6f66
2 changed files with 7 additions and 0 deletions
|
@ -554,6 +554,7 @@ class UnquotingTests(unittest.TestCase):
|
|||
self.assertEqual(result.count('%'), 1,
|
||||
"using unquote(): not all characters escaped: "
|
||||
"%s" % result)
|
||||
self.assertRaises(TypeError, urllib.parse.unquote, None)
|
||||
|
||||
def test_unquoting_badpercent(self):
|
||||
# Test unquoting on bad percent-escapes
|
||||
|
@ -589,6 +590,8 @@ class UnquotingTests(unittest.TestCase):
|
|||
self.assertEqual(expect, result, "using unquote_to_bytes(): %r != %r"
|
||||
% (expect, result))
|
||||
|
||||
self.assertRaises(TypeError, urllib.parse.unquote_to_bytes, None)
|
||||
|
||||
def test_unquoting_mixed_case(self):
|
||||
# Test unquoting on mixed-case hex digits in the percent-escapes
|
||||
given = '%Ab%eA'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue