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 meador.inge
Recipients docs@python, georg.brandl, meador.inge, vpelletier
Date 2012-01-25.03:14:24
SpamBayes Score 6.1062266e-16
Marked as misclassified No
Message-id <1327461266.32.0.943331805695.issue13840@psf.upfronthosting.co.za>
In-reply-to
Content
The 'create_unicode_buffer' docs are currently wrong too:

"""
If the first parameter is a bytes object, it is converted into an 
unicode string according to ctypes conversion rules.
"""

>>> ctypes.create_unicode_buffer(b'foo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/meadori/src/python/cpython/Lib/ctypes/__init__.py", line 294, in create_unicode_buffer
    buf.value = init
TypeError: unicode string expected instead of bytes instance

The attached patch fixes the documentation and exception messages.

Although, it might be more friendly to implement things according to
the current docs (i.e. do the conversions).
History
Date User Action Args
2012-01-25 03:14:26meador.ingesetrecipients: + meador.inge, georg.brandl, docs@python, vpelletier
2012-01-25 03:14:26meador.ingesetmessageid: <1327461266.32.0.943331805695.issue13840@psf.upfronthosting.co.za>
2012-01-25 03:14:25meador.ingelinkissue13840 messages
2012-01-25 03:14:25meador.ingecreate