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.

Author ronaldoussoren
Recipients loewis, ncoghlan, ronaldoussoren, skrah
Date 2012-08-16.12:09:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345118941.58.0.634028657272.issue15035@psf.upfronthosting.co.za>
In-reply-to
Content
Py_UNICODE is an typedef for wchar_t and that type is 4 bytes long:

>>> a.tobytes()
b'h\x00\x00\x00e\x00\x00\x00l\x00\x00\x00l\x00\x00\x00o\x00\x00\x00 \x00\x00\x00w\x00\x00\x00o\x00\x00\x00r\x00\x00\x00l\x00\x00\x00d\x00\x00\x00'
>>> a = array.array('u', 'bar')
>>> a.tobytes()
b'b\x00\x00\x00a\x00\x00\x00r\x00\x00\x00'
>>> len(a.tobytes())
12
>>> 

This is with a checkout that was created yesterday.

The issue is not resolved, there now is no way to easily create a UCS2 buffer; while there was in earlier releases of Python (with the default narrow build)
History
Date User Action Args
2012-08-16 12:09:01ronaldoussorensetrecipients: + ronaldoussoren, loewis, ncoghlan, skrah
2012-08-16 12:09:01ronaldoussorensetmessageid: <1345118941.58.0.634028657272.issue15035@psf.upfronthosting.co.za>
2012-08-16 12:09:00ronaldoussorenlinkissue15035 messages
2012-08-16 12:09:00ronaldoussorencreate