Message109386
I've made some other test with LANG=C on other platforms. It seems resulting in a clean error on Linux:
$ LANG=C ./here/bin/python3
Python 3.2a0 (py3k, Jul 6 2010, 12:40:29)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, os
>>> snowman = '\u2603'
>>> os.system((sys.executable + " -c 'import sys; print(sys.argv[-1].encode(\"utf8\"))' " + snowman).encode(sys.getdefaultencoding()))
Traceback (most recent call last):
File "<string>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode character '\udce2' in position 0: surrogates not allowed
256
Notice that I had to use an explicit encoding or os.system would have tried to encode using ascii and barf, probably because of bug #8775.
I've also been reported about issue #4388: I've checked and test_run_code() fails as described. So I think this bug can be considered a #4388 duplicate. |
|
Date |
User |
Action |
Args |
2010-07-06 12:16:53 | piro | set | recipients:
+ piro, ronaldoussoren, vstinner, ezio.melotti |
2010-07-06 12:16:53 | piro | set | messageid: <1278418613.43.0.267624770475.issue9167@psf.upfronthosting.co.za> |
2010-07-06 12:16:51 | piro | link | issue9167 messages |
2010-07-06 12:16:50 | piro | create | |
|