summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2009-05-10 08:08:56 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2009-05-10 08:08:56 (GMT)
commite0a2b72e61a474dceb948be57cb2983f70ab07fb (patch)
treec3b566e210699b00932039c734bfeb74e24f06f9 /Lib
parentcf7925dfc61d770c58153fd96170192e11cf8f39 (diff)
downloadcpython-e0a2b72e61a474dceb948be57cb2983f70ab07fb.zip
cpython-e0a2b72e61a474dceb948be57cb2983f70ab07fb.tar.gz
cpython-e0a2b72e61a474dceb948be57cb2983f70ab07fb.tar.bz2
Rename the surrogates error handler to surrogatepass.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_codecs.py12
-rw-r--r--Lib/test/test_unicode.py6
2 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 79b1fab..9ca7699 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -545,12 +545,12 @@ class UTF8Test(ReadTest):
self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8")
self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8")
- def test_surrogates_handler(self):
- self.assertEquals("abc\ud800def".encode("utf-8", "surrogates"),
+ def test_surrogatepass_handler(self):
+ self.assertEquals("abc\ud800def".encode("utf-8", "surrogatepass"),
b"abc\xed\xa0\x80def")
- self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogates"),
+ self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogatepass"),
"abc\ud800def")
- self.assertTrue(codecs.lookup_error("surrogates"))
+ self.assertTrue(codecs.lookup_error("surrogatepass"))
class UTF7Test(ReadTest):
encoding = "utf-7"
@@ -1040,12 +1040,12 @@ class NameprepTest(unittest.TestCase):
# Skipped
continue
# The Unicode strings are given in UTF-8
- orig = str(orig, "utf-8", "surrogates")
+ orig = str(orig, "utf-8", "surrogatepass")
if prepped is None:
# Input contains prohibited characters
self.assertRaises(UnicodeError, nameprep, orig)
else:
- prepped = str(prepped, "utf-8", "surrogates")
+ prepped = str(prepped, "utf-8", "surrogatepass")
try:
self.assertEquals(nameprep(orig), prepped)
except Exception as e:
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 3ede057..5aea367 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -906,10 +906,10 @@ class UnicodeTest(
self.assertEqual('\u20ac'.encode('utf-8'), b'\xe2\x82\xac')
self.assertEqual('\ud800\udc02'.encode('utf-8'), b'\xf0\x90\x80\x82')
self.assertEqual('\ud84d\udc56'.encode('utf-8'), b'\xf0\xa3\x91\x96')
- self.assertEqual('\ud800'.encode('utf-8', 'surrogates'), b'\xed\xa0\x80')
- self.assertEqual('\udc00'.encode('utf-8', 'surrogates'), b'\xed\xb0\x80')
+ self.assertEqual('\ud800'.encode('utf-8', 'surrogatepass'), b'\xed\xa0\x80')
+ self.assertEqual('\udc00'.encode('utf-8', 'surrogatepass'), b'\xed\xb0\x80')
self.assertEqual(
- ('\ud800\udc02'*1000).encode('utf-8', 'surrogates'),
+ ('\ud800\udc02'*1000).encode('utf-8', 'surrogatepass'),
b'\xf0\x90\x80\x82'*1000
)
self.assertEqual(