Author Alex Wang
Recipients Alex Wang, docs@python, eryksun
Date 2016-11-15.19:24:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
Hi Eryk,

Thanks a lot for quick reply~

This is about the bug I filed:

I may still need your help to have a look the original case when I caught
this issue:

​I am writing some test automation which call C DLL from Python, the C
function is something like:

MEASURE_API int InitTester(char *ipAddress)

​So I need to pass an IP address string (for example, from
Python in ctypes to this function. For non-const char in C, I used

c_ipAddress = create_string_buffer(b'')

​But error code returned indicate that the parameter passing is incorrect,
then I traced back and found then reported the c_char_p/c_wchar_p issue.​

Also tried
​c_ipAddress = create_unicode_buffer('')
c_ipAddress = c_char_p(b'')
c_ipAddress = c_wchar_p('')​

​But none of them working... I had called other function to this C DLL
passing c_int(). c_bool(), c_void_p() and etc. they are all working as
expected, only string related have this issue.

Therefore, any idea how write the correct assignment and pass it to ​C DLL
for this case in Python 3.5? Any hint would be great helpful.

Thank you in advance~


On Tue, Nov 15, 2016 at 10:57 AM, Eryk Sun <> wrote:

> Changes by Eryk Sun <>:
> ----------
> keywords: +easy
> stage:  -> needs patch
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
Date User Action Args
2016-11-15 19:24:19Alex Wangsetrecipients: + Alex Wang, docs@python
2016-11-15 19:24:19Alex Wanglinkissue28698 messages
2016-11-15 19:24:18Alex Wangcreate