mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #10557: Fixed error messages from float() and other numeric
types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
This commit is contained in:
parent
36526bf3d9
commit
942af5a9a4
11 changed files with 169 additions and 52 deletions
|
@ -1168,8 +1168,13 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
# Error handling (wrong arguments)
|
||||
self.assertRaises(TypeError, "hello".encode, 42, 42, 42)
|
||||
|
||||
# Error handling (PyUnicode_EncodeDecimal())
|
||||
self.assertRaises(UnicodeError, int, "\u0200")
|
||||
# Error handling (lone surrogate in PyUnicode_TransformDecimalToASCII())
|
||||
self.assertRaises(UnicodeError, int, "\ud800")
|
||||
self.assertRaises(UnicodeError, int, "\udf00")
|
||||
self.assertRaises(UnicodeError, float, "\ud800")
|
||||
self.assertRaises(UnicodeError, float, "\udf00")
|
||||
self.assertRaises(UnicodeError, complex, "\ud800")
|
||||
self.assertRaises(UnicodeError, complex, "\udf00")
|
||||
|
||||
def test_codecs(self):
|
||||
# Encoding
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue