[issue9167] argv double encoding on OSX

R. David Murray report at bugs.python.org
Fri Oct 22 03:03:10 CEST 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

rdmurray at buddy:~/python/py3k>uname -a
Darwin buddy.home.bitdance.com 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386


rdmurray at buddy:~/python/release31-maint>LC_ALL="C" ./python.exe
Python 3.1.2 (release31-maint:85783, Oct 21 2010, 20:31:06)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> snowman = '\u2603'
>>> os.system(sys.executable + " -c 'import sys; [print(a.encode(\"utf8\")) for a in sys.argv]' foo bar " + snowman)
b'-c'
b'foo'
b'bar'
b'\xc3\xa2\xc2\x98\xc2\x83'
0


rdmurray at buddy:~/python/py3k>LC_ALL="C" ./python.exe 
Python 3.2a3+ (py3k:85768, Oct 21 2010, 12:31:12) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> snowman = '\u2603'
>>> os.system(sys.executable + " -c 'import sys; [print(a.encode(\"utf8\")) for a in sys.argv]' foo bar " + snowman)
b'-c'
b'foo'
b'bar'
b'\xe2\x98\x83'
0

----------
nosy: +r.david.murray
resolution:  -> fixed
stage: unit test needed -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9167>
_______________________________________


More information about the Python-bugs-list mailing list