Message247998
doc string suggests str is a valid init argument. The code strongly discourages this.
ctypes.create_string_buffer
def create_string_buffer(init, size=None):
"""create_string_buffer(aBytes) -> character array
create_string_buffer(anInteger) -> character array
create_string_buffer(aString, anInteger) -> character array
"""
if isinstance(init, bytes):
if size is None:
size = len(init)+1
buftype = c_char * size
buf = buftype()
buf.value = init
return buf
elif isinstance(init, int):
buftype = c_char * init
buf = buftype()
return buf
raise TypeError(init) |
|
Date |
User |
Action |
Args |
2015-08-04 20:22:18 | LambertDW | set | recipients:
+ LambertDW |
2015-08-04 20:22:18 | LambertDW | set | messageid: <1438719738.53.0.780685651956.issue24789@psf.upfronthosting.co.za> |
2015-08-04 20:22:18 | LambertDW | link | issue24789 messages |
2015-08-04 20:22:18 | LambertDW | create | |
|