
Hello.
I've use Python 2.5 and want to use Python 2.6. But I have a problem with PyImport_ImportModule.
c++ code:
PyObject* pModule = PyImport_ImportModule(pBuffer);
pBuffer is for example theme.simple.index
and my script looks like:
import MyModule import sys
def StartWebInterface(cppObjectWeb, cppObjectSettings): cppObjectWeb.SetHTTPHeaderContentType(u'text/html; charset=utf-8') cppObjectWeb.SetHTTPHeaderExt(u'') page = u'' try: page = u'''<html> <head> <title>''' servername = cppObjectSettings.GetSettingsFromMethod(DeviceFriendlyName) page += servername page += u'''</title> </head> <body> <h1>''' page += servername page += u'''</h1> <a href="?f=browse">Browse Directory</a><br /> <a href="?f=settings">Settings</a> </body> </html>''' except: page = BuildErrorPage()
cppObjectWeb.SetPage(page)
def BuildErrorPage(): page = u'''<html> <head> <title>Python Error</title> </head> <body>''' page += sys.exc_info() page += u'</body></html>' return page
But the PyImport_ImportModule crashed my c++ program. The index.py was compiled because a new index.pyc was created.
Thanks for help.
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

This could be one of thousands of things. If it works with 2.5 and no
more with 2.6 some possible candidates are (1) a bug in Python, (2) a
difference in memory layout which caused buggy code to work correct in
2.5 nonetheless or (3) a timing difference, with the same effect.
Oh yes, if you're on Windows and using the prebuilt dll it could also
be caused by runtime library differences, I think 2.5 was built with
VS2003 and 2.6 with VS2005.
You'll need to provide a bit more detail if you want more help (OS and
version, how you built Python and your app, is your code in an
extension module or embedding Python, how does it crash, did you get a
stack trace, etc)
--
Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
Goldman

I'm sorry. Here are some facts:
Winodws XP SP3 with newest updates Visual Studio 2005 Microsoft Visual C++ 2005 Redistributable I downloaded Python 2.6 installer for Windows from python.org I use Python with boost 1.36 for Python (could this be a problem?)
I want to use Python 2.6 because it was (i think so) built with VS2005. So I haven't to use msvcr71.dll. On monday I can send a stack trace and a screenshot of this crash a with E-Mail.
Jack Jansen wrote:

This could be one of thousands of things. If it works with 2.5 and no
more with 2.6 some possible candidates are (1) a bug in Python, (2) a
difference in memory layout which caused buggy code to work correct in
2.5 nonetheless or (3) a timing difference, with the same effect.
Oh yes, if you're on Windows and using the prebuilt dll it could also
be caused by runtime library differences, I think 2.5 was built with
VS2003 and 2.6 with VS2005.
You'll need to provide a bit more detail if you want more help (OS and
version, how you built Python and your app, is your code in an
extension module or embedding Python, how does it crash, did you get a
stack trace, etc)
--
Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
Goldman

I'm sorry. Here are some facts:
Winodws XP SP3 with newest updates Visual Studio 2005 Microsoft Visual C++ 2005 Redistributable I downloaded Python 2.6 installer for Windows from python.org I use Python with boost 1.36 for Python (could this be a problem?)
I want to use Python 2.6 because it was (i think so) built with VS2005. So I haven't to use msvcr71.dll. On monday I can send a stack trace and a screenshot of this crash a with E-Mail.
Jack Jansen wrote:
participants (2)
-
anti00Zero
-
Jack Jansen