This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 mark.dickinson
收信人 MrJean1, mark.dickinson
日期 2008-11-22.12:37:16
SpamBayes Score 9.6999075e-12
Marked as misclassified
Message-id <1227357438.29.0.284317754629.issue4388@psf.upfronthosting.co.za>
In-reply-to
内容
Here's a minimal failing example, which I believe captures the cause of 
the test_cmd_line failure.  After "export LANG=C", on OS X 10.5, I get:

Python 3.0rc3+ (py3k:67335, Nov 22 2008, 09:11:58) 
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, posix
>>> sys.getfilesystemencoding()
'utf-8'
>>> posix.execv(sys.executable, [sys.executable, '-c', "ord('\xe9')"])
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: ord() expected a character, but string of length 2 found

Clearly the single '\xe9' character is being encoded in utf8 as
b'\xc3\xa9', and the python interpreter invoked by the execv ends up 
receiving two characters here instead of one.

The encoding happens at around line 2988 of posixmodule.c, in posix_execv.
历史
日期 用户 动作 参数
2008-11-22 12:37:18mark.dickinson修改recipients: + mark.dickinson, MrJean1
2008-11-22 12:37:18mark.dickinson修改messageid: <1227357438.29.0.284317754629.issue4388@psf.upfronthosting.co.za>
2008-11-22 12:37:17mark.dickinson链接issue4388 messages
2008-11-22 12:37:16mark.dickinson创建