[issue5119] wide character parameter handling in ctypes

Jason R. Coombs report at bugs.python.org
Mon Feb 2 21:35:59 CET 2009


Jason R. Coombs <jaraco at jaraco.com> added the comment:

I see this in the documentation, which basically answers the question:

"windll does not try to select [wide or narrow functions] by magic, you
must access the version you need by specifying GetModuleHandleA or
GetModuleHandleW explicitely, and then call it with normal strings or
unicode strings respectively."

This behavior is inconsistent with how structures are handled, where
members are up-converted to unicode.  For example.

>>> class simple(Structure):
>>>   _fields_ = [('value', c_wchar_p)]
>>>
>>> simple('foo').value
u'foo'

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5119>
_______________________________________


More information about the Python-bugs-list mailing list