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.

classification
Title: ctypes.create_string_buffer should only accept bytes
Type: Stage:
Components: ctypes Versions: Python 3.1, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: theller Nosy List: benjamin.peterson, terry.reedy, theller, ysj.ray
Priority: normal Keywords:

Created on 2010-04-03 16:57 by benjamin.peterson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg102282 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-04-03 16:57
These coercions shouldn't be allowed:

import ctypes
>>> buf = ctypes.create_string_buffer("hi")
>>> buf.value
b'hi'
>>> buf.value = "23"
>>> buf.value
b'23'
msg113021 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-05 19:13
I am just responding so this will not show up on the 'unanswered issues' list.
msg113092 - (view) Author: ysj.ray (ysj.ray) Date: 2010-08-06 10:10
Why not close this issue? It seems that this has been fixed in current py3k branch.
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52553
2010-08-07 01:56:59benjamin.petersonsetstatus: open -> closed
resolution: fixed
2010-08-06 10:10:02ysj.raysetnosy: + ysj.ray
messages: + msg113092
2010-08-05 19:13:34terry.reedysetnosy: + terry.reedy
messages: + msg113021
2010-04-03 16:57:47benjamin.petersoncreate