Message105374
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. |
|
Date |
User |
Action |
Args |
2010-05-09 06:38:35 | stutzbach | set | recipients:
+ stutzbach, theller |
2010-05-09 06:38:34 | stutzbach | set | messageid: <1273387114.89.0.416578803449.issue8670@psf.upfronthosting.co.za> |
2010-05-09 06:38:32 | stutzbach | link | issue8670 messages |
2010-05-09 06:38:31 | stutzbach | create | |
|