[Python.NET] error messages

Dirk Krause dirk.krause at pixelpark.com
Wed Oct 1 06:49:13 CEST 2008


OK, it works now, thanks to both of you for the trick!
 
(it's u'2.0.50727.1434' here)
 
I applied that patch that was mentioned in Feihong's blog post from the mailing list and built that thing and it works - all three demos running now, and Feihongs test, too.
 
Just to reiiterate the posting that made the difference:
http://mail.python.org/pipermail/pythondotnet/2008-January/000771.html
 
Index: pythonnet/src/runtime/assemblymanager.cs
===================================================================
--- pythonnet/src/runtime/assemblymanager.cs    (révision 90)
+++ pythonnet/src/runtime/assemblymanager.cs    (copie de travail)
@@ -87,7 +87,12 @@
         static void AssemblyLoadHandler(Object ob, AssemblyLoadEventArgs args){
             Assembly assembly = args.LoadedAssembly;
             assemblies.Add(assembly);
-            ScanAssembly(assembly);
+            // .NET v2.0 SP1 bug workaround ; ScanAssembly called on newly created DynamicAssembly causes problems
+            // only scan non-dynamic assemblies...
+            if ( !(assembly is System.Reflection.Emit.AssemblyBuilder) )
+            {
+                ScanAssembly(assembly);
+            }
         }
 

________________________________

Von: Craig Farrow [mailto:craig_farrow at sil.org]
Gesendet: Mi 01.10.2008 05:08
An: Dirk Krause
Cc: Feihong Hsu
Betreff: Re: AW: AW: [Python.NET] error messages


Dirk,

Disabling that button.Click line makes helloform.py work for me, too. It looks like the Great Firewall is blocking googlepages.com, so unfortunately I can't try that fix -- but that sounds like the right direction.

Here's how to get the version of .NET being used:
>>> from System import Environment
>>> Environment.Version.ToString()
u'2.0.50727.1433'
>>>

Craig.

10/1/2008 2:57 AM dï, Dirk Krause pisdimis: 

	hmmm ... I have SP1 for sure, but also .NET 3.5 - maybe that is the problem?

________________________________

	Von: Feihong Hsu [mailto:hsu.feihong at yahoo.com]
	Gesendet: Di 30.09.2008 20:44
	An: Craig Farrow; Dirk Krause
	Cc: pythondotnet at python.org
	Betreff: Re: AW: [Python.NET] error messages
	
	
Usually you can find a clue by looking in Control Panel > Add/Remove Programs. If you got SP1 or something like that, it'll be listed.

--- On Tue, 9/30/08, Dirk Krause <dirk.krause at pixelpark.com> <mailto:dirk.krause at pixelpark.com>  wrote:


	From: Dirk Krause <dirk.krause at pixelpark.com> <mailto:dirk.krause at pixelpark.com> 
	Subject: AW: [Python.NET] error messages
	To: "Feihong Hsu" <hsu.feihong at yahoo.com> <mailto:hsu.feihong at yahoo.com> , "Craig Farrow" <craig_farrow at sil.org> <mailto:craig_farrow at sil.org> 
	Cc: pythondotnet at python.org
	Date: Tuesday, September 30, 2008, 12:35 PM
	
	
	nah, doesnt work here:
	D:\projects\pyov>helloform.py
	Unbehandelte Ausnahme: System.IO.FileLoadException: Die Datei oder Assembly Python.Runtime, Version=2.0.0.2, Culture=neu
	tral, PublicKeyToken=64e14e845abf2e60 oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinitio
	n der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
	Dateiname: Python.Runtime, Version=2.0.0.2, Culture=neutral, PublicKeyToken=64e14e845abf2e60
	   bei Python.Runtime.PythonConsole.Main(String[] args)
	 
	I probably have to compile it.
	 
	Is there a way to find out which .NET version is installed?

________________________________

	Von: Feihong Hsu [mailto:hsu.feihong at yahoo.com]
	Gesendet: Di 30.09.2008 18:56
	An: Craig Farrow; Dirk Krause
	Cc: pythondotnet at python.org
	Betreff: Re: [Python.NET] error messages
	
	
This problem sounds familiar. Perhaps you guys are using .NET 2.0 with SP1 applied? Then this blog post of mine might help:

http://feihonghsu.blogspot.com/2008/02/pythonnet-20-for-net-sp1_15.html

If you want, you can try the binary that I made instead of applying the patch yourself.


--- On Tue, 9/30/08, Dirk Krause <dirk.krause at pixelpark.com> <mailto:dirk.krause at pixelpark.com>  wrote:


	From: Dirk Krause <dirk.krause at pixelpark.com> <mailto:dirk.krause at pixelpark.com> 
	Subject: Re: [Python.NET] error messages
	To: "Craig Farrow" <craig_farrow at sil.org> <mailto:craig_farrow at sil.org> 
	Cc: pythondotnet at python.org
	Date: Tuesday, September 30, 2008, 8:50 AM
	
	
	right you are again. splitter works here, too.
	 
	Can you confirm that helloform runs when you disable line 33?
	        # Register the event handler
	        # self.button.Click += self.button_Click
	

________________________________

	Von: Craig Farrow [mailto:craig_farrow at sil.org]
	Gesendet: Di 30.09.2008 15:25
	An: Dirk Krause
	Cc: pythondotnet at python.org
	Betreff: Re: AW: [Python.NET] error messages
	
	
	Ah, yes. On my system (Vista, Python 2.4 or 2.5, pythonnet-2.0-alpha2) only splitter.py works out of the three demos. I haven't tried to figure out why...
	
	Craig.
	
	9/30/2008 9:13 PM dï, Dirk Krause pisdimis: 

		much better!   ...python itself runs now.
		 
		but not really good either, trying to run helloform.py gives me:
		 
		D:\projects\pyov>helloform.py
		Unbehandelte Ausnahme: System.TypeInitializationException: Der Typeninitialisierer für Python.Runtime.CodeGenerator hat
		eine Ausnahme verursacht. ---> System.InvalidCastException: Das Objekt des Typs System.Reflection.Module kann nicht in T
		yp System.Reflection.Emit.ModuleBuilder umgewandelt werden.
		   bei System.Reflection.Emit.AssemblyBuilderData.GetInMemoryAssemblyModule()
		   bei System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evide
		nce evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, St
		ackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes)
		   bei System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
		   bei Python.Runtime.CodeGenerator..cctor()
		   --- Ende der internen Ausnahmestapelüberwachung ---
		   bei Python.Runtime.DelegateManager.GetDispatcher(Type dtype)
		   bei Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr callable)
		   bei Python.Runtime.EventObject.AddEventHandler(IntPtr target, IntPtr handler)
		   bei Python.Runtime.EventBinding.nb_inplace_add(IntPtr ob, IntPtr arg)
		   bei Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
		   bei Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw)
		   bei Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
		   bei Python.Runtime.PythonConsole.Main(String[] args)

________________________________

		Von: Craig Farrow [mailto:craig_farrow at sil.org]
		Gesendet: Di 30.09.2008 14:53
		An: Dirk Krause
		Cc: pythondotnet at python.org
		Betreff: Re: [Python.NET] error messages
		
		
		Try the UCS2 directory.
		
		Craig.
		
		9/30/2008 5:54 PM dï, Dirk Krause pisdimis: 

			Hi,
			 
			I get the following error message when trying to run the python.exe from python2.5-UCS4 (I have a fully installed Python 2.5), any ideas? Vista professional here.
			 
			 
			... unfortunately in german:
			"""
			Unbehandelte Ausnahme: System.IO.FileLoadException: Die Datei oder Assembly Python.Runtime, Version=0.0.0.0, Culture=neu
			tral, PublicKeyToken=null oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assemb
			ly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
			Dateiname: Python.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
			   bei Python.Runtime.Runtime.PyUnicode_FromUnicode(String s, Int32 size)
			   bei Python.Runtime.Runtime.Initialize()
			   bei Python.Runtime.PythonEngine.Initialize()
			   bei Python.Runtime.PythonConsole.Main(String[] args)
			"""
			 
			Thanks,
			  Dirk
			
________________________________


			_________________________________________________
			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/20081001/65e07fb1/attachment.htm>


More information about the PythonDotNet mailing list