[Python.NET] PythonNet for Mono, mostly done but need some help

angel ignacio colmenares laguado angel.ignacio.colmenares at gmail.com
Wed Jul 18 01:39:37 CEST 2007


hi,
great job!!

i downloaded  pythonnet2.5 rev 63, ran make and got python.exe and
Python.Runtime.dll.

i was not able to get clr.pyd ( or clr.so ), because i have not header files
( jit.h, environment.h....) but i can run mono python.exe and can work with
strings:



angel at angel-laptop:~/desarrollo/clr-2.0-python-2.5-branch$ mono python.exe
Python 2.5.1 (r251:54863, May  2 2007, 16:53:27)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PythonnetTest import Test
>>> a=Test("ÑÑÑÑ ñññ")
Constructor. Name= ÑÑÑÑ ñññ
>>> print a.Name
ÑÑÑÑ ñññ
>>> import System
>>> import clr
>>> dir(clr)
['PythonnetTest', 'System', '__doc__', '__file__', '__name__', 'preload']
>>> clr.preload
True
>>>


i will test more..

thanks.

angel ignacio colmenares laguado




2007/7/17, Christian Heimes <lists at cheimes.de>:
>
> I've good news for Linux, BSD and Mac users. With some outstanding help
> from the mono mailing list I was able to get PythonNet running on my
> Ubuntu box.
>
> I had a hard time implementing support for UCS-4 unicode representation
> until Jonathan Pryor and Jonathan Chambers gave me some information and
> sample code for a custom marshaler. UCS-4 uses up to four bytes to store
> unicode while Windows is using a wchar (?) or UCS-2 to store unicode.
> The CLR supports just CharSet.Unicode which is Microsoft's name for
> UCS-2. Most Linux distributions like Debian/Ubuntu are using a UCS-4
> build of Python.
>
> After the UCS-4 vs. UCS-2 problem was fixed I was confronted with same
> nasty seg faults. Brian gave me the tip to search for code that tries to
> Decref NULL (IntPtr.Zero) and I found three places. One is my fault, one
> Brian's and the third is equally shared between us since I didn't fix a
> problem the right way in the first place. Mono seems to be more
> sensitive to ref counter problems than .NET on Windows.
>
> The results are very promising but Mono's generic and overloading
> support seems to have some flaws. Two unit tests are failing that are
> working under Windows and a third test is failing early. I'd appreciate
> any insight knowledge to fix the outstanding tests.
>
> ======================================================================
> ERROR: testGenericMethodOverloadSelection (test_generic.GenericTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/heimes/dev/python/pythonnet25/src/tests/test_generic.py",
> line 353, in testGenericMethodOverloadSelection
>     value = type.Overloaded[str]("test")
> TypeError: No match found for given type params
>
> ======================================================================
> ERROR: testGenericMethodTypeHandling (test_generic.GenericTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/heimes/dev/python/pythonnet25/src/tests/test_generic.py",
> line 303, in testGenericMethodTypeHandling
>     self._testGenericMethodByType(System.Boolean, True)
>   File "/home/heimes/dev/python/pythonnet25/src/tests/test_generic.py",
> line 202, in _testGenericMethodByType
>     result = stype.Overloaded[ptype](value)
> TypeError: No match found for given type params
>
> ======================================================================
> FAIL: Test usage of generic value type definitions.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/heimes/dev/python/pythonnet25/src/tests/test_generic.py",
> line 81, in testGenericValueType
>     self.failUnless(inst.HasValue)
> AssertionError
>
>
> I'm also having trouble to create a facade clr module for Mono. The
> clr.pyd doesn't work under Mono since Unix builds of Python can't load a
> Windows PE executable. You can find my first and naive approach at
>
> http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/branches/clr-2.0-python-2.5-branch/src/monoclr/
> You can compile it with python setup.py or simple do "$ make -f
> makefile.mono clr.so".
>
> Christian
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
>



-- 
Atentamente,

angel ignacio colmenares laguado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythondotnet/attachments/20070717/1e74d79d/attachment.htm 


More information about the PythonDotNet mailing list