logo       

Re: Error on linux: msg#00002

python.ctypes

Subject: Re: Error on linux

Michele Petrazzo <michele.petrazzo@xxxxxxxxx> writes:

> I'm using ctypes v 0.9.1 on linux for the first time.
>
> Then I try to use create_unicode_buffer(), I receive this error:
>
> File "/usr/lib/python2.3/site-packages/ctypes/__init__.py", line 74,
> in create_unicode_buffer
> buftype = c_wchar * init
> NameError: global name 'c_wchar' is not defined
>
> What can I do?
>
> Thanks,
> Michele Petrazzo

Ok, it seems I missed to put the create_unicode_buffer inside an if:

if os.name == "nt":

The deeper issue is that the unicode stuff in ctypes is only compiled in
when the Python header files define the HAVE_USABLE_WCHAR_T symbol. Of
the systems I build and test on, only Windows defines this.

I'm not really sure that this is really the right thing to do,
maybe this should be sufficient:

#if Py_UNICODE_SIZE == 2

Thomas



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise