diff options
author | Michael W. Hudson <mwh@python.net> | 2002-03-18 12:54:51 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-03-18 12:54:51 (GMT) |
commit | 724374d1626ba1ffa300f244ccbdf0052ffd5701 (patch) | |
tree | 3065135850c582f57584d5d0a24794d6460abc27 | |
parent | c2a5e3c0f912fa282cfa80935ec53e5f0c23e849 (diff) | |
download | cpython-724374d1626ba1ffa300f244ccbdf0052ffd5701.zip cpython-724374d1626ba1ffa300f244ccbdf0052ffd5701.tar.gz cpython-724374d1626ba1ffa300f244ccbdf0052ffd5701.tar.bz2 |
doerwalter's failing examples from
[ 529104 ] broken error handling in unicode-escape
-rw-r--r-- | Lib/test/test_unicode.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 8d4bed5..df5d615 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -539,6 +539,14 @@ else: verify(unicode('Andr\202 x','ascii','ignore') == u"Andr x") 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') verify(u'hello'.encode('utf-8') == 'hello') |