Kaydet (Commit) e49a95fe authored tarafından Victor Stinner's avatar Victor Stinner

Issue #21118: str.translate() now raises a ValueError, not a TypeError, if the

replacement character is bigger than U+10ffff code point.
üst 872b291b
......@@ -819,7 +819,7 @@ class CodecCallbackTest(unittest.TestCase):
def __getitem__(self, key):
raise ValueError
#self.assertRaises(ValueError, "\xff".translate, D())
self.assertRaises(TypeError, "\xff".translate, {0xff: sys.maxunicode+1})
self.assertRaises(ValueError, "\xff".translate, {0xff: sys.maxunicode+1})
self.assertRaises(TypeError, "\xff".translate, {0xff: ()})
def test_bug828737(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment