[issue30634] ctypes.cast(obj, ctypes.c_void_p) invalid return in linux_x64

2017-06-12 Thread Eryk Sun
Eryk Sun added the comment: It's undocumented that cast() should work to directly convert Python strings to pointers. Even when it seems to work, it's a risky thing to depend on because there's no source ctypes data object to reference. Thus there's neither _b_base_ nor anything in _objects

[issue30634] ctypes.cast(obj, ctypes.c_void_p) invalid return in linux_x64

2017-06-12 Thread fooofei
New submission from fooofei: module:ctypes pyversion: 2.7.13 python platform : win32, linux_x86_x64 I use ctypes.cast(v,ctypes.c_void_p).value to get address of 'helloworld' and u'helloworld' internal buffer address. the result is both right in win32,but not in linux. 'helloworld' is right,