Message6754
I am using Jython 2.5.1 and find a strange behavior for assert and print. Pls see the following lines.
1. assert False == True, u"\u4eee\u60f3\u30a4\u30e1\u30fc\u30b8\u300c"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Error in sys.excepthook:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)
2. print u"\u4eee\u60f3\u30a4\u30e1\u30fc\u30b8\u300c"
output: 仮想イメージ「
3. assert False == True, u"\u4eee\u60f3\u30a4\u30e1\u30fc\u30b8\u300c".encode('utf8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError: 仮想イメージ「
2 and 3 can show the message correctly, but 1 cannot. Do assert and print have different mechanism to display the message?
BTW, my sys.stdout.encoding is UTF-8. |
|
Date |
User |
Action |
Args |
2012-01-06 05:45:12 | sqxu | set | recipients:
+ sqxu |
2012-01-06 05:45:12 | sqxu | set | messageid: <1325828712.56.0.437299919136.issue1830@psf.upfronthosting.co.za> |
2012-01-06 05:45:12 | sqxu | link | issue1830 messages |
2012-01-06 05:45:11 | sqxu | create | |
|