Message280876
Hi Eryk,
Thanks a lot for quick reply~
This is about the bug I filed: http://bugs.python.org/issue28698#
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, 192.168.100.100) from
Python in ctypes to this function. For non-const char in C, I used
c_ipAddress = create_string_buffer(b'192.168.100.100')
lib.InitTester(c_ipAddress)
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('192.168.100.100')
c_ipAddress = c_char_p(b'192.168.100.100')
c_ipAddress = c_wchar_p('192.168.100.100')
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~
BR,
Alex
On Tue, Nov 15, 2016 at 10:57 AM, Eryk Sun <report@bugs.python.org> wrote:
>
> Changes by Eryk Sun <eryksun+pybugs@gmail.com>:
>
>
> ----------
> keywords: +easy
> stage: -> needs patch
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue28698>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2016-11-15 19:24:19 | Alex Wang | set | recipients:
+ Alex Wang, docs@python |
2016-11-15 19:24:19 | Alex Wang | link | issue28698 messages |
2016-11-15 19:24:18 | Alex Wang | create | |
|