[Python-checkins] r73106 - in python/branches/py3k: Lib/test/test_unicode.py Misc/NEWS

martin.v.loewis python-checkins at python.org
Mon Jun 1 06:23:08 CEST 2009


Author: martin.v.loewis
Date: Mon Jun 1 06:23:07 2009
New Revision: 73106
Log:
Issue #6150: Fix test_unicode on wide-unicode builds.
Modified:
 python/branches/py3k/Lib/test/test_unicode.py
 python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Lib/test/test_unicode.py
==============================================================================
--- python/branches/py3k/Lib/test/test_unicode.py	(original)
+++ python/branches/py3k/Lib/test/test_unicode.py	Mon Jun 1 06:23:07 2009
@@ -908,14 +908,15 @@
 def test_codecs_utf8(self):
 self.assertEqual(''.encode('utf-8'), b'')
 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')
+ if sys.maxunicode == 65535:
+ 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', 'surrogatepass'), b'\xed\xa0\x80')
 self.assertEqual('\udc00'.encode('utf-8', 'surrogatepass'), b'\xed\xb0\x80')
- self.assertEqual(
- ('\ud800\udc02'*1000).encode('utf-8', 'surrogatepass'),
- b'\xf0\x90\x80\x82'*1000
- )
+ if sys.maxunicode == 65535:
+ self.assertEqual(
+ ('\ud800\udc02'*1000).encode('utf-8'),
+ b'\xf0\x90\x80\x82'*1000)
 self.assertEqual(
 '\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f'
 '\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u4e00'
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Mon Jun 1 06:23:07 2009
@@ -18,6 +18,8 @@
 Library
 -------
 
+- Issue #6150: Fix test_unicode on wide-unicode builds.
+
 - Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
 parameters.
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /