[Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.49,1.50
Martin v. L?wis
loewis@users.sourceforge.net
Thu, 21 Mar 2002 00:55:30 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv3002/Lib/test
Modified Files:
test_unicode.py
Log Message:
Do not insert characters for unicode-escape decoders if the error mode
is "ignore". Fixes #529104.
Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** test_unicode.py 7 Feb 2002 11:33:49 -0000 1.49
--- test_unicode.py 21 Mar 2002 08:55:27 -0000 1.50
***************
*** 542,545 ****
--- 542,553 ----
verify(unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x')
+ verify("\\N{foo}xx".decode("unicode-escape", "ignore") == u"xx")
+ try:
+ "\\".decode("unicode-escape")
+ except ValueError:
+ pass
+ else:
+ raise TestFailed, '"\\".decode("unicode-escape") should fail'
+
verify(u'hello'.encode('ascii') == 'hello')
verify(u'hello'.encode('utf-7') == 'hello')