➜

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.

作者 stutzbach
收信人 stutzbach, theller
日期 2010-05-09.06:38:31
SpamBayes Score 2.0174829e-07
Marked as misclassified 否
Message-id <1273387114.89.0.416578803449.issue8670@psf.upfronthosting.co.za>
In-reply-to
内容
Using a UCS2 Python on a platform with a 32-bit wchar_t, the following code throws an exception (but should not):

>>> ctypes.c_wchar('\u10000')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: one character unicode string expected

The trouble is in the u_set() function in Modules/_ctypes/cfield.c.  The corresponding u_get() function looks correct.

On a UCS4 Python running on a system with a 16-bit wchar_t, u_set() will corrupt the data by silently truncating the character to 16-bits.

For reference, Linux and Mac OS use a 32-bit wchar_t while Windows uses a 16-bit wchar_t.
历史
日期 用户 动作 参数
2010-05-09 06:38:35stutzbach修改recipients: + stutzbach, theller
2010-05-09 06:38:34stutzbach修改messageid: <1273387114.89.0.416578803449.issue8670@psf.upfronthosting.co.za>
2010-05-09 06:38:32stutzbach链接issue8670 messages
2010-05-09 06:38:31stutzbach创建