From michael_sweeney at agilent.com Tue Oct 5 00:37:26 2004 From: michael_sweeney at agilent.com (michael_sweeney@agilent.com) Date: Tue Oct 5 00:37:30 2004 Subject: [Python.NET] Python, the CLR and System.Security? Message-ID: <5A3BA3A972B8794F9599917CD047118A204176@wcosmb07.cos.agilent.com> Hi, I am trying to integrate NUnit with our current automated test tool. I copied the two PythonNet dlls, Python.Runtime.dll and CLR.dll, into the ActiveState Python 2.3 directory. When I try to run my wrapper module, ATFAdaptor.cs, which is a stripped down/modified version of the ConsoleUi.cs file, I receive the following CLR Exception: ex.Message: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. ex.Stacktrace: Server stack trace: at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccess Permission demand, PermissionToken permToken) at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlM ark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) at System.Security.CodeAccessPermission.Demand() at System.IO.Directory.GetCurrentDirectory() at System.Environment.get_CurrentDirectory() at NUnit.Core.TestSuiteBuilder.Load(String assemblyName) at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, Int32 assemblyKey) at NUnit.Core.TestSuiteBuilder.Build(String assemblyName) at NUnit.Core.RemoteTestRunner.Load(String assemblyName) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage (MethodBase mb, Object[] args, Object serv er, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IM essage msg, Int32 methodPtr, Boolean fExec uteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NUnit.Core.TestRunner.Load(String assemblyName) at NUnit.Util.TestDomain.Load(String assemblyFileName, String testFixture) at NUnit.Util.TestDomain.Load(NUnitProject project, String testFixture) at NUnit.ATF.ATFAdaptor.Run() in c:\documents and settings\sweeneym\my documents\visual studio projects\nunit-2.2.0\a tf2nunitadaptor\atfadaptor.cs:line 277 It looks like the regular CPython version has some sort of permission problems interacting between managed code and python. Is this something I can work around, or fix? Also, if I run the wrapper module with the PythonNET version of the python.exe, the wrapper can execute the NUnit test, but hangs afterwards. Thanks in advance... Mike From brian at zope.com Tue Oct 5 19:25:31 2004 From: brian at zope.com (Brian Lloyd) Date: Tue Oct 5 19:25:37 2004 Subject: [Python.NET] Python, the CLR and System.Security? In-Reply-To: <5A3BA3A972B8794F9599917CD047118A204176@wcosmb07.cos.agilent.com> Message-ID: Hi Michael - I know embarassingly little about the gory details of CAS, but I suspect that you may need to do some configuration to grant rights to the Python.Runtime assembly (generally you may as well grant it full trust, since all Python code generally runs under the radar of the .NET security system...) HTH, Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com > -----Original Message----- > From: pythondotnet-bounces@python.org > [mailto:pythondotnet-bounces@python.org]On Behalf Of > michael_sweeney@agilent.com > Sent: Monday, October 04, 2004 5:37 PM > To: pythondotnet@python.org > Subject: [Python.NET] Python, the CLR and System.Security? > > > > Hi, > > I am trying to integrate NUnit with our current automated test tool. > > I copied the two PythonNet dlls, Python.Runtime.dll and CLR.dll, into > the ActiveState Python 2.3 directory. > > When I try to run my wrapper module, ATFAdaptor.cs, which is a stripped > down/modified version of the ConsoleUi.cs file, I receive the following > CLR Exception: > > > ex.Message: > > Request for the permission of type > System.Security.Permissions.FileIOPermission, mscorlib, > Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 > failed. > > ex.Stacktrace: > > Server stack trace: > at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet > grantedSet, PermissionSet deniedSet, CodeAccess > Permission demand, PermissionToken permToken) > at System.Security.CodeAccessSecurityEngine.Check(PermissionToken > permToken, CodeAccessPermission demand, StackCrawlM > ark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) > at > System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, > StackCrawlMark& stackMark) > at System.Security.CodeAccessPermission.Demand() > at System.IO.Directory.GetCurrentDirectory() > at System.Environment.get_CurrentDirectory() > at NUnit.Core.TestSuiteBuilder.Load(String assemblyName) > at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, Int32 > assemblyKey) > at NUnit.Core.TestSuiteBuilder.Build(String assemblyName) > at NUnit.Core.RemoteTestRunner.Load(String assemblyName) > at > System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage > (MethodBase mb, Object[] args, Object serv > er, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) > at > System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IM > essage msg, Int32 methodPtr, Boolean fExec > uteInContext) > > Exception rethrown at [0]: > at > System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage > reqMsg, IMessage retMsg) > at > System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& > msgData, Int32 type) > at NUnit.Core.TestRunner.Load(String assemblyName) > at NUnit.Util.TestDomain.Load(String assemblyFileName, String > testFixture) > at NUnit.Util.TestDomain.Load(NUnitProject project, String > testFixture) > at NUnit.ATF.ATFAdaptor.Run() in c:\documents and > settings\sweeneym\my documents\visual studio projects\nunit-2.2.0\a > tf2nunitadaptor\atfadaptor.cs:line 277 > > It looks like the regular CPython version has some sort of permission > problems interacting between managed code and python. > > Is this something I can work around, or fix? > > Also, if I run the wrapper module with the PythonNET version of the > python.exe, the wrapper can execute the NUnit test, but hangs > afterwards. > > > Thanks in advance... > > Mike > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From doubleo7 at gmail.com Thu Oct 7 15:41:21 2004 From: doubleo7 at gmail.com (007 cheng) Date: Thu Oct 7 15:46:52 2004 Subject: [Python.NET] Use Python .NET with existing Python installation Message-ID: Dear Sir, according to the Readme.txt ---------------------------------------------------------------------------- **Can I use it with my existing Python installation?** Yes, at least on win32 systems. Just copy the files Python.Runtime.dll and CLR.dll from the PythonNet directory to the root directory of your python installation. ---------------------------------------------------------------------------- I follow the instaructio to copy the DLLs to my Python 2.3.3 installation directory. But cannot import CLR. ------------------------------------------------------------------------------------------------------ C:\Python23>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from CLR.System import String Traceback (most recent call last): File "", line 1, in ? ImportError: No module named System >>> ------------------------------------------------------------------------------------------------------ What did I miss? From thane at magna-capital.com Thu Oct 7 18:28:31 2004 From: thane at magna-capital.com (Thane) Date: Thu Oct 7 18:28:44 2004 Subject: [Python.NET] Use Python .NET with existing Python installation In-Reply-To: Message-ID: Cheng, This is usually due to a loading delay for the CLR (there are other posts previously that discuss this). The simple solution is to just try to import it again, and if Python can see the DLLs, the import will work (see output below). On my system I have Python.Runtime.dll and Python.Runtime.key in my Python root directory, and CLR.dll in my DLLs directory. Alternatively, you could just copy the Python.exe from the PythonNet distribution into your root directory, and this will solve the problem. See the second listing below where I have called this 'Python-CLR.exe'. Hope this helps, --Thane C:\Documents and Settings\thane.TIGER>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from CLR.System import String getattr: proxy getattr: dict getattr: __path__ Traceback (most recent call last): File "", line 1, in ? ImportError: No module named System >>> from CLR.System import String >>> String >>> ^Z C:\Documents and Settings\thane.TIGER>python-CLR Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from CLR.System import String >>> String >>> > -----Original Message----- > From: pythondotnet-bounces@python.org [mailto:pythondotnet- > bounces@python.org] On Behalf Of 007 cheng > Sent: Thursday, October 07, 2004 6:41 AM > To: pythondotnet@python.org > Subject: [Python.NET] Use Python .NET with existing Python installation > > Dear Sir, > > according to the Readme.txt > -------------------------------------------------------------------------- > -- > **Can I use it with my existing Python installation?** > > Yes, at least on win32 systems. Just copy the files Python.Runtime.dll > and CLR.dll from the PythonNet directory to the root directory of your > python installation. > -------------------------------------------------------------------------- > -- > I follow the instaructio to copy the DLLs to my Python 2.3.3 > installation directory. > But cannot import CLR. > -------------------------------------------------------------------------- > ---------------------------- > C:\Python23>python > Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> from CLR.System import String > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named System > >>> > -------------------------------------------------------------------------- > ---------------------------- > > What did I miss? > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From srijit at yahoo.com Wed Oct 20 14:11:53 2004 From: srijit at yahoo.com (Srijit Kumar Bhadra) Date: Thu Oct 21 15:17:49 2004 Subject: [Python.NET] Request for current status Message-ID: <20041020121153.1131.qmail@web60003.mail.yahoo.com> Hello, Pythondotnet is a nice library. I am interested to know the roadmap of this library and and whether any new version is going to be released in near future. For example it will be nice if the following issue in Pythondotnet is resolved. "Python classes can't yet implement interfaces or abstract classes." Best Regards, /Srijit __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From brian at zope.com Thu Oct 21 16:22:36 2004 From: brian at zope.com (Brian Lloyd) Date: Thu Oct 21 16:23:36 2004 Subject: [Python.NET] RE: Request for current status In-Reply-To: <20041020121153.1131.qmail@web60003.mail.yahoo.com> Message-ID: > Hello, > Pythondotnet is a nice library. > I am interested to know the roadmap of this library and and whether any > new version is going to be released in near future. > For example it will be nice if the following issue in Pythondotnet is > resolved. > "Python classes can't yet implement interfaces or abstract classes." > > Best Regards, > /Srijit Hi Srijit, There is no roadmap per se. There probably won't be a significant new version (esp. dealing with implementing interfaces and abstract classes) in the very near future, partly because I'm too time-constrained and partly because it looks likely that IronPython might be a better solution for that kind of thing in the end. Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From roman.yakovenko at actimize.com Thu Oct 21 17:36:03 2004 From: roman.yakovenko at actimize.com (Roman Yakovenko) Date: Thu Oct 21 17:33:03 2004 Subject: [Python.NET] RE: Request for current status Message-ID: Brian Lloyd wrote: > > There is no roadmap per se. There probably won't be a significant > new version (esp. dealing with implementing interfaces and > abstract classes) in the very near future, partly because I'm > too time-constrained and partly because it looks likely that > IronPython might be a better solution for that kind of thing > in the end. Hi. Will PythonNet be upgraded to python 2.4? Roman > > Brian Lloyd brian@zope.com > V.P. Engineering 540.361.1716 > Zope Corporation http://www.zope.com > > > _________________________________________________ > Python.NET mailing list - PythonDotNet@python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From brian at zope.com Thu Oct 21 18:50:27 2004 From: brian at zope.com (Brian Lloyd) Date: Thu Oct 21 18:51:06 2004 Subject: [Python.NET] RE: Request for current status In-Reply-To: Message-ID: > > Hi. Will PythonNet be upgraded to python 2.4? > > Roman Thats probably doable. I havent been able to track 2.4 closely, but I'm hopeful that no big changes were made that would make this complicated. Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From roman.yakovenko at actimize.com Thu Oct 21 21:17:12 2004 From: roman.yakovenko at actimize.com (Roman Yakovenko) Date: Thu Oct 21 21:14:15 2004 Subject: [Python.NET] RE: Request for current status Message-ID: > -----Original Message----- > From: Brian Lloyd [mailto:brian@zope.com] > Sent: Thursday, October 21, 2004 6:50 PM > To: Roman Yakovenko; pythondotnet@python.org > Subject: RE: [Python.NET] RE: Request for current status > > > > > > Hi. Will PythonNet be upgraded to python 2.4? > > > > Roman > > Thats probably doable. I havent been able to track 2.4 closely, but > I'm hopeful that no big changes were made that would make this > complicated. Well, I'll try to do it. I have complex environment of unittest for client/server application. So it seems to me that in a near future I will have to compile Python.Net by myself. I don't need new futures, I am very happy with what I have right now. All I want is to migrate to Python 2.4 Roman > > Brian Lloyd brian@zope.com > V.P. Engineering 540.361.1716 > Zope Corporation http://www.zope.com > > > From brian at zope.com Thu Oct 21 21:50:54 2004 From: brian at zope.com (Brian Lloyd) Date: Thu Oct 21 21:51:35 2004 Subject: [Python.NET] RE: Request for current status In-Reply-To: Message-ID: > Well, I'll try to do it. > I have complex environment of unittest for client/server application. > So it seems to me that in a near future I will have to compile > Python.Net by myself. > I don't need new futures, I am very happy with what I have right now. > All I want is to migrate to Python 2.4 > > Roman We're in luck ;) I just tried it, and all the tests pass under 2.4 b1 (there is a deprecation warning, but thats harmless). To recompile for 2.4, you just have to visit the file src/runtime/Runtime.cs and do a search-and-replace of 'python23' to 'python24' and then run make. Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From roman.yakovenko at actimize.com Thu Oct 21 22:04:58 2004 From: roman.yakovenko at actimize.com (Roman Yakovenko) Date: Thu Oct 21 22:01:58 2004 Subject: [Python.NET] RE: Request for current status Message-ID: > -----Original Message----- > From: Brian Lloyd [mailto:brian@zope.com] > Sent: Thursday, October 21, 2004 9:51 PM > To: Roman Yakovenko; pythondotnet@python.org > Subject: RE: [Python.NET] RE: Request for current status > > > > Well, I'll try to do it. > > I have complex environment of unittest for client/server > application. > > So it seems to me that in a near future I will have to compile > > Python.Net by myself. > > I don't need new futures, I am very happy with what I have > right now. > > All I want is to migrate to Python 2.4 > > > > Roman > > We're in luck ;) I just tried it, and all the tests pass > under 2.4 b1 (there > is a deprecation > warning, but thats harmless). > > To recompile for 2.4, you just have to visit the file > src/runtime/Runtime.cs > and > do a search-and-replace of 'python23' to 'python24' and then run make. That is really good news. After python 2.4 will be released I will switch to PythonNet-1.0-beta4, built from CVS. Thank you. I think that right now you told me very important information. Could you write it down in your readme.txt file, in CVS? Roman > > Brian Lloyd brian@zope.com > V.P. Engineering 540.361.1716 > Zope Corporation http://www.zope.com > > >