[Mono-list] Embedding Mono problem with PythonNet

Christian Heimes lists at cheimes.de
Tue Jul 17 13:43:09 EDT 2007


I've run into another problem with PythonNet. PythonNet can be
integrated into a Python interpretor in two ways. Either one can use a
custom Python interpretor that initializes the PythonNet engine
automatically
http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/branches/clr-2.0-python-2.5-branch/src/console/pythonconsole.cs?revision=56&view=markup
or one can load an extension module into an ordinary Python interpretor.
 The former is working well under Mono but the latter is giving me some
headache.

Under Windows and .NET the extension module is written in assembler and
compiled with ilasm to a Windows library. Mono's ilasm can compile the
module, too but the module can't be imported by an ELF Python
interpretor under Linux because ilasm creates a Windows library.
http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/branches/clr-2.0-python-2.5-branch/src/runtime/clrmodule.il?revision=43&view=markup

I've tried to create a Mono and Unix version of the clr module but it
doesn't work. "All" I have to do is to import the Python.Runtime.dll
assembly and call the static method
Python.Runtime.PythonEngine::InitExt(). My code is available under
http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/branches/clr-2.0-python-2.5-branch/src/monoclr/clr.c?revision=62&view=markup
It compiles fine with the flags from pkg-config but when I try to import
the module it crashes.

$ python2.5 -c "import clr" >segfault.txt 2>&1

Christian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: segfault.txt
Url: http://lists.ximian.com/pipermail/mono-list/attachments/20070717/500dc087/attachment.txt 


More information about the Mono-list mailing list