Daniele Varrazzo <p...@develer.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9167>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to