[C++-sig] boost::python::import crashes when called from a dll

Sahasranaman MS sahasr at naman.ms
Fri Jul 31 10:52:53 CEST 2009


I am having a problem. I am running Windows XP, Python 2.5.4.

I have a custom library which uses python's urllib2 to download data. The
import statement inside the call looks like this:

    boost::python::object urllib = boost::python::import("urllib2");

This works fine when I use my custom library in an executable application.
When I use the library in a dll, while executing, it raises this exception:

    WindowsError: exception: access violation reading 0x00000008

It is happening exactly at this import statement. I tried importing the
'sys' module first, setting library search path and then run, but its
failing to import even the sys module, and fails with the same error. Any
advice on how I could fix this?


--
Sahasranaman MS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20090731/0b9d6b12/attachment.htm>


More information about the Cplusplus-sig mailing list