ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
[ctypes-users] Re: Recent (CVS?) compiled version for win32, anyone?
by Thomas Heller other posts by this author
Feb 2 2006 10:19AM messages near this date
[ctypes-users] docs | [ctypes-users] Recent (CVS?) compiled version for win32, anyone?
Gregor Hoffleit <gregor@[...].de>  writes:

>  I'm running into a problem with ctypes 0.9.6 which appearently has been
>  fixed in CVS (I get crashes with ctypes 0.9.6 and earlier on Linux and
>  win32 (for Python 2.3 as well as 2.4). With the recent Debian package
>  (which is a CVS snapshot as of 2005-10-31), the problem is gone).
> 
>  I'm pretty comfortable on Linux platforms, but I failed to compile
>  ctypes from CVS for win32.
> 
>  Could anybody provide me with a compiled ctypes package > 0.9.6 for
>  win32?

If you cannot get it to work with any of the tips below, mail me again
and I'll send you a compiled win32 snapshot.

OTOH, I think I'm not to far away from the next release.

>  Alternatively, could somebody tell me how to compile ctypes on win32?
>  I have MSVC6, which ought to work for the official Python2.3.5.exe from
>  python.org. Still, "python setup.py build" tells me that I lack the
>  necessary compiler.

A common problem with MSVC6 which could lead to the error message you
get is that you have to start the GUI at least one time so that MSVC
makes the registry entries that disutils excpects.

>  Or, even better, perhaps this problem in 0.9.6 could be fixed by
>  patching some .py files?
> 
>  For what it's worth, this is how the crash looks like with 0.9.6:
> 
>  clapton:46> python2.3 xxx.py
>  Traceback (most recent call last):
>    File "xxx.py", line 11, in ?
>      s=le.session(p,myCallback)
>    File "libfoe.py", line 27, in session
>      session=FoeSession(self.instance,foe_init_params,session_callback)
>    File "libfoe.py", line 40, in __init__
>      ret=_FoeSessionStart(self.instance,pointer(self.session),self.foe_params,self.callback
)
>  ctypes.ArgumentError: argument 3: exceptions.TypeError: expected LP_FOE_INIT_PARAMS instan
ce instead of FOE_INIT_PARAMS
>  Speicherzugriffsfehler

The error means that you have to pass a pointer to a FOE_INIT_PARAMS
instance as third parameter.  This should work in this case:

     session=FoeSession(self.instance,byref(foe_init_params),session_callback)

Later ctypes versions automatcially call byref(argument) if a pointer is
expected.

Thomas



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved