Debuggin a ptyhon extension

Steve Menard devilwolf22 at hotmail.com
Fri May 7 13:45:45 EDT 2004


Thomas Heller wrote:
>>"Steve Menard" <devilwolf22 at hotmail.com> wrote in message
>>news:rzxmc.26524$j11.254148 at weber.videotron.net...
> 
> 
>>>I am writing a python extension module in VC++ on windows. At some
>>>point, my extension crashes.
>>>
>>>Now I want to debug exactly why. I built the python projects in VC++,
>>>and put the resulting python_d.exe in my ptyon home directory, and
>>>the python23_d.dll in the windows/system32 directory. I also tried to
>>>put the python23_d.dll in python's home directory, to the same
>>>result.
>>>
>>>Problem is, running my scripts/extension with python_d.exe, it always
>>>complains it can't find win32api. Yes, I am using win32API to preload
>>>a dll, and can't really get rid of it.
>>>
> 
> 
> "Roger Upole" <rupole at hotmail.com> writes:
> 
> 
>>It's probably looking for the debug version of win32api
>>(win32api_d.pyd, which will also require a debug build of Pywintypes).
>>You can grab the pywin32 source and roll your own debug binaries, or
>>alternately you might be able to get away with creating a release
>>build of Python that contains debug info.
> 
> 
> If Steve only uses win32api to call LoadLibrary it is probably easier to
> use ctypes for that.  Of course he needs a debug version of ctypes, but
> that should build out of the box from the sources, if he has VC.
> 
> 
>>>Are my problems caused because python 2.3.3 (and possible win32all) were
>>>build using VC.net?
> 
> 
> No, python 2.3 and pywin32 (formerly called win32all) are built using
> MSVC 6.
> 
> Thomas
> 
> 

thanks for your help guys. While I didnt manage to get pywin32 working 
with python_d, I wrote my own little library to do the loadLibrary, and 
that works.

Thanks for the ctype hint though, I didnt know about it. Is it portable 
across platforms?

Steve Menard




More information about the Python-list mailing list