From lists at cheimes.de Sun Jul 1 23:33:00 2007 From: lists at cheimes.de (Christian Heimes) Date: Sun, 01 Jul 2007 23:33:00 +0200 Subject: [Python.NET] Python 2.5 compatibility and interop.cs Message-ID: <46881D8C.5050007@cheimes.de> Hello! I want to the pythonnet with Python 2.5 and .NET 2.0. So far I was able to fix the svn trunk revision 42 for .NET 2.0 using the tutorial from http://thread.gmane.org/gmane.comp.python.dotnet/576. I had to change clrModule to ModuleObject but it works under Python 2.4. Python 2.5 however doesn't work. I changed the dll in runtime.cs to internal static string dll = "python25"; in the hope that pythonnet doesn't need more changes. At first it looked promising. I was able to import clr and some other .NET assemblies. However using them is a different story. Python crashes everytime I try to use an object from an assembly. I compiled my own Python version in order to debug the error. It fails in typeobject.c:387 name = type_name(type, NULL); with an access violation. Something is trying to write to 0x00000000. I studied the pythonnet code a bit and I guess I have to alter interop.cs in order to make pythonnet compatible with Python 2.5. I don't know how it has to be changed and what it causing the error. Maybe ssize_t -> Py_ssize_t transition (I'm using a 32 bit Windows XP SP2)? Christian From brian.lloyd at revolution.com Mon Jul 2 17:18:38 2007 From: brian.lloyd at revolution.com (Brian Lloyd) Date: Mon, 02 Jul 2007 11:18:38 -0400 Subject: [Python.NET] Python 2.5 compatibility and interop.cs In-Reply-To: <46881D8C.5050007@cheimes.de> Message-ID: I'm pretty sure there were some changes to type structures in 2.5, so probably the only sane thing to do would be to do a 2.5-specific branch :( The interop stuff is some fairly deep voodoo - it essentially generates a bunch of thunks and wrappers matching the in-memory layouts of various python type objects and things. What would need to be done is an assessment of what changed in 2.5, then go into interop and change / add offsets etc. accordingly. I can say with some experience that it won't be fun ;) My available time (and the fact that IronPython gets 99% of the oxygen these days) means that I probably won't be able to get to this any time soon, but I'd be more than happy to help anyone who wants to take this on in any way I can. -Brian On 7/1/07 5:33 PM, "Christian Heimes" wrote: > Hello! > > I want to the pythonnet with Python 2.5 and .NET 2.0. So far I was able > to fix the svn trunk revision 42 for .NET 2.0 using the tutorial from > http://thread.gmane.org/gmane.comp.python.dotnet/576. I had to change > clrModule to ModuleObject but it works under Python 2.4. > > Python 2.5 however doesn't work. I changed the dll in runtime.cs to > > internal static string dll = "python25"; > > in the hope that pythonnet doesn't need more changes. At first it looked > promising. I was able to import clr and some other .NET assemblies. > However using them is a different story. Python crashes everytime I try > to use an object from an assembly. > > I compiled my own Python version in order to debug the error. It fails > in typeobject.c:387 > > name = type_name(type, NULL); > > with an access violation. Something is trying to write to 0x00000000. > > I studied the pythonnet code a bit and I guess I have to alter > interop.cs in order to make pythonnet compatible with Python 2.5. I > don't know how it has to be changed and what it causing the error. Maybe > ssize_t -> Py_ssize_t transition (I'm using a 32 bit Windows XP SP2)? > > Christian From lists at cheimes.de Mon Jul 2 18:58:34 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 02 Jul 2007 18:58:34 +0200 Subject: [Python.NET] Python 2.5 compatibility and interop.cs In-Reply-To: References: <46881D8C.5050007@cheimes.de> Message-ID: <46892EBA.2070109@cheimes.de> Brian Lloyd wrote: > I'm pretty sure there were some changes to type structures in 2.5, so > probably the only sane thing to do would be to do a 2.5-specific branch :( > > The interop stuff is some fairly deep voodoo - it essentially generates a > bunch of thunks and wrappers matching the in-memory layouts of various > python type objects and things. What would need to be done is an assessment > of what changed in 2.5, then go into interop and change / add offsets etc. > accordingly. I can say with some experience that it won't be fun ;) > > My available time (and the fact that IronPython gets 99% of the oxygen > these days) means that I probably won't be able to get to this any time > soon, but I'd be more than happy to help anyone who wants to take this on > in any way I can. The docs don't mention a change to the type structure between 2.4 and 2.5. So far I found just two changes to the C api which may effect pythonnet: * C API: Many functions now use Py_ssize_t instead of int to allow processing more data on 64-bit machines. Extension code may need to make the same change to avoid warnings and to support 64-bit machines. See the earlier section 10 for a discussion of this change. * C API: The obmalloc changes mean that you must be careful to not mix usage of the PyMem_*() and PyObject_*() families of functions. Memory allocated with one family's *_Malloc() must be freed with the corresponding family's *_Free() function. But I suspect that internal changes to Include/object.h and children aren't mentioned in the migration docs. Dealing with memory addresses and offsets brings back memory from a time before I started to use Python ... I'll discuss it with my buddies. We may take the challenge. We don't have another choice since pythonnet looks like the easiest way to integrate our C# / .NET 2.0 library in Blender. Can you give me some tips how you debugged and created interops.cs when you developed the project? What tools were/are you using? Since pythonnet doesn't compile under Linux and Mono I suspect that I'm restricted to MS VS 2005. I can offer you a more direct communication channel (IRC freenode.net, ICQ, Jabber, MSN and Skype if you can stand my German accent ;) ). Christian From lists at cheimes.de Mon Jul 2 23:45:40 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 02 Jul 2007 23:45:40 +0200 Subject: [Python.NET] Python 2.5 compatibility and interop.cs In-Reply-To: <46892EBA.2070109@cheimes.de> References: <46881D8C.5050007@cheimes.de> <46892EBA.2070109@cheimes.de> Message-ID: For your information: I've created an EXPERIMENTAL branch: https://pythonnet.svn.sourceforge.net/svnroot/pythonnet/branches/clr-2.0-python-2.5-branch/ It is NOT ready for production! Overloading and exception are currently broken but I'm working on it. I've also added project files and a solution file for MS VC#. The files are also working with the free Express Edition. Christian From lists at cheimes.de Mon Jul 9 01:41:29 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 09 Jul 2007 01:41:29 +0200 Subject: [Python.NET] Testers for new branch wanted Message-ID: Hello PythonNet users! I'm making good progress in my https://pythonnet.svn.sourceforge.net/svnroot/pythonnet/branches/clr-2.0-python-2.5-branch/ branch. I'm finally at a point where I need people with real life applications to test my branch. Although the branch is named python 2.5 it contains code for Python 2.4 and is even prepared for Python 2.6 (untested yet). The target version is configured over define symboles PYTHON24, PYTHON25 or PYTHON26. The makefile is pretty self explaining. The settings in my new VS C# solution file are explained in VS_README.txt. The branch also fixes some code related to Python 2.4, mostly overloading related code. Managed methods with params and overloading with implicit types are still broken. I'm not sure if I'm going to implement the features. I don't need it for my project and my knowledge of CLR and C# is too limited yet. Important changes and fixes: * Python 2.5 compatible * New preload switch (turn preloading on or off by setting clr.preload to True or False) * New VS solution and project files * Unit test enhancements Christian From roman.yakovenko at gmail.com Mon Jul 9 07:39:13 2007 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Mon, 9 Jul 2007 08:39:13 +0300 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: Message-ID: <7465b6170707082239wa1f709btd9bb23a52e3ba5cc@mail.gmail.com> On 7/9/07, Christian Heimes wrote: > Hello PythonNet users! > > I'm making good progress in my > https://pythonnet.svn.sourceforge.net/svnroot/pythonnet/branches/clr-2.0-python-2.5-branch/ > branch. I'm finally at a point where I need people with real life > applications to test my branch. Does it work with binaries ( Managed C++ DLL ) compiled for .Net 1.1? -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From rlacko at gratex.com Mon Jul 9 08:54:19 2007 From: rlacko at gratex.com (Lacko Roman) Date: Mon, 9 Jul 2007 08:54:19 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: Message-ID: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> Hello Christian! First, Thank You ! I needed this python 2.5 version since previous year but was too lazy to work on it my self. I will test it ASAP in my work, where we using Python.NET as build management software written by me. Will send bug reports here. Best regards Roman -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Christian Heimes Sent: Monday, July 09, 2007 1:41 AM To: pythondotnet at python.org Subject: [Python.NET] Testers for new branch wanted Hello PythonNet users! I'm making good progress in my https://pythonnet.svn.sourceforge.net/svnroot/pythonnet/branches/clr-2.0 -python-2.5-branch/ branch. I'm finally at a point where I need people with real life applications to test my branch. Although the branch is named python 2.5 it contains code for Python 2.4 and is even prepared for Python 2.6 (untested yet). The target version is configured over define symboles PYTHON24, PYTHON25 or PYTHON26. The makefile is pretty self explaining. The settings in my new VS C# solution file are explained in VS_README.txt. The branch also fixes some code related to Python 2.4, mostly overloading related code. Managed methods with params and overloading with implicit types are still broken. I'm not sure if I'm going to implement the features. I don't need it for my project and my knowledge of CLR and C# is too limited yet. Important changes and fixes: * Python 2.5 compatible * New preload switch (turn preloading on or off by setting clr.preload to True or False) * New VS solution and project files * Unit test enhancements Christian _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From lists at cheimes.de Mon Jul 9 17:02:49 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 09 Jul 2007 17:02:49 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: <7465b6170707082239wa1f709btd9bb23a52e3ba5cc@mail.gmail.com> References: <7465b6170707082239wa1f709btd9bb23a52e3ba5cc@mail.gmail.com> Message-ID: Roman Yakovenko wrote: > Does it work with binaries ( Managed C++ DLL ) compiled for .Net 1.1? I don't know since I don't have any applications with .NET 1.1 binaries. Christian From lists at cheimes.de Mon Jul 9 19:46:44 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 09 Jul 2007 19:46:44 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> Message-ID: Lacko Roman wrote: > I needed this python 2.5 version since previous year but was too lazy to > work on it my self. > I will test it ASAP in my work, where we using Python.NET as build > management software written by me. > Will send bug reports here. We are going to need a Python 2.5 version soon for our project. We are planing to integrate a .NET 2.0 library in Blender using its Python 2.5 interface. Yes, the idea is sick but the results are rather promising. *g* Can you also test my branch with Python 2.4? You have to change two lines in the makefile or on setting of the Python.Runtime project in VS. My changes are *hopefully* compatible with the trunk's Python 2.4 version. Christian From rlacko at gratex.com Tue Jul 10 07:57:45 2007 From: rlacko at gratex.com (Lacko Roman) Date: Tue, 10 Jul 2007 07:57:45 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> Message-ID: <451E11FD7D0ACB4A9207723712EC53D101510EC4@ex01.hq.gratex.com> Hi Christian, I'm interested in Blender development too, I'm using Blender two years now, and integration with .net sounds very interesting BTW, to build the solution I have to set full path to ILASM.EXE in the postbuild evets in Python.Runtime and Console projects So far, my application runs with your branch, I tested version 2.5 and also 2.4. I will do more tests later, but so far so good :-) Roman -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Christian Heimes Sent: Monday, July 09, 2007 7:47 PM To: pythondotnet at python.org Subject: Re: [Python.NET] Testers for new branch wanted Lacko Roman wrote: > I needed this python 2.5 version since previous year but was too lazy > to work on it my self. > I will test it ASAP in my work, where we using Python.NET as build > management software written by me. > Will send bug reports here. We are going to need a Python 2.5 version soon for our project. We are planing to integrate a .NET 2.0 library in Blender using its Python 2.5 interface. Yes, the idea is sick but the results are rather promising. *g* Can you also test my branch with Python 2.4? You have to change two lines in the makefile or on setting of the Python.Runtime project in VS. My changes are *hopefully* compatible with the trunk's Python 2.4 version. Christian _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From lists at cheimes.de Tue Jul 10 16:11:12 2007 From: lists at cheimes.de (Christian Heimes) Date: Tue, 10 Jul 2007 16:11:12 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: Message-ID: Ladies and gentlemen, please svn up! I've just implemented support for spam(params object[] egg) style methods. I'm down from four to one failing unit test. Christian From lists at cheimes.de Tue Jul 10 17:25:30 2007 From: lists at cheimes.de (Christian Heimes) Date: Tue, 10 Jul 2007 17:25:30 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: <451E11FD7D0ACB4A9207723712EC53D101510EC4@ex01.hq.gratex.com> References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> <451E11FD7D0ACB4A9207723712EC53D101510EC4@ex01.hq.gratex.com> Message-ID: Lacko Roman wrote: > I'm interested in Blender development too, I'm using Blender two years > now, and integration with .net sounds very interesting My preliminary tests are promising after I found the correct place to put the files. I had to copy clr.pyd, Python.Runtime.dll and my assembly next to blender.exe > BTW, to build the solution I have to set full path to ILASM.EXE in the > postbuild evets in Python.Runtime and Console projects > > So far, my application runs with your branch, I tested version 2.5 and > also 2.4. I will do more tests later, but so far so good :-) Strange. Do you have multiple installations of .NET (1.1, 2.0 and 3.0)?. Christian From rlacko at gratex.com Tue Jul 10 17:36:01 2007 From: rlacko at gratex.com (Lacko Roman) Date: Tue, 10 Jul 2007 17:36:01 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> <451E11FD7D0ACB4A9207723712EC53D101510EC4@ex01.hq.gratex.com> Message-ID: <451E11FD7D0ACB4A9207723712EC53D101555721@ex01.hq.gratex.com> Yes, I have installed python 2.4 and 2.5 and .NET 1.1, 2.0 and 3.0 on my PC I first build clr.pyd and Python.Runtime.dll for python 2.4 then copied Python.Runtime.dll to and clr.pyd to \DLLs and tested my application with explicit call of python 2.4 interpreter, like \python.exe app.py Then I have repeated everything for python 2.5 So far, everything worked Roman -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Christian Heimes Sent: Tuesday, July 10, 2007 5:26 PM To: pythondotnet at python.org Subject: Re: [Python.NET] Testers for new branch wanted Lacko Roman wrote: > I'm interested in Blender development too, I'm using Blender two years > now, and integration with .net sounds very interesting My preliminary tests are promising after I found the correct place to put the files. I had to copy clr.pyd, Python.Runtime.dll and my assembly next to blender.exe > BTW, to build the solution I have to set full path to ILASM.EXE in the > postbuild evets in Python.Runtime and Console projects > > So far, my application runs with your branch, I tested version 2.5 and > also 2.4. I will do more tests later, but so far so good :-) Strange. Do you have multiple installations of .NET (1.1, 2.0 and 3.0)?. Christian _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From lists at cheimes.de Tue Jul 10 19:27:51 2007 From: lists at cheimes.de (Christian Heimes) Date: Tue, 10 Jul 2007 19:27:51 +0200 Subject: [Python.NET] Python 2.5 compatibility and interop.cs In-Reply-To: <46881D8C.5050007@cheimes.de> References: <46881D8C.5050007@cheimes.de> Message-ID: I've fixed another bug related to the clr.preload flag and build a snapshot of revision 53. It's available under http://downloads.sourceforge.net/pythonnet/PythonNet-snapshot-r53.zip Christian From thor at tordivel.no Tue Jul 10 21:48:46 2007 From: thor at tordivel.no (Thor Vollset) Date: Tue, 10 Jul 2007 21:48:46 +0200 Subject: [Python.NET] Does it work with binaries ( Managed C++ DLL ) compiled for .Net 1.1? References: Message-ID: <006801c7c32b$546f2a50$0500000a@TDVTV11> > Message: 1 > Date: Mon, 09 Jul 2007 17:02:49 +0200 > From: Christian Heimes > Subject: Re: [Python.NET] Testers for new branch wanted > To: pythondotnet at python.org > Message-ID: > Content-Type: text/plain; charset=ISO-8859-1 > > Roman Yakovenko wrote: >> Does it work with binaries ( Managed C++ DLL ) compiled for .Net 1.1? > > I don't know since I don't have any applications with .NET 1.1 binaries. > > Christian > i have tested the new branch with python 2.4 - it works with 1.1 binaries as far as i understand Thor Vollset ---------------------------------------------------------------------------------- TORDIVEL AS Storgata 20 0184 Oslo Norway Tel: +47 23 15 87 00 Fax: +47 23 15 87 01 E-mail: thor at tordivel.no Web: http://www.scorpionvision.com ---------------------------------------------------------------------------------- Scorpion Vision Software - Eliminates your weakest link ---------------------------------------------------------------------------------- From brian.lloyd at revolutionhealth.com Mon Jul 9 18:06:44 2007 From: brian.lloyd at revolutionhealth.com (Brian Lloyd) Date: Mon, 9 Jul 2007 12:06:44 -0400 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: <7465b6170707082239wa1f709btd9bb23a52e3ba5cc@mail.gmail.com> Message-ID: <4E2862A8-67D1-46B0-B9FE-64DE7DBA30BF@revolutionhealth.com> It should work with any managed assembly (vb,cpp, etc) Sent from my iPhone On Jul 9, 2007, at 11:02 AM, "Christian Heimes" wrote: > Roman Yakovenko wrote: >> Does it work with binaries ( Managed C++ DLL ) compiled for .Net 1.1? > > I don't know since I don't have any applications with .NET 1.1 > binaries. > > Christian > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From brian.lloyd at revolutionhealth.com Mon Jul 9 22:35:12 2007 From: brian.lloyd at revolutionhealth.com (Brian Lloyd) Date: Mon, 9 Jul 2007 16:35:12 -0400 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> Message-ID: Christian - do the overload tests pass for 2.4? I'm out of town ATM but can look at those when I get back (sat). Sent from my iPhone On Jul 9, 2007, at 1:46 PM, "Christian Heimes" wrote: > Lacko Roman wrote: >> I needed this python 2.5 version since previous year but was too >> lazy to >> work on it my self. >> I will test it ASAP in my work, where we using Python.NET as build >> management software written by me. >> Will send bug reports here. > > We are going to need a Python 2.5 version soon for our project. We are > planing to integrate a .NET 2.0 library in Blender using its Python > 2.5 > interface. Yes, the idea is sick but the results are rather > promising. *g* > > Can you also test my branch with Python 2.4? You have to change two > lines in the makefile or on setting of the Python.Runtime project in > VS. > My changes are *hopefully* compatible with the trunk's Python 2.4 > version. > > Christian > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From rlacko at gratex.com Tue Jul 10 13:43:21 2007 From: rlacko at gratex.com (Lacko Roman) Date: Tue, 10 Jul 2007 13:43:21 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> Message-ID: <451E11FD7D0ACB4A9207723712EC53D10151131F@ex01.hq.gratex.com> Hi, Just sending a fresh build for python 2.5, in attachment Roman -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Christian Heimes Sent: Monday, July 09, 2007 7:47 PM To: pythondotnet at python.org Subject: Re: [Python.NET] Testers for new branch wanted Lacko Roman wrote: > I needed this python 2.5 version since previous year but was too lazy > to work on it my self. > I will test it ASAP in my work, where we using Python.NET as build > management software written by me. > Will send bug reports here. We are going to need a Python 2.5 version soon for our project. We are planing to integrate a .NET 2.0 library in Blender using its Python 2.5 interface. Yes, the idea is sick but the results are rather promising. *g* Can you also test my branch with Python 2.4? You have to change two lines in the makefile or on setting of the Python.Runtime project in VS. My changes are *hopefully* compatible with the trunk's Python 2.4 version. Christian _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- A non-text attachment was scrubbed... Name: clr-2.0-python-2.5.zip Type: application/x-zip-compressed Size: 39471 bytes Desc: clr-2.0-python-2.5.zip Url : http://mail.python.org/pipermail/pythondotnet/attachments/20070710/976ff9c7/attachment-0001.bin From angel.ignacio.colmenares at gmail.com Sun Jul 15 18:57:14 2007 From: angel.ignacio.colmenares at gmail.com (angel ignacio colmenares laguado) Date: Sun, 15 Jul 2007 11:57:14 -0500 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: <451E11FD7D0ACB4A9207723712EC53D10151131F@ex01.hq.gratex.com> References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> <451E11FD7D0ACB4A9207723712EC53D10151131F@ex01.hq.gratex.com> Message-ID: <3f37f8c90707150957w12332d58nada8c190355fc78a@mail.gmail.com> Hi, i'm testing pythonnet25 in my ubuntu 7.04: 1. Some changes in makefile RUNNER=mono ILDASM=monodis ILASM=ilasm CSC=gmcs PYTHONVER=PYTHON25 all: python.exe clr.pyd (i dont't build Python.Test.dll) 2. Some changes in /etc/mono/config: (To tell mono where is python library) 3. run : make i get some warnings and : Operation completed successfully 4. mono python.exe Unhandled Exception: System.EntryPointNotFoundException: PyUnicodeUCS2_FromUnicode at (wrapper managed-to-native) Python.Runtime.Runtime:PyUnicode_FromUnicode (string,int) at Python.Runtime.Runtime.PyUnicode_FromString (System.String s) [0x00000] at Python.Runtime.Runtime.Initialize () [0x00000] at Python.Runtime.PythonEngine.Initialize () [0x00000] at Python.Runtime.PythonConsole.Main (System.String[] args) [0x00000] i replaced all UCS2 with UCS4 in runtime.cs, and run make and mono python.exe again: Python 2.5.1 (r251:54863, May 27 2007, 15:52:07) [GCC 4.1.3 20070518 (prerelease) (Ubuntu 4.1.2-8ubuntu1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 5. some code in c#: //PythonnetTest.cs using System; namespace PythonnetTest { class Test { private string name; private int number; public Test(string name) { this.name=name; Console.WriteLine("Constructor. Name= " +this.name); } public string Name{ get{return this.name;} set{ this.name=value; Console.WriteLine("Name= " +this.name); } } public int Number{ get{return this.number;} set{ this.number=value; Console.WriteLine("Number = " + this.number.ToString()); } } } } gmcs PythonnetTest.cs -t:library 6. back to pythonnet... >>> from PythonnetTest import Test >>> a= Test("ABCDE") Constructor. Name= ABCDE >>> a.Number=1500 Number = 1500 >>> a.Number 1500 >>> a.Name u'\U00420041\U00440043E\U0834d138\x00' >>> print a.Name ????E and this is the problem: i can't get a string from net in pythonnet !!! some ideas what is wrong ? angel ignacio colmenares laguado 2007/7/10, Lacko Roman : > > Hi, > Just sending a fresh build for python 2.5, in attachment > > Roman > > -----Original Message----- > From: pythondotnet-bounces at python.org > [mailto:pythondotnet-bounces at python.org] On Behalf Of Christian Heimes > Sent: Monday, July 09, 2007 7:47 PM > To: pythondotnet at python.org > Subject: Re: [Python.NET] Testers for new branch wanted > > Lacko Roman wrote: > > I needed this python 2.5 version since previous year but was too lazy > > to work on it my self. > > I will test it ASAP in my work, where we using Python.NET as build > > management software written by me. > > Will send bug reports here. > > We are going to need a Python 2.5 version soon for our project. We are > planing to integrate a .NET 2.0 library in Blender using its Python 2.5 > interface. Yes, the idea is sick but the results are rather promising. > *g* > > Can you also test my branch with Python 2.4? You have to change two > lines in the makefile or on setting of the Python.Runtime project in VS. > My changes are *hopefully* compatible with the trunk's Python 2.4 > version. > > Christian > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20070715/5bbfbc29/attachment.htm From lists at cheimes.de Sun Jul 15 23:24:02 2007 From: lists at cheimes.de (Christian Heimes) Date: Sun, 15 Jul 2007 23:24:02 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: <3f37f8c90707150957w12332d58nada8c190355fc78a@mail.gmail.com> References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> <451E11FD7D0ACB4A9207723712EC53D10151131F@ex01.hq.gratex.com> <3f37f8c90707150957w12332d58nada8c190355fc78a@mail.gmail.com> Message-ID: angel ignacio colmenares laguado wrote: >>>> a.Name > u'\U00420041\U00440043E\U0834d138\x00' >>>> print a.Name > ????E > > > and this is the problem: i can't get a string from net in pythonnet !!! > > some ideas what is wrong ? I've a pretty good idea what is wrong. It's related to your changes to runtime.cs. Python on Windows is using UCS-2 (universal character set) to store unicode internally while most Linux distributions are using UCS-4. http://en.wikipedia.org/wiki/UTF-16/UCS-2 The dll import uses Charset.Unicode as a charset. My VS help claims that Charset.Unicode is a 2 bytes Unicode char which let me believe it's UCS2. I'll have to see how I can work around the issue. I may have to manually convert between UCS-2 and UCS-4. :( Christian From lists at cheimes.de Mon Jul 16 01:07:00 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 16 Jul 2007 01:07:00 +0200 Subject: [Python.NET] Testers for new branch wanted In-Reply-To: <3f37f8c90707150957w12332d58nada8c190355fc78a@mail.gmail.com> References: <451E11FD7D0ACB4A9207723712EC53D1014B56EB@ex01.hq.gratex.com> <451E11FD7D0ACB4A9207723712EC53D10151131F@ex01.hq.gratex.com> <3f37f8c90707150957w12332d58nada8c190355fc78a@mail.gmail.com> Message-ID: angel ignacio colmenares laguado wrote: > and this is the problem: i can't get a string from net in pythonnet !!! > > some ideas what is wrong ? Oh h... It's going to be a PITB to fix it. Microsoft's specs don't care about UCS-4 and UTF-32. They only support Windows like wide strings (aka UCS-2). http://www.mono-project.com/Dllimport#Commentary It seems the mono developers have run into the issue several years ago (even with Python) and they may be salvation at hand. Let's see if I can dig up some code. http://tirania.org/blog/archive/2003/Sep-13.html Christian From lists at cheimes.de Tue Jul 17 15:15:28 2007 From: lists at cheimes.de (Christian Heimes) Date: Tue, 17 Jul 2007 15:15:28 +0200 Subject: [Python.NET] PythonNet for Mono, mostly done but need some help Message-ID: 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 From angel.ignacio.colmenares at gmail.com Wed Jul 18 01:39:37 2007 From: angel.ignacio.colmenares at gmail.com (angel ignacio colmenares laguado) Date: Tue, 17 Jul 2007 18:39:37 -0500 Subject: [Python.NET] PythonNet for Mono, mostly done but need some help In-Reply-To: References: Message-ID: <3f37f8c90707171639k759aa963gd5cc980c60fb4818@mail.gmail.com> 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 : > > 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 From lists at cheimes.de Wed Jul 18 23:49:59 2007 From: lists at cheimes.de (Christian Heimes) Date: Wed, 18 Jul 2007 23:49:59 +0200 Subject: [Python.NET] PythonNet for Mono, mostly done but need some help In-Reply-To: <3f37f8c90707171639k759aa963gd5cc980c60fb4818@mail.gmail.com> References: <3f37f8c90707171639k759aa963gd5cc980c60fb4818@mail.gmail.com> Message-ID: angel ignacio colmenares laguado wrote: > 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: The clr.pyd is useless under Linux. It's a Windows DLL and can't be loaded by Linux's Python. In order to build clr.so you have to install libmono-dev but clr.so is horrible broken. I've run into a nasty problem with Python's small int cache. It's causing seg faults for small ints. Python.Tests.dll can be build under Mono, too. Please run the unit tests for me, would you? :) Christian From angel.ignacio.colmenares at gmail.com Thu Jul 19 04:22:31 2007 From: angel.ignacio.colmenares at gmail.com (angel ignacio colmenares laguado) Date: Wed, 18 Jul 2007 21:22:31 -0500 Subject: [Python.NET] PythonNet for Mono, mostly done but need some help In-Reply-To: References: <3f37f8c90707171639k759aa963gd5cc980c60fb4818@mail.gmail.com> Message-ID: <3f37f8c90707181922g3c31df6atb6982eaea87f72ef@mail.gmail.com> ok. i ran unit tests, and this is what i got: angel at angel-laptop:~/desarrollo/clr-2.0-python-2.5-branch$ mono python.exe./src/tests/runtests.py ..............................................................EE....F.......................................................................................................................................................................................................................................................... ====================================================================== ERROR: testGenericMethodOverloadSelection (test_generic.GenericTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/angel/desarrollo/clr-2.0-python-2.5-branch/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/angel/desarrollo/clr-2.0-python-2.5-branch/src/tests/test_generic.py", line 303, in testGenericMethodTypeHandling self._testGenericMethodByType(System.Boolean, True) File "/home/angel/desarrollo/clr-2.0-python-2.5-branch/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/angel/desarrollo/clr-2.0-python-2.5-branch/src/tests/test_generic.py", line 81, in testGenericValueType self.failUnless(inst.HasValue) AssertionError ---------------------------------------------------------------------- Ran 319 tests in 3.447s FAILED (failures=1, errors=2) 2007/7/18, Christian Heimes : > > angel ignacio colmenares laguado wrote: > > 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: > > The clr.pyd is useless under Linux. It's a Windows DLL and can't be > loaded by Linux's Python. In order to build clr.so you have to install > libmono-dev but clr.so is horrible broken. I've run into a nasty problem > with Python's small int cache. It's causing seg faults for small ints. > > Python.Tests.dll can be build under Mono, too. Please run the unit tests > for me, would you? :) > > 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/20070718/ffdce3cf/attachment.htm From lists at cheimes.de Thu Jul 19 15:40:01 2007 From: lists at cheimes.de (Christian Heimes) Date: Thu, 19 Jul 2007 15:40:01 +0200 Subject: [Python.NET] PythonNet for Mono, mostly done but need some help In-Reply-To: <3f37f8c90707181922g3c31df6atb6982eaea87f72ef@mail.gmail.com> References: <3f37f8c90707171639k759aa963gd5cc980c60fb4818@mail.gmail.com> <3f37f8c90707181922g3c31df6atb6982eaea87f72ef@mail.gmail.com> Message-ID: angel ignacio colmenares laguado wrote: > angel at angel-laptop:~/desarrollo/clr-2.0-python-2.5-branch$ mono > python.exe./src/tests/runtests.py > ..............................................................EE....F.......................................................................................................................................................................................................................................................... > > ====================================================================== > ERROR: testGenericMethodOverloadSelection (test_generic.GenericTests) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File > "/home/angel/desarrollo/clr-2.0-python-2.5-branch/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/angel/desarrollo/clr-2.0-python-2.5-branch/src/tests/test_generic.py", > > line 303, in testGenericMethodTypeHandling > self._testGenericMethodByType(System.Boolean, True) > File > "/home/angel/desarrollo/clr-2.0-python-2.5-branch/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/angel/desarrollo/clr-2.0-python-2.5-branch/src/tests/test_generic.py", > > line 81, in testGenericValueType > self.failUnless(inst.HasValue) > AssertionError > > ---------------------------------------------------------------------- > Ran 319 tests in 3.447s > > FAILED (failures=1, errors=2) Mono's support for overloading seems to have some bugs. On Windows just one unit test related to overloading is failing and it is failing later. I'll have to familiarize myself with MonoDevelop in order to debug the bugs. I've promised Miguel to report them. Christian From lists at cheimes.de Sun Jul 29 03:03:12 2007 From: lists at cheimes.de (Christian Heimes) Date: Sun, 29 Jul 2007 03:03:12 +0200 Subject: [Python.NET] PythonNet news Message-ID: Good evening Python for .NET users! I've a list of great news for you. In the past weeks I've spent some time in fixing and enhancing PythonNet. Summary: * My branch was merged into the trunk yesterday. Please use the trunk for future development. * PythonNet now works with Python 2.4 and 2.5. Python 2.6 compatibility is already prepared. * A bunch of small bugs were fixed and some new features implemented. Generics, overloading and variable parameter function should work better. * PythonNet also works under Un*x and Mono with UCS 2 and UCS 4 builds of Python. I've created a clr.so module since the clr.pyd module doesn't work on non Windows OS. I've also created a python and clrpython binary for Debian, Ubuntu and other users with a python binary not linked against libpython2.x.so. Two additional unit tests are currently failing. * The source repository contains project files for MS Visual Studio and MonoDevelop. The MS VS files contain a special target which automatically runs the unit tests in a console window. * A new one-size-fits-all Makefile makes it much easier to compile PythonNet for different versions of Python. It automatically detects UCS 2/4 settings and Python version from a Python binary: $ make PYTHON=/path/to/python * The clr module provides new features: AddReference, ListAssemblies(verbosity), preload Christian -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://mail.python.org/pipermail/pythondotnet/attachments/20070729/94d64234/attachment.pgp From mkozyarchuk at funddevelopmentservices.com Mon Jul 30 14:54:24 2007 From: mkozyarchuk at funddevelopmentservices.com (Maksim Kozyarchuk) Date: Mon, 30 Jul 2007 08:54:24 -0400 Subject: [Python.NET] PythonNet news In-Reply-To: Message-ID: <8674D71026D5C848831DB7CA34B1C75862FD20@fds1wmail01.funddevelopmentservices.com> Christian, Thanks so much for this work. Do you have a sense of what it would take to make current trunk of PythonNet compatible with Python 2.3? Maksim -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Christian Heimes Sent: Saturday, July 28, 2007 9:03 PM To: pythondotnet at python.org Subject: [Python.NET] PythonNet news Good evening Python for .NET users! I've a list of great news for you. In the past weeks I've spent some time in fixing and enhancing PythonNet. Summary: * My branch was merged into the trunk yesterday. Please use the trunk for future development. * PythonNet now works with Python 2.4 and 2.5. Python 2.6 compatibility is already prepared. * A bunch of small bugs were fixed and some new features implemented. Generics, overloading and variable parameter function should work better. * PythonNet also works under Un*x and Mono with UCS 2 and UCS 4 builds of Python. I've created a clr.so module since the clr.pyd module doesn't work on non Windows OS. I've also created a python and clrpython binary for Debian, Ubuntu and other users with a python binary not linked against libpython2.x.so. Two additional unit tests are currently failing. * The source repository contains project files for MS Visual Studio and MonoDevelop. The MS VS files contain a special target which automatically runs the unit tests in a console window. * A new one-size-fits-all Makefile makes it much easier to compile PythonNet for different versions of Python. It automatically detects UCS 2/4 settings and Python version from a Python binary: $ make PYTHON=/path/to/python * The clr module provides new features: AddReference, ListAssemblies(verbosity), preload Christian From lists at cheimes.de Mon Jul 30 17:09:55 2007 From: lists at cheimes.de (Christian Heimes) Date: Mon, 30 Jul 2007 17:09:55 +0200 Subject: [Python.NET] PythonNet news In-Reply-To: <8674D71026D5C848831DB7CA34B1C75862FD20@fds1wmail01.funddevelopmentservices.com> References: <8674D71026D5C848831DB7CA34B1C75862FD20@fds1wmail01.funddevelopmentservices.com> Message-ID: <46ADFF43.2060406@cheimes.de> > Do you have a sense of what it would take to make current trunk > of PythonNet compatible with Python 2.3? You need a fair knowledge of Python's C API and the PyObject* + PyType* structs. You have to compare the header files with the code in interop.cs and add some code the runtime.cs. It's pretty straight forward unless the C API differences between 2.3 and 2.4 are too large. Christian