From dan.eloff at gmail.com Mon Sep 1 01:09:01 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 31 Aug 2008 18:09:01 -0500 Subject: [IronPython] A new application in ipy In-Reply-To: References: Message-ID: <4817b6fc0808311609t1589323fx80e0e8b8f93dbdd0@mail.gmail.com> I made something along these lines a long time ago with C# and access (yuck!), cephire, you may find the following function useful. I used it to detect when I had walked away from the computer. http://dataerror.blogspot.com/2005/02/detect-windows-idle-time.html I think the test I used is if the time since last input is > update interval, then I would skip the update and record the current time - last input time as the start of when I left the computer. -Dan On Sun, Aug 31, 2008 at 11:35 AM, Michael Stephens wrote: > That is pretty cool. Does it have support for abandoning my computer > to do something else. Or will it keep logging that time towards that > app? > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > > On Sun, Aug 31, 2008 at 9:23 AM, cephire wrote: >> All: >> I got my first IronPython application working. This is a simple >> application I wrote to help myself track time that I spend in various >> application. >> >> If you're interested download the package from: >> http://mysecs.googlecode.com/files/mySecs_0.1.zip >> Extract the files to a directory and execute mysecs.exe. It will start >> to capture time details (every 5 seconds). One can refersh and also >> download details into a csv file. >> >> Source is found in: http://code.google.com/p/mysecs/source/browse/ >> >> I use Visual Studio Integration (http://www.izume.com/2007/10/13/ >> integrating-ironpython-with-visual-studio-2005) >> >> Feel free to comment on the code, design. If there is a better way of >> doing things, please let me know. >> >> Thank you, >> Joseph >> http://www.jjude.com | http://twitter.com/jjude >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From desleo at gmail.com Mon Sep 1 07:58:38 2008 From: desleo at gmail.com (Leo Carbajal) Date: Mon, 1 Sep 2008 00:58:38 -0500 Subject: [IronPython] Re strict imports In-Reply-To: <48B2F26A.2040501@voidspace.org.uk> References: <19113682.post@talk.nabble.com> <8cd017b80808230414n3dc76c6arcebe5cc66d924b1d@mail.gmail.com> <3140.92.83.147.51.1219494769.squirrel@mail2.webfaction.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> Message-ID: I hate bringing this issue up over and over again, but anyway, I'd rather re-use one of these conversations. This CAS stuff is really driving me nuts, moreso because it makes me feel dumber than a door nail to not understand what's going on. I've got IPY 2.0 loading into a 'sandboxed' domain, and it can run basic python calculations and stuff like print just fine, the moment I try to have it interact with an object I pass in through globals though I get a permission error where (it looks like to me) the act is asking for nothing less than completely unrestricted access. Here's the error: Unhandled Exception: System.Security.SecurityException: Request failed. at _stub_$6##6(Closure , CallSite , Object , CodeContext ) at _stub_MatchCaller(Object , CallSite , Object[] ) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at B:\Code\IronPythonShell\IronPythonShell\bin\Debug\script2.py$1##1(Closure, Scope , LanguageContext ) at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at IronPythonShell.Program.Main(String[] args) in B:\Code\IronPythonShell\Iro nPythonShell\Program.cs:line 49 The action that failed was: Demand The type of the first permission that failed was: System.Security.PermissionSet The demand was for: The granted set of the failing assembly was: *The code looks like this:* Item item = new Item("Monkey"); item.Value = 10; item.Type = ItemType.Misc; PermissionSet pset = new PermissionSet(PermissionState.None); pset.AddPermission(new SecurityPermission(PermissionState.Unrestricted)); pset.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); pset.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, AppDomain.CurrentDomain.BaseDirectory)); AppDomainSetup domainSetup = new AppDomainSetup(); domainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; // create the sandboxed domain AppDomain sandbox = AppDomain.CreateDomain( "Sandboxed Domain", AppDomain.CurrentDomain.Evidence, domainSetup, pset, CreateStrongName(Assembly.GetExecutingAssembly()), CreateStrongName(Assembly.GetAssembly(typeof(ScriptRuntime))), CreateStrongName(Assembly.GetAssembly(typeof(System.Scripting.ScriptCode)))); ScriptRuntime runtime = ScriptRuntime.Create(sandbox); runtime.Globals.SetVariable("Artifact", new ScriptableItem(item)); runtime.ExecuteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "script2.py")); *Script2.py:* import Artifact i = 200 while i > 0: i = i - 1 print "Done in the second verse. Yes?" print Artifact.Name Item and ScriptableItem are simple classes with only those two properties, ScriptableItem inherits from MarshalByRefObject. The idea is that Item will eventually be a very powerful class and ScriptableItem is a wrapper around it to only provide access to certain portions of the class (IPY 1.1 didn't do so well with obeying interfaces). I tried using [EnvironmentPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)] on both of those classes, but it didn't work. CreateStrongName is a method I pulled from this post: http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx The way I understand it, Microsoft.Scripting, Microsoft.Scripting.Core and my own assembly should be given full trust when the sandbox domain is first created so I'm at a complete loss. This code works fine, of course, if I don't create the runtime in the domain. A little light, or some more reference material, would be very helpful =\ --- LC On Mon, Aug 25, 2008 at 12:56 PM, Michael Foord wrote: > Dody Gunawinata wrote: > >> Ah, my knowledge is out of date then. >> >> I think the more apt thread is here >> http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-June/007523.html >> >> > Yep - Dino confirming that sandboxing is one of the intended uses of > IronPython and that it should work (and a link to a blog entry about why > some sandboxing problems are very difficult - particularly server > applications where you need to protect against DoS through CPU and memory > over use). > > Michael > -------------- next part -------------- An HTML attachment was scrubbed... URL: From id804097 at gmail.com Mon Sep 1 16:17:29 2008 From: id804097 at gmail.com (cephire) Date: Mon, 1 Sep 2008 07:17:29 -0700 (PDT) Subject: [IronPython] A new application in ipy In-Reply-To: <4817b6fc0808311609t1589323fx80e0e8b8f93dbdd0@mail.gmail.com> References: <4817b6fc0808311609t1589323fx80e0e8b8f93dbdd0@mail.gmail.com> Message-ID: <5c2995d7-3157-418a-9094-d35deed23a9e@r15g2000prd.googlegroups.com> I poll the active window every 5 seconds and if it is the same then I increment the time spent on it. I am assuming here, of course, that if someone steps out of the machine there is either screensaver is on or it is locked. When any one of these two are true, there is no activewindow. As I continue to use (and probably get some feedback from others too), I will continue to enhance the application. Thank you for your interest Joseph On Sep 1, 4:09?am, "Dan Eloff" wrote: > I made something along these lines a long time ago with C# and access > (yuck!), cephire, you may find the following function useful. I used > it to detect when I had walked away from the computer. > > http://dataerror.blogspot.com/2005/02/detect-windows-idle-time.html > > I think the test I used is if the time since last input is > update > interval, then I would skip the update and record the current time - > last input time as the start of when I left the computer. > > -Dan > > > > > > On Sun, Aug 31, 2008 at 11:35 AM, Michael Stephens wrote: > > That is pretty cool. ?Does it have support for abandoning my computer > > to do something else. ?Or will it keep logging that time towards that > > app? > > Michael Stephens > > > Electrical Engineering Graduate Student > > University of Wyoming > > fal... at uwyo.edu or 89i... at gmail.com > > > On Sun, Aug 31, 2008 at 9:23 AM, cephire wrote: > >> All: > >> I got my first IronPython application working. This is a simple > >> application I wrote to help myself track time that I spend in various > >> application. > > >> If you're interested download the package from: > >>http://mysecs.googlecode.com/files/mySecs_0.1.zip > >> Extract the files to a directory and execute mysecs.exe. It will start > >> to capture time details (every 5 seconds). One can refersh and also > >> download details into a csv file. > > >> Source is found in:http://code.google.com/p/mysecs/source/browse/ > > >> I use Visual Studio Integration (http://www.izume.com/2007/10/13/ > >> integrating-ironpython-with-visual-studio-2005) > > >> Feel free to comment on the code, design. If there is a better way of > >> doing things, please let me know. > > >> Thank you, > >> Joseph > >>http://www.jjude.com|http://twitter.com/jjude > >> _______________________________________________ > >> Users mailing list > >> Us... at lists.ironpython.com > >>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- Hide quoted text - > > - Show quoted text - From id804097 at gmail.com Mon Sep 1 16:24:18 2008 From: id804097 at gmail.com (cephire) Date: Mon, 1 Sep 2008 07:24:18 -0700 (PDT) Subject: [IronPython] Application stays in memory even after exit Message-ID: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> Hi all, I've found out that the application is still in memory even after closing the application. I exit the application with Application.Exit(). What should I do to remove the application completely? Thank you, Joseph From fuzzyman at voidspace.org.uk Mon Sep 1 22:36:54 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 01 Sep 2008 21:36:54 +0100 Subject: [IronPython] Application stays in memory even after exit In-Reply-To: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> References: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> Message-ID: <48BC5266.7040800@voidspace.org.uk> cephire wrote: > Hi all, > I've found out that the application is still in memory even after > closing the application. I exit the application with > Application.Exit(). > > What should I do to remove the application completely? > Which version of IronPython are you using? Have you deleted all references to the form (I assume it is a Windows Forms application)? Michael > Thank you, > Joseph > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From hellosticky at gmail.com Tue Sep 2 07:19:09 2008 From: hellosticky at gmail.com (KE) Date: Tue, 2 Sep 2008 01:19:09 -0400 Subject: [IronPython] Specified language provider type is not registered. Message-ID: <48bcccf5.1d3e400a.7af1.4c7f@mx.google.com> Hi, I've compiled IronPython from the latest source code, and added some strong name keys to run in a partial trust AppDomain, but I can't quite get the ScriptEngine created: System.ArgumentException: Unknown language name: 'py' at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String languageName) at mycode The code creating this is: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); ScriptRuntime runtime = new ScriptRuntime(setup); setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); runtime.LoadAssembly(assembly); runtime.IO.SetOutput(ms, writer); ScriptEngine engine = runtime.GetEngine("py"); ScriptScope scope = engine.CreateScope(); I would prefer to do this programmatically, without any external .config files, if possible. Thanks! From curt at hagenlocher.org Tue Sep 2 07:26:15 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 1 Sep 2008 22:26:15 -0700 Subject: [IronPython] Specified language provider type is not registered. In-Reply-To: <48bcccf5.1d3e400a.7af1.4c7f@mx.google.com> References: <48bcccf5.1d3e400a.7af1.4c7f@mx.google.com> Message-ID: Get the ScriptEngine directly from IronPython.Hosting.Python instead of going through the runtime. On Mon, Sep 1, 2008 at 10:19 PM, KE wrote: > Hi, I've compiled IronPython from the latest source code, and added some > strong name keys to run in a partial trust AppDomain, but I can't quite get > the ScriptEngine created: > > System.ArgumentException: Unknown language name: 'py' > at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String > languageName) > at mycode > > The code creating this is: > > ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); > ScriptRuntime runtime = new ScriptRuntime(setup); > setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); > runtime.LoadAssembly(assembly); > runtime.IO.SetOutput(ms, writer); > ScriptEngine engine = runtime.GetEngine("py"); > ScriptScope scope = engine.CreateScope(); > > > I would prefer to do this programmatically, without any external .config > files, if possible. > Thanks! > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From id804097 at gmail.com Tue Sep 2 17:49:00 2008 From: id804097 at gmail.com (cephire) Date: Tue, 2 Sep 2008 08:49:00 -0700 (PDT) Subject: [IronPython] Application stays in memory even after exit In-Reply-To: <48BC5266.7040800@voidspace.org.uk> References: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> <48BC5266.7040800@voidspace.org.uk> Message-ID: Hi: If you mean am I closing all the forms, yes. Here is the code snippet of both program.py and the form's exit menu item. Please note that I also tried self.Close and still it didn't exit from the memory. Thank you for your time. Program.py ========= class mysecs10: # namespace @staticmethod def RealEntryPoint(): Application.EnableVisualStyles() Application.Run(mysecs20.MainForm()) if __name__ == "Program": mysecs10.RealEntryPoint(); mainform. exit =========== @accepts(Self(), System.Object, System.EventArgs) @returns(None) def _exitToolStripMenuItem_Click(self, sender, e): Application.Exit() On Sep 2, 1:36?am, Michael Foord wrote: > cephire wrote: > > Hi all, > > I've found out that the application is still in memory even after > > closing the application. I exit the application with > > Application.Exit(). > > > What should I do to remove the application completely? > > Which version of IronPython are you using? > > Have you deleted all references to the form (I assume it is a Windows > Forms application)? > > Michael > > > Thank you, > > Joseph > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.theotherdelia.co.uk/http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Tomas.Matousek at microsoft.com Tue Sep 2 18:25:05 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 2 Sep 2008 09:25:05 -0700 Subject: [IronPython] Specified language provider type is not registered. In-Reply-To: References: <48bcccf5.1d3e400a.7af1.4c7f@mx.google.com> Message-ID: The problem in your code is that you update "setup" variable after it is passed to ScriptRuntime. You need to first initialize the setup and then pass it to runtime ctor (the ctor uses the setup object to create and configure DLR and once that done no changes are possible). setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); ScriptRuntime runtime = new ScriptRuntime(setup); Does this work? Tomas From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, September 01, 2008 10:26 PM To: hellosticky at gmail.com; Discussion of IronPython Subject: Re: [IronPython] Specified language provider type is not registered. Get the ScriptEngine directly from IronPython.Hosting.Python instead of going through the runtime. On Mon, Sep 1, 2008 at 10:19 PM, KE > wrote: Hi, I've compiled IronPython from the latest source code, and added some strong name keys to run in a partial trust AppDomain, but I can't quite get the ScriptEngine created: System.ArgumentException: Unknown language name: 'py' at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String languageName) at mycode The code creating this is: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); ScriptRuntime runtime = new ScriptRuntime(setup); setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); runtime.LoadAssembly(assembly); runtime.IO.SetOutput(ms, writer); ScriptEngine engine = runtime.GetEngine("py"); ScriptScope scope = engine.CreateScope(); I would prefer to do this programmatically, without any external .config files, if possible. Thanks! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Tue Sep 2 18:28:24 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 2 Sep 2008 11:28:24 -0500 Subject: [IronPython] Application stays in memory even after exit In-Reply-To: References: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> <48BC5266.7040800@voidspace.org.uk> Message-ID: <4817b6fc0809020928s3dbaaff4n1dfdd6a130470975@mail.gmail.com> Do you use threads? Any running non-daemon python thread will prevent the application from exiting. Threads in python are non-daemon by default. I don't know what the rules are for .NET threads. -Dan On Tue, Sep 2, 2008 at 10:49 AM, cephire wrote: > Hi: > If you mean am I closing all the forms, yes. Here is the code snippet > of both program.py and the form's exit menu item. > Please note that I also tried self.Close and still it didn't exit from > the memory. Thank you for your time. > > > > Program.py > ========= > > class mysecs10: # namespace > > @staticmethod > def RealEntryPoint(): > > Application.EnableVisualStyles() > Application.Run(mysecs20.MainForm()) > > if __name__ == "Program": > mysecs10.RealEntryPoint(); > > > mainform. exit > =========== > > @accepts(Self(), System.Object, System.EventArgs) > @returns(None) > def _exitToolStripMenuItem_Click(self, sender, e): > Application.Exit() > > > > On Sep 2, 1:36 am, Michael Foord wrote: >> cephire wrote: >> > Hi all, >> > I've found out that the application is still in memory even after >> > closing the application. I exit the application with >> > Application.Exit(). >> >> > What should I do to remove the application completely? >> >> Which version of IronPython are you using? >> >> Have you deleted all references to the form (I assume it is a Windows >> Forms application)? >> >> Michael >> >> > Thank you, >> > Joseph >> > _______________________________________________ >> > Users mailing list >> > Us... at lists.ironpython.com >> >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.theotherdelia.co.uk/http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Tue Sep 2 18:44:19 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 02 Sep 2008 17:44:19 +0100 Subject: [IronPython] Application stays in memory even after exit In-Reply-To: References: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> <48BC5266.7040800@voidspace.org.uk> Message-ID: <48BD6D63.6090300@voidspace.org.uk> cephire wrote: > Hi: > If you mean am I closing all the forms, yes. Here is the code snippet > of both program.py and the form's exit menu item. > Please note that I also tried self.Close and still it didn't exit from > the memory. Thank you for your time. > I asked if you had *deleted references* to your forms - not if you had closed them. Does the process terminate when your form is closed? As far as I can see it should... If so how are you judging that it has not freed memory? (Are you running it from the interactive interpreter?) Michael > > > Program.py > ========= > > class mysecs10: # namespace > > @staticmethod > def RealEntryPoint(): > > Application.EnableVisualStyles() > Application.Run(mysecs20.MainForm()) > > if __name__ == "Program": > mysecs10.RealEntryPoint(); > > > mainform. exit > =========== > > @accepts(Self(), System.Object, System.EventArgs) > @returns(None) > def _exitToolStripMenuItem_Click(self, sender, e): > Application.Exit() > > > > On Sep 2, 1:36 am, Michael Foord wrote: > >> cephire wrote: >> >>> Hi all, >>> I've found out that the application is still in memory even after >>> closing the application. I exit the application with >>> Application.Exit(). >>> >>> What should I do to remove the application completely? >>> >> Which version of IronPython are you using? >> >> Have you deleted all references to the form (I assume it is a Windows >> Forms application)? >> >> Michael >> >> >>> Thank you, >>> Joseph >>> _______________________________________________ >>> Users mailing list >>> Us... at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >> --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.theotherdelia.co.uk/http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Tue Sep 2 19:13:22 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 02 Sep 2008 18:13:22 +0100 Subject: [IronPython] Users Digest, Vol 49, Issue 80 In-Reply-To: References: Message-ID: <48BD7432.30508@voidspace.org.uk> Vadim Khaskel wrote: > Thanks alot Michael for info... > > It still seems strange to me that this .exe works from Debug directory > on the machine where it was developed, but not on another machine. > As you are replying to a 'digest' I can't see which email you are replying to. If I recall correctly it worked on your machine because you have the standard library modules you use - which presumably aren't on the second machine (and so the imports fail). Michael Foord > V. > > > From: users-request at lists.ironpython.com > > Subject: Users Digest, Vol 49, Issue 80 > > To: users at lists.ironpython.com > > Date: Mon, 25 Aug 2008 15:35:06 -0700 > > > > Send Users mailing list submissions to > > users at lists.ironpython.com > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > or, via email, send a message with subject or body 'help' to > > users-request at lists.ironpython.com > > > > You can reach the person managing the list at > > users-owner at lists.ironpython.com > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Users digest..." > > > > > > Today's Topics: > > > > 1. Re: Users Digest, Vol 49, Issue 74 (3. Re: trying to run .exe > > on another computer (Michael Foord) > > 2. Re: Users Digest, Vol 49, Issue 74 (3. Re: trying to run .exe > > on another computer (Srivatsn Narayanan) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 25 Aug 2008 23:31:45 +0100 > > From: Michael Foord > > Subject: Re: [IronPython] Users Digest, Vol 49, Issue 74 (3. Re: > > trying to run .exe on another computer > > To: Discussion of IronPython > > Message-ID: <48B332D1.9010401 at voidspace.org.uk> > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > Seshadri Pillailokam Vijayaraghavan wrote: > > > > > > In the current context, I think invoking the exe from a command > prompt > > > would be good enough to see any startup error messages. > > > > > > BTW, apart from the 2 dlls you have mentioned, you most probably need > > > Microsoft.Scripting.dll, Microsoft.Scripting.Core.dll and > > > IronPython.Modules.dll in the same folder for things to work. > > > > > > > > > > > > > As he is using IronPython Studio it will compile his app with > IronPython > > 1 and not IronPython 2 (so he doesn't need the assemblies you mention > > above). > > > > Additionally, the Python code generated by IronPython Studio will not > > work on its own - so he can't just recompile against IronPython 2 with > > the Pyc sample. > > > > Unfortunately the guys who created IronPython Studio don't seem to > > respond to questions (releasing it seems to have been a 'fire and > > forget' exercise - or at least that is the way it appeared). > > > > There is probably a command switch in the project properties that > can be > > used to change it from a Windows app to a console app - but I would > have > > to install it to find out. > > > > Michael > > > > > Thanks > > > > > > sesh > > > > > > > > > > > > *From:* users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Vadim > Khaskel > > > *Sent:* Monday, August 25, 2008 2:36 PM > > > *To:* users at lists.ironpython.com > > > *Subject:* Re: [IronPython] Users Digest, Vol 49, Issue 74 (3. Re: > > > trying to run .exe on another computer (Michael Foord)) > > > > > > > > > > > > I would appreciate if somebody can tell me how to compie windows > > > app as a console application > > > > > > thanks, > > > > > > V. > > > > > > > From: users-request at lists.ironpython.com > > > > Subject: Users Digest, Vol 49, Issue 74 > > > > To: users at lists.ironpython.com > > > > Date: Mon, 25 Aug 2008 11:03:21 -0700 > > > > > > > > Send Users mailing list submissions to > > > > users at lists.ironpython.com > > > > > > > > To subscribe or unsubscribe via the World Wide Web, visit > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > or, via email, send a message with subject or body 'help' to > > > > users-request at lists.ironpython.com > > > > > > > > You can reach the person managing the list at > > > > users-owner at lists.ironpython.com > > > > > > > > When replying, please edit your Subject line so it is more specific > > > > than "Re: Contents of Users digest..." > > > > > > > > > > > > Today's Topics: > > > > > > > > 1. Re: _scriptEngine.Shutdown ( ) (Curt Hagenlocher) > > > > 2. trying to run .exe on another computer (Vadim Khaskel) > > > > 3. Re: trying to run .exe on another computer (Michael Foord) > > > > 4. Re: Re strict imports (Michael Foord) > > > > 5. Re: CodeContext (Tomas Matousek) > > > > > > > > > > > > > ---------------------------------------------------------------------- > > > > > > > > Message: 1 > > > > Date: Mon, 25 Aug 2008 09:47:23 -0700 > > > > From: "Curt Hagenlocher" > > > > Subject: Re: [IronPython] _scriptEngine.Shutdown ( ) > > > > To: "Discussion of IronPython" > > > > Message-ID: > > > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > > > I don't have an answer for you yet, but I am following up on this > > > > internally. > > > > > > > > On Sun, Aug 24, 2008 at 12:27 PM, Huzaifa > wrote: > > > > > > > > > > > > > > right but it is not available in the latest code for ipy 2.0. > > > > > > > > > > > > > > > > > > > > Curt Hagenlocher wrote: > > > > > > > > > > > > I'm afraid I don't quite see the question in there :). > > > > > > > > > > > > The purpose of ScriptEngine.Shutdown is to support > functionality like > > > > > > Python's sys.exitfunc. > > > > > > > > > > > > On Sat, Aug 23, 2008 at 8:44 PM, Huzaifa > > > > wrote: > > > > > > > > > > > >> > > > > > >> scriptEngine.Shutdown ( ) > > > > > >> > > > > > >> Is this method replaced ,if yes then with without. > > > > > >> > > > > > >> -- > > > > > >> View this message in context: > > > > > >> > > > > > > > > > http://www.nabble.com/_scriptEngine.Shutdown-%28-%29-tp19127524p19127524.html > > > > > >> Sent from the IronPython mailing list archive at Nabble.com. > > > > > >> > > > > > >> _______________________________________________ > > > > > >> Users mailing list > > > > > >> Users at lists.ironpython.com > > > > > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > >> > > > > > > > > > > > > _______________________________________________ > > > > > > Users mailing list > > > > > > Users at lists.ironpython.com > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > -- > > > > > View this message in context: > > > > > > > > > http://www.nabble.com/_scriptEngine.Shutdown-%28-%29-tp19127524p19133851.html > > > > > Sent from the IronPython mailing list archive at Nabble.com. > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 2 > > > > Date: Mon, 25 Aug 2008 17:23:47 +0000 > > > > From: Vadim Khaskel > > > > Subject: [IronPython] trying to run .exe on another computer > > > > To: > > > > Message-ID: > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > > > > > > > Hi all, > > > > > > > > I'm trying to run executive file (myapp.exe) of my application > found > > > in debug folder along with myapp.pdb, IronMath.dll, > IronPython.dll. So > > > I'm trying to run this .exe file on another PC. ...I can not do > that - > > > nothing happens, not even single error message pops up. Please advise. > > > > > > > > thanks a lot, > > > > > > > > Vadim > > > > _________________________________________________________________ > > > > Talk to your Yahoo! Friends via Windows Live Messenger. Find out > how. > > > > > http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008 > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 3 > > > > Date: Mon, 25 Aug 2008 18:28:39 +0100 > > > > From: Michael Foord > > > > Subject: Re: [IronPython] trying to run .exe on another computer > > > > To: Discussion of IronPython > > > > Message-ID: <48B2EBC7.9020003 at voidspace.org.uk> > > > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > > > > > Vadim Khaskel wrote: > > > > > Hi all, > > > > > > > > > > I'm trying to run executive file (myapp.exe) of my application > found > > > > > in debug folder along with myapp.pdb, IronMath.dll, > IronPython.dll. So > > > > > I'm trying to run this .exe file on another PC. ...I can not > do that - > > > > > nothing happens, not even single error message pops up. Please > advise. > > > > > > > > > > > > > How did you create myapp.exe? What happens if you run it from the > > > > command line? > > > > > > > > (If you created it from IronPython Studio and you still get > nothing from > > > > the command line - try compiling it as a console application > instead of > > > > a windows application and then rerunning.) > > > > > > > > Michael > > > > > > > > > thanks a lot, > > > > > > > > > > Vadim > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > Talk to your Yahoo! Friends via Windows Live Messenger. Find > Out How > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > -- > > > > http://www.ironpythoninaction.com/ > > > > http://www.voidspace.org.uk/ > > > > http://www.trypython.org/ > > > > http://www.ironpython.info/ > > > > http://www.theotherdelia.co.uk/ > > > > http://www.resolverhacks.net/ > > > > > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 4 > > > > Date: Mon, 25 Aug 2008 18:56:58 +0100 > > > > From: Michael Foord > > > > Subject: Re: [IronPython] Re strict imports > > > > To: dody at nomadlife.org, Discussion of IronPython > > > > > > > > Message-ID: <48B2F26A.2040501 at voidspace.org.uk> > > > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > > > > > Dody Gunawinata wrote: > > > > > Ah, my knowledge is out of date then. > > > > > > > > > > I think the more apt thread is here > > > > > > > > > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-June/007523.html > > > > > > > > > > > > > Yep - Dino confirming that sandboxing is one of the intended uses of > > > > IronPython and that it should work (and a link to a blog entry > about why > > > > some sandboxing problems are very difficult - particularly server > > > > applications where you need to protect against DoS through CPU and > > > > memory over use). > > > > > > > > Michael > > > > > > > > > On Sat, Aug 23, 2008 at 9:44 PM, Michael Foord > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > 2008/8/23 Dody Gunawinata > > > > > > > > > > > > > > > > > > > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-April/006765.html > > > > > > > > > > > > > > > > > > > > Points to a bug in IronPython that is now fixed: > > > > > > > > > > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=15928 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2007-April/004740.html > > > > > > > > > > > > > > > > > > > > A discussion by someone who wants to do a lot more than just > > > > > restrict imports and file access. > > > > > > > > > > Michael > > > > > > > > > > > > > > > > > > > > > > > > > On Sat, Aug 23, 2008 at 3:32 PM, Michael Foord > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > Search the mailing list archive on this issue. The > > > > > bottom line is, you > > > > > > can't > > > > > > - but there are tricks to make it more difficult. > > > > > > > > > > > > > > > > Is that true? You can create an IronPython Engine in an > > > > > AppDomain > > > > > (IronPython 2 has lots of explicit support for this) and > > > > > restrict the > > > > > privileges of the AppDomain. Why would that not work? > > > > > > > > > > Michael > > > > > > > > > > > > > > > > > > > > > Dody G. > > > > > > > > > > > > On Fri, Aug 22, 2008 at 10:03 PM, Huzaifa > > > > > > wrote: > > > > > > > > > > > >> > > > > > >> how can i restrict my user that he can not perform any > > > > > imports or I/O > > > > > >> operations in the script. > > > > > >> -- > > > > > >> View this message in context: > > > > > >> > > > > > http://www.nabble.com/Restrict-imports-tp19113682p19113682.html > > > > > >> Sent from the IronPython mailing list archive at > > > > > Nabble.com. > > > > > >> > > > > > >> _______________________________________________ > > > > > >> Users mailing list > > > > > >> Users at lists.ironpython.com > > > > > > > > > > >> > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > nomadlife.org > > > > > > _______________________________________________ > > > > > > Users mailing list > > > > > > Users at lists.ironpython.com > > > > > > > > > > > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > -- > > > > > http://www.ironpythoninaction.com > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > nomadlife.org > > > > > > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > http://www.ironpythoninaction.com/ > > > > > http://www.voidspace.org.uk/ > > > > > http://www.ironpython.info/ > > > > > http://www.resolverhacks.net/ > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > nomadlife.org > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > -- > > > > http://www.ironpythoninaction.com/ > > > > http://www.voidspace.org.uk/ > > > > http://www.trypython.org/ > > > > http://www.ironpython.info/ > > > > http://www.theotherdelia.co.uk/ > > > > http://www.resolverhacks.net/ > > > > > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 5 > > > > Date: Mon, 25 Aug 2008 11:02:50 -0700 > > > > From: Tomas Matousek > > > > Subject: Re: [IronPython] CodeContext > > > > To: Discussion of IronPython > > > > Cc: Curt Hagenlocher > > > > Message-ID: > > > > > > > > > > > > > Content-Type: text/plain; charset="us-ascii" > > > > > > > > I see. We probably should have a method on ExceptionOperations that > > > returns a list of stack frame information given an exception. > > > > There is also a private method on PythonOps that creates the > > > traceback object and doesn't require CodeContext: CreateTraceBack. We > > > might consider making it public. Curt? > > > > Meanwhile, you can use GetExceptionInfoLocal with a default context > > > from DefaultContext.Default. The only place where the context is used > > > is to do some magic with StringException, but that doesn't influence > > > the traceback object. > > > > > > > > Tomas > > > > > > > > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa > > > > Sent: Saturday, August 23, 2008 8:31 PM > > > > To: users at lists.ironpython.com > > > > Subject: Re: [IronPython] CodeContext > > > > > > > > I am try to get traceback object , for that i am trying > different things > > > > Tomas Matousek wrote: > > > > The class might be actually be called ExceptionService in your > bits. > > > It was renamed recently. Tomas -----Original Message----- From: > > > users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tomas > > > Matousek Sent: Saturday, August 23, 2008 7:53 PM To: Discussion of > > > IronPython Subject: Re: [IronPython] CodeContext Does > > > ExceptionOeprations class provide you the information you need or is > > > something missing? You can get an instance via engine.GetService(). > > > Tomas -----Original Message----- From: > > > users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa > Sent: > > > Saturday, August 23, 2008 4:56 PM To: users at lists.ironpython.com > > > Subject: [IronPython] CodeContext how to get CodeContext from > > > ScriptRuntime ,ScriptScope or ScriptEngine . basically i am try use > > > this function: public static PythonTuple/*!*/ > > > GetExceptionInfoLocal(CodeContext/*!*/ context, Exception ex) -- View > > > this message in context: http://www.nabble.co > > > > m/CodeContext-tp19126500p19126500.html Sent from the IronPython > > > mailing list archive at Nabble.com. > > > _______________________________________________ Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > ________________________________ > > > > View this message in context: Re: > > > > CodeContext > > > > Sent from the IronPython mailing list > > > archive at Nabble.com. > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: > > > > > > > > > > > > ------------------------------ > > > > > > > > _______________________________________________ > > > > Users mailing list > > > > Users at lists.ironpython.com > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > End of Users Digest, Vol 49, Issue 74 > > > > ************************************* > > > > > > > ------------------------------------------------------------------------ > > > > > > See what people are saying about Windows Live. Check out featured > > > posts. Check It Out! > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.voidspace.org.uk/ > > http://www.trypython.org/ > > http://www.ironpython.info/ > > http://www.theotherdelia.co.uk/ > > http://www.resolverhacks.net/ > > > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 25 Aug 2008 15:34:55 -0700 > > From: Srivatsn Narayanan > > Subject: Re: [IronPython] Users Digest, Vol 49, Issue 74 (3. Re: > > trying to run .exe on another computer > > To: Discussion of IronPython > > Message-ID: > > > > > > > Content-Type: text/plain; charset="us-ascii" > > > > Including Oleg who might know something about this. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > > Sent: Monday, August 25, 2008 3:32 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Users Digest, Vol 49, Issue 74 (3. Re: > trying to run .exe on another computer > > > > Seshadri Pillailokam Vijayaraghavan wrote: > > > > > > In the current context, I think invoking the exe from a command prompt > > > would be good enough to see any startup error messages. > > > > > > BTW, apart from the 2 dlls you have mentioned, you most probably need > > > Microsoft.Scripting.dll, Microsoft.Scripting.Core.dll and > > > IronPython.Modules.dll in the same folder for things to work. > > > > > > > > > > > > > As he is using IronPython Studio it will compile his app with IronPython > > 1 and not IronPython 2 (so he doesn't need the assemblies you mention > > above). > > > > Additionally, the Python code generated by IronPython Studio will not > > work on its own - so he can't just recompile against IronPython 2 with > > the Pyc sample. > > > > Unfortunately the guys who created IronPython Studio don't seem to > > respond to questions (releasing it seems to have been a 'fire and > > forget' exercise - or at least that is the way it appeared). > > > > There is probably a command switch in the project properties that can be > > used to change it from a Windows app to a console app - but I would have > > to install it to find out. > > > > Michael > > > > > Thanks > > > > > > sesh > > > > > > > > > > > > *From:* users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Vadim > Khaskel > > > *Sent:* Monday, August 25, 2008 2:36 PM > > > *To:* users at lists.ironpython.com > > > *Subject:* Re: [IronPython] Users Digest, Vol 49, Issue 74 (3. Re: > > > trying to run .exe on another computer (Michael Foord)) > > > > > > > > > > > > I would appreciate if somebody can tell me how to compie windows > > > app as a console application > > > > > > thanks, > > > > > > V. > > > > > > > From: users-request at lists.ironpython.com > > > > Subject: Users Digest, Vol 49, Issue 74 > > > > To: users at lists.ironpython.com > > > > Date: Mon, 25 Aug 2008 11:03:21 -0700 > > > > > > > > Send Users mailing list submissions to > > > > users at lists.ironpython.com > > > > > > > > To subscribe or unsubscribe via the World Wide Web, visit > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > or, via email, send a message with subject or body 'help' to > > > > users-request at lists.ironpython.com > > > > > > > > You can reach the person managing the list at > > > > users-owner at lists.ironpython.com > > > > > > > > When replying, please edit your Subject line so it is more specific > > > > than "Re: Contents of Users digest..." > > > > > > > > > > > > Today's Topics: > > > > > > > > 1. Re: _scriptEngine.Shutdown ( ) (Curt Hagenlocher) > > > > 2. trying to run .exe on another computer (Vadim Khaskel) > > > > 3. Re: trying to run .exe on another computer (Michael Foord) > > > > 4. Re: Re strict imports (Michael Foord) > > > > 5. Re: CodeContext (Tomas Matousek) > > > > > > > > > > > > > ---------------------------------------------------------------------- > > > > > > > > Message: 1 > > > > Date: Mon, 25 Aug 2008 09:47:23 -0700 > > > > From: "Curt Hagenlocher" > > > > Subject: Re: [IronPython] _scriptEngine.Shutdown ( ) > > > > To: "Discussion of IronPython" > > > > Message-ID: > > > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > > > I don't have an answer for you yet, but I am following up on this > > > > internally. > > > > > > > > On Sun, Aug 24, 2008 at 12:27 PM, Huzaifa > wrote: > > > > > > > > > > > > > > right but it is not available in the latest code for ipy 2.0. > > > > > > > > > > > > > > > > > > > > Curt Hagenlocher wrote: > > > > > > > > > > > > I'm afraid I don't quite see the question in there :). > > > > > > > > > > > > The purpose of ScriptEngine.Shutdown is to support > functionality like > > > > > > Python's sys.exitfunc. > > > > > > > > > > > > On Sat, Aug 23, 2008 at 8:44 PM, Huzaifa > > > wrote: > > > > > > > > > > > >> > > > > > >> scriptEngine.Shutdown ( ) > > > > > >> > > > > > >> Is this method replaced ,if yes then with without. > > > > > >> > > > > > >> -- > > > > > >> View this message in context: > > > > > >> > > > > > > > > > http://www.nabble.com/_scriptEngine.Shutdown-%28-%29-tp19127524p19127524.html > > > > > >> Sent from the IronPython mailing list archive at Nabble.com. > > > > > >> > > > > > >> _______________________________________________ > > > > > >> Users mailing list > > > > > >> Users at lists.ironpython.com > > > > > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > >> > > > > > > > > > > > > _______________________________________________ > > > > > > Users mailing list > > > > > > Users at lists.ironpython.com > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > -- > > > > > View this message in context: > > > > > > > > > http://www.nabble.com/_scriptEngine.Shutdown-%28-%29-tp19127524p19133851.html > > > > > Sent from the IronPython mailing list archive at Nabble.com. > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 2 > > > > Date: Mon, 25 Aug 2008 17:23:47 +0000 > > > > From: Vadim Khaskel > > > > Subject: [IronPython] trying to run .exe on another computer > > > > To: > > > > Message-ID: > > > > Content-Type: text/plain; charset="iso-8859-1" > > > > > > > > > > > > Hi all, > > > > > > > > I'm trying to run executive file (myapp.exe) of my application found > > > in debug folder along with myapp.pdb, IronMath.dll, IronPython.dll. So > > > I'm trying to run this .exe file on another PC. ...I can not do that - > > > nothing happens, not even single error message pops up. Please advise. > > > > > > > > thanks a lot, > > > > > > > > Vadim > > > > _________________________________________________________________ > > > > Talk to your Yahoo! Friends via Windows Live Messenger. Find out > how. > > > > > http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008 > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 3 > > > > Date: Mon, 25 Aug 2008 18:28:39 +0100 > > > > From: Michael Foord > > > > Subject: Re: [IronPython] trying to run .exe on another computer > > > > To: Discussion of IronPython > > > > Message-ID: <48B2EBC7.9020003 at voidspace.org.uk> > > > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > > > > > Vadim Khaskel wrote: > > > > > Hi all, > > > > > > > > > > I'm trying to run executive file (myapp.exe) of my application > found > > > > > in debug folder along with myapp.pdb, IronMath.dll, > IronPython.dll. So > > > > > I'm trying to run this .exe file on another PC. ...I can not > do that - > > > > > nothing happens, not even single error message pops up. Please > advise. > > > > > > > > > > > > > How did you create myapp.exe? What happens if you run it from the > > > > command line? > > > > > > > > (If you created it from IronPython Studio and you still get > nothing from > > > > the command line - try compiling it as a console application > instead of > > > > a windows application and then rerunning.) > > > > > > > > Michael > > > > > > > > > thanks a lot, > > > > > > > > > > Vadim > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > Talk to your Yahoo! Friends via Windows Live Messenger. Find > Out How > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > -- > > > > http://www.ironpythoninaction.com/ > > > > http://www.voidspace.org.uk/ > > > > http://www.trypython.org/ > > > > http://www.ironpython.info/ > > > > http://www.theotherdelia.co.uk/ > > > > http://www.resolverhacks.net/ > > > > > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 4 > > > > Date: Mon, 25 Aug 2008 18:56:58 +0100 > > > > From: Michael Foord > > > > Subject: Re: [IronPython] Re strict imports > > > > To: dody at nomadlife.org, Discussion of IronPython > > > > > > > > Message-ID: <48B2F26A.2040501 at voidspace.org.uk> > > > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > > > > > Dody Gunawinata wrote: > > > > > Ah, my knowledge is out of date then. > > > > > > > > > > I think the more apt thread is here > > > > > > > > > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-June/007523.html > > > > > > > > > > > > > Yep - Dino confirming that sandboxing is one of the intended uses of > > > > IronPython and that it should work (and a link to a blog entry > about why > > > > some sandboxing problems are very difficult - particularly server > > > > applications where you need to protect against DoS through CPU and > > > > memory over use). > > > > > > > > Michael > > > > > > > > > On Sat, Aug 23, 2008 at 9:44 PM, Michael Foord > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > 2008/8/23 Dody Gunawinata > > > > > > > > > > > > > > > > > > > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-April/006765.html > > > > > > > > > > > > > > > > > > > > Points to a bug in IronPython that is now fixed: > > > > > > > > > > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=15928 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2007-April/004740.html > > > > > > > > > > > > > > > > > > > > A discussion by someone who wants to do a lot more than just > > > > > restrict imports and file access. > > > > > > > > > > Michael > > > > > > > > > > > > > > > > > > > > > > > > > On Sat, Aug 23, 2008 at 3:32 PM, Michael Foord > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > Search the mailing list archive on this issue. The > > > > > bottom line is, you > > > > > > can't > > > > > > - but there are tricks to make it more difficult. > > > > > > > > > > > > > > > > Is that true? You can create an IronPython Engine in an > > > > > AppDomain > > > > > (IronPython 2 has lots of explicit support for this) and > > > > > restrict the > > > > > privileges of the AppDomain. Why would that not work? > > > > > > > > > > Michael > > > > > > > > > > > > > > > > > > > > > Dody G. > > > > > > > > > > > > On Fri, Aug 22, 2008 at 10:03 PM, Huzaifa > > > > > > wrote: > > > > > > > > > > > >> > > > > > >> how can i restrict my user that he can not perform any > > > > > imports or I/O > > > > > >> operations in the script. > > > > > >> -- > > > > > >> View this message in context: > > > > > >> > > > > > http://www.nabble.com/Restrict-imports-tp19113682p19113682.html > > > > > >> Sent from the IronPython mailing list archive at > > > > > Nabble.com. > > > > > >> > > > > > >> _______________________________________________ > > > > > >> Users mailing list > > > > > >> Users at lists.ironpython.com > > > > > > > > > > >> > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > nomadlife.org > > > > > > _______________________________________________ > > > > > > Users mailing list > > > > > > Users at lists.ironpython.com > > > > > > > > > > > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > -- > > > > > http://www.ironpythoninaction.com > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > nomadlife.org > > > > > > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > http://www.ironpythoninaction.com/ > > > > > http://www.voidspace.org.uk/ > > > > > http://www.ironpython.info/ > > > > > http://www.resolverhacks.net/ > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > nomadlife.org > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > -- > > > > http://www.ironpythoninaction.com/ > > > > http://www.voidspace.org.uk/ > > > > http://www.trypython.org/ > > > > http://www.ironpython.info/ > > > > http://www.theotherdelia.co.uk/ > > > > http://www.resolverhacks.net/ > > > > > > > > > > > > > > > > ------------------------------ > > > > > > > > Message: 5 > > > > Date: Mon, 25 Aug 2008 11:02:50 -0700 > > > > From: Tomas Matousek > > > > Subject: Re: [IronPython] CodeContext > > > > To: Discussion of IronPython > > > > Cc: Curt Hagenlocher > > > > Message-ID: > > > > > > > > > > > > > Content-Type: text/plain; charset="us-ascii" > > > > > > > > I see. We probably should have a method on ExceptionOperations that > > > returns a list of stack frame information given an exception. > > > > There is also a private method on PythonOps that creates the > > > traceback object and doesn't require CodeContext: CreateTraceBack. We > > > might consider making it public. Curt? > > > > Meanwhile, you can use GetExceptionInfoLocal with a default context > > > from DefaultContext.Default. The only place where the context is used > > > is to do some magic with StringException, but that doesn't influence > > > the traceback object. > > > > > > > > Tomas > > > > > > > > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa > > > > Sent: Saturday, August 23, 2008 8:31 PM > > > > To: users at lists.ironpython.com > > > > Subject: Re: [IronPython] CodeContext > > > > > > > > I am try to get traceback object , for that i am trying > different things > > > > Tomas Matousek wrote: > > > > The class might be actually be called ExceptionService in your bits. > > > It was renamed recently. Tomas -----Original Message----- From: > > > users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tomas > > > Matousek Sent: Saturday, August 23, 2008 7:53 PM To: Discussion of > > > IronPython Subject: Re: [IronPython] CodeContext Does > > > ExceptionOeprations class provide you the information you need or is > > > something missing? You can get an instance via engine.GetService(). > > > Tomas -----Original Message----- From: > > > users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: > > > Saturday, August 23, 2008 4:56 PM To: users at lists.ironpython.com > > > Subject: [IronPython] CodeContext how to get CodeContext from > > > ScriptRuntime ,ScriptScope or ScriptEngine . basically i am try use > > > this function: public static PythonTuple/*!*/ > > > GetExceptionInfoLocal(CodeContext/*!*/ context, Exception ex) -- View > > > this message in context: http://www.nabble.co > > > > m/CodeContext-tp19126500p19126500.html Sent from the IronPython > > > mailing list archive at Nabble.com. > > > _______________________________________________ Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > ________________________________ > > > > View this message in context: Re: > > > > CodeContext > > > > Sent from the IronPython mailing list > > > archive at Nabble.com. > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: > > > > > > > > > > > > ------------------------------ > > > > > > > > _______________________________________________ > > > > Users mailing list > > > > Users at lists.ironpython.com > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > End of Users Digest, Vol 49, Issue 74 > > > > ************************************* > > > > > > > ------------------------------------------------------------------------ > > > > > > See what people are saying about Windows Live. Check out featured > > > posts. Check It Out! > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.voidspace.org.uk/ > > http://www.trypython.org/ > > http://www.ironpython.info/ > > http://www.theotherdelia.co.uk/ > > http://www.resolverhacks.net/ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > ------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > End of Users Digest, Vol 49, Issue 80 > > ************************************* > > > ------------------------------------------------------------------------ > Get thousands of games on your PC, your mobile phone, and the web with > Windows?. Game with Windows > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From id804097 at gmail.com Tue Sep 2 20:06:29 2008 From: id804097 at gmail.com (cephire) Date: Tue, 2 Sep 2008 11:06:29 -0700 (PDT) Subject: [IronPython] Application stays in memory even after exit In-Reply-To: <48BD6D63.6090300@voidspace.org.uk> References: <8613820b-37b9-45cd-b98d-2b4ecdd03bc4@q5g2000prf.googlegroups.com> <48BC5266.7040800@voidspace.org.uk> <48BD6D63.6090300@voidspace.org.uk> Message-ID: <21655684-e794-4343-9242-9da2ebea19f9@a2g2000prm.googlegroups.com> Dan/Michael, Thank you for your reply. I had a timer running and I didn't stop it. Once I did, the application exited properly. thank you, Joseph On Sep 2, 9:44?pm, Michael Foord wrote: > cephire wrote: > > Hi: > > If you mean am I closing all the forms, yes. Here is the code snippet > > of both program.py and the form's exit menu item. > > Please note that I also tried self.Close and still it didn't exit from > > the memory. Thank you for your time. > > I asked if you had *deleted references* to your forms - not if you had > closed them. > > Does the process terminate when your form is closed? As far as I can see > it should... If so how are you judging that it has not freed memory? > (Are you running it from the interactive interpreter?) > > Michael > > > > > > > > > Program.py > > ========= > > > class mysecs10: # namespace > > > ? ? @staticmethod > > ? ? def RealEntryPoint(): > > > ? ? ? ? Application.EnableVisualStyles() > > ? ? ? ? Application.Run(mysecs20.MainForm()) > > > if __name__ == "Program": > > ? ? mysecs10.RealEntryPoint(); > > > mainform. exit > > =========== > > > ? ? ? ? @accepts(Self(), System.Object, System.EventArgs) > > ? ? ? ? @returns(None) > > ? ? ? ? def _exitToolStripMenuItem_Click(self, sender, e): > > ? ? ? ? ? ? Application.Exit() > > > On Sep 2, 1:36 am, Michael Foord wrote: > > >> cephire wrote: > > >>> Hi all, > >>> I've found out that the application is still in memory even after > >>> closing the application. I exit the application with > >>> Application.Exit(). > > >>> What should I do to remove the application completely? > > >> Which version of IronPython are you using? > > >> Have you deleted all references to the form (I assume it is a Windows > >> Forms application)? > > >> Michael > > >>> Thank you, > >>> Joseph > >>> _______________________________________________ > >>> Users mailing list > >>> Us... at lists.ironpython.com > >>>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > >> --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://... > > >> _______________________________________________ > >> Users mailing list > >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.theotherdelia.co.uk/http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- Hide quoted text - > > - Show quoted text - From danyelf at microsoft.com Tue Sep 2 21:55:41 2008 From: danyelf at microsoft.com (Danyel Fisher) Date: Tue, 2 Sep 2008 12:55:41 -0700 Subject: [IronPython] A new application in ipy In-Reply-To: <5c2995d7-3157-418a-9094-d35deed23a9e@r15g2000prd.googlegroups.com> References: <4817b6fc0808311609t1589323fx80e0e8b8f93dbdd0@mail.gmail.com> <5c2995d7-3157-418a-9094-d35deed23a9e@r15g2000prd.googlegroups.com> Message-ID: <505990D9D65D0045867754C2E1BE7D671E74F582F1@NA-EXMSG-C111.redmond.corp.microsoft.com> This is about my day job, not IronPython, but you might find PersonalVibe http://research.microsoft.com/research/downloads/Details/0ea12e49-8b29-4930-b380-a5a00872d229/Details.aspx of interest for this problem... it captures window positions & titles, mouse movement, which window is in front, and so on... drops it all into an SQL Express database. Sadly, though, the source code isn't available. -Danyel -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of cephire Sent: Monday, September 01, 2008 7:17 AM To: users at lists.ironpython.com Subject: Re: [IronPython] A new application in ipy I poll the active window every 5 seconds and if it is the same then I increment the time spent on it. I am assuming here, of course, that if someone steps out of the machine there is either screensaver is on or it is locked. When any one of these two are true, there is no activewindow. As I continue to use (and probably get some feedback from others too), I will continue to enhance the application. Thank you for your interest Joseph On Sep 1, 4:09 am, "Dan Eloff" wrote: > I made something along these lines a long time ago with C# and access > (yuck!), cephire, you may find the following function useful. I used > it to detect when I had walked away from the computer. > > http://dataerror.blogspot.com/2005/02/detect-windows-idle-time.html > > I think the test I used is if the time since last input is > update > interval, then I would skip the update and record the current time - > last input time as the start of when I left the computer. > > -Dan > > > > > > On Sun, Aug 31, 2008 at 11:35 AM, Michael Stephens wrote: > > That is pretty cool. Does it have support for abandoning my computer > > to do something else. Or will it keep logging that time towards that > > app? > > Michael Stephens > > > Electrical Engineering Graduate Student > > University of Wyoming > > fal... at uwyo.edu or 89i... at gmail.com > > > On Sun, Aug 31, 2008 at 9:23 AM, cephire wrote: > >> All: > >> I got my first IronPython application working. This is a simple > >> application I wrote to help myself track time that I spend in various > >> application. > > >> If you're interested download the package from: > >>http://mysecs.googlecode.com/files/mySecs_0.1.zip > >> Extract the files to a directory and execute mysecs.exe. It will start > >> to capture time details (every 5 seconds). One can refersh and also > >> download details into a csv file. > > >> Source is found in:http://code.google.com/p/mysecs/source/browse/ > > >> I use Visual Studio Integration (http://www.izume.com/2007/10/13/ > >> integrating-ironpython-with-visual-studio-2005) > > >> Feel free to comment on the code, design. If there is a better way of > >> doing things, please let me know. > > >> Thank you, > >> Joseph > >>http://www.jjude.com|http://twitter.com/jjude > >> _______________________________________________ > >> Users mailing list > >> Us... at lists.ironpython.com > >>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- Hide quoted text - > > - Show quoted text - _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Tue Sep 2 23:50:52 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Tue, 2 Sep 2008 14:50:52 -0700 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <8cd017b80808230414n3dc76c6arcebe5cc66d924b1d@mail.gmail.com> <3140.92.83.147.51.1219494769.squirrel@mail2.webfaction.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> Message-ID: <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> The CLR doesn't dump out full exception information on SecurityExceptions in partial trust - you can get a lot more information if you look at the exception in a debugger, or if you Assert for FullTrust before doing a ToString on the permission. Once you do that, you should be able to get more data including the demanded permission and the assembly which caused the demand to fail, instead of the message saying "The granted set of the failing assembly was:" which does not say which assembly is causing the problem. Also, can you try adding IronPython.dll and IronPython.Modules.dll to the fullTrustAssemblies argument to AppDomain.CreateDomain? Thanks, Shri From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Sunday, August 31, 2008 10:59 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports I hate bringing this issue up over and over again, but anyway, I'd rather re-use one of these conversations. This CAS stuff is really driving me nuts, moreso because it makes me feel dumber than a door nail to not understand what's going on. I've got IPY 2.0 loading into a 'sandboxed' domain, and it can run basic python calculations and stuff like print just fine, the moment I try to have it interact with an object I pass in through globals though I get a permission error where (it looks like to me) the act is asking for nothing less than completely unrestricted access. Here's the error: Unhandled Exception: System.Security.SecurityException: Request failed. at _stub_$6##6(Closure , CallSite , Object , CodeContext ) at _stub_MatchCaller(Object , CallSite , Object[] ) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at B:\Code\IronPythonShell\IronPythonShell\bin\Debug\script2.py$1##1(Closure, Scope , LanguageContext ) at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at IronPythonShell.Program.Main(String[] args) in B:\Code\IronPythonShell\Iro nPythonShell\Program.cs:line 49 The action that failed was: Demand The type of the first permission that failed was: System.Security.PermissionSet The demand was for: The granted set of the failing assembly was: The code looks like this: Item item = new Item("Monkey"); item.Value = 10; item.Type = ItemType.Misc; PermissionSet pset = new PermissionSet(PermissionState.None); pset.AddPermission(new SecurityPermission(PermissionState.Unrestricted)); pset.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); pset.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, AppDomain.CurrentDomain.BaseDirectory)); AppDomainSetup domainSetup = new AppDomainSetup(); domainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; // create the sandboxed domain AppDomain sandbox = AppDomain.CreateDomain( "Sandboxed Domain", AppDomain.CurrentDomain.Evidence, domainSetup, pset, CreateStrongName(Assembly.GetExecutingAssembly()), CreateStrongName(Assembly.GetAssembly(typeof(ScriptRuntime))), CreateStrongName(Assembly.GetAssembly(typeof(System.Scripting.ScriptCode)))); ScriptRuntime runtime = ScriptRuntime.Create(sandbox); runtime.Globals.SetVariable("Artifact", new ScriptableItem(item)); runtime.ExecuteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "script2.py")); Script2.py: import Artifact i = 200 while i > 0: i = i - 1 print "Done in the second verse. Yes?" print Artifact.Name Item and ScriptableItem are simple classes with only those two properties, ScriptableItem inherits from MarshalByRefObject. The idea is that Item will eventually be a very powerful class and ScriptableItem is a wrapper around it to only provide access to certain portions of the class (IPY 1.1 didn't do so well with obeying interfaces). I tried using [EnvironmentPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)] on both of those classes, but it didn't work. CreateStrongName is a method I pulled from this post: http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx The way I understand it, Microsoft.Scripting, Microsoft.Scripting.Core and my own assembly should be given full trust when the sandbox domain is first created so I'm at a complete loss. This code works fine, of course, if I don't create the runtime in the domain. A little light, or some more reference material, would be very helpful =\ --- LC On Mon, Aug 25, 2008 at 12:56 PM, Michael Foord > wrote: Dody Gunawinata wrote: Ah, my knowledge is out of date then. I think the more apt thread is here http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-June/007523.html Yep - Dino confirming that sandboxing is one of the intended uses of IronPython and that it should work (and a link to a blog entry about why some sandboxing problems are very difficult - particularly server applications where you need to protect against DoS through CPU and memory over use). Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellosticky at gmail.com Wed Sep 3 00:34:27 2008 From: hellosticky at gmail.com (KE) Date: Tue, 2 Sep 2008 18:34:27 -0400 Subject: [IronPython] Specified language provider type is not registered. In-Reply-To: Message-ID: <48bdbf9b.092a400a.629a.13d7@mx.google.com> Oh D'uh, Thanks! It got further now, but I had built the binaries in Debug mode and there was an Environment permission exception in: internal static class DebugOptions { private static string ReadDebugString(string name) { #if DEBUG && !SILVERLIGHT try { return Environment.GetEnvironmentVariable("DLR_" + name); Of course, I will go back and build in Release mode, but I thought it's something you should know - the assembly acts differently in partial trust based on the type of release mode. Thanks, _____ From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Tuesday, September 02, 2008 12:25 PM To: Discussion of IronPython; hellosticky at gmail.com Subject: RE: [IronPython] Specified language provider type is not registered. The problem in your code is that you update "setup" variable after it is passed to ScriptRuntime. You need to first initialize the setup and then pass it to runtime ctor (the ctor uses the setup object to create and configure DLR and once that done no changes are possible). setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); ScriptRuntime runtime = new ScriptRuntime(setup); Does this work? Tomas From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, September 01, 2008 10:26 PM To: hellosticky at gmail.com; Discussion of IronPython Subject: Re: [IronPython] Specified language provider type is not registered. Get the ScriptEngine directly from IronPython.Hosting.Python instead of going through the runtime. On Mon, Sep 1, 2008 at 10:19 PM, KE wrote: Hi, I've compiled IronPython from the latest source code, and added some strong name keys to run in a partial trust AppDomain, but I can't quite get the ScriptEngine created: System.ArgumentException: Unknown language name: 'py' at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String languageName) at mycode The code creating this is: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); ScriptRuntime runtime = new ScriptRuntime(setup); setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); runtime.LoadAssembly(assembly); runtime.IO.SetOutput(ms, writer); ScriptEngine engine = runtime.GetEngine("py"); ScriptScope scope = engine.CreateScope(); I would prefer to do this programmatically, without any external .config files, if possible. Thanks! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellosticky at gmail.com Wed Sep 3 00:53:03 2008 From: hellosticky at gmail.com (Hello Sticky) Date: Tue, 2 Sep 2008 18:53:03 -0400 Subject: [IronPython] No module named System Message-ID: <6936856c0809021553y5aab20adiaa300dea165bcb24@mail.gmail.com> Hi, I'm dynamically loading a python assembly built through pyc.py into a partially trusted AppDomain. First, the exception, and after that follows the code I'm using. The question is: how do I need to add a reference to System.dll -- through runtime.LoadAssembly, clr.AddReference, or both? IronPython.Runtime.Exceptions.ImportException: "No module named System" at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) at _stub_$20##20(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) ... long stack trace Loading code: Assembly assembly = Assembly.Load(AssemblyName); ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); ScriptRuntime runtime = new ScriptRuntime(setup); runtime.LoadAssembly(assembly); runtime.IO.SetOutput(ms, writer); ScriptEngine engine = runtime.GetEngine(GetEngineName()); ScriptScope scope = engine.CreateScope(); string code = string.Format(@"import clr clr.AddReference(""{0}"") import {1} ", AssemblyName, AssemblyType.Replace(".py", "") ); ScriptSource source = engine.CreateScriptSourceFromString( code, SourceCodeKind.Statements ); source.Execute(scope); Thanks, From curt at hagenlocher.org Wed Sep 3 01:15:55 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 2 Sep 2008 16:15:55 -0700 Subject: [IronPython] No module named System In-Reply-To: <6936856c0809021553y5aab20adiaa300dea165bcb24@mail.gmail.com> References: <6936856c0809021553y5aab20adiaa300dea165bcb24@mail.gmail.com> Message-ID: clr.AddReference ultimately calls ScriptRuntime.LoadAssembly under the covers -- so the two can be considered equivalent. If you want to call from the host, use LoadAssembly and if you want to call from within Python, use AddReference. On Tue, Sep 2, 2008 at 3:53 PM, Hello Sticky wrote: > Hi, I'm dynamically loading a python assembly built through pyc.py > into a partially trusted AppDomain. First, the exception, and after > that follows the code I'm using. The question is: how do I need to add > a reference to System.dll -- through runtime.LoadAssembly, > clr.AddReference, or both? > > IronPython.Runtime.Exceptions.ImportException: "No module named System" > at IronPython.Runtime.Builtin.__import__(CodeContext context, > String name, Object globals, Object locals, Object fromlist, Int32 > level) > at IronPython.Runtime.Builtin.__import__(CodeContext context, > String name, Object globals, Object locals, Object fromlist) > at _stub_$20##20(Closure , CallSite , CodeContext , Object , String > , IAttributesCollection , IAttributesCollection , PythonTuple ) > ... long stack trace > > Loading code: > > Assembly assembly = Assembly.Load(AssemblyName); > ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); > > setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); > ScriptRuntime runtime = new ScriptRuntime(setup); > runtime.LoadAssembly(assembly); > runtime.IO.SetOutput(ms, writer); > ScriptEngine engine = > runtime.GetEngine(GetEngineName()); > ScriptScope scope = engine.CreateScope(); > > string code = string.Format(@"import clr > clr.AddReference(""{0}"") > import {1} > ", > AssemblyName, > AssemblyType.Replace(".py", "") > ); > ScriptSource source = > engine.CreateScriptSourceFromString( > code, > SourceCodeKind.Statements > ); > source.Execute(scope); > > Thanks, > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From desleo at gmail.com Wed Sep 3 01:30:57 2008 From: desleo at gmail.com (Leo Carbajal) Date: Tue, 2 Sep 2008 18:30:57 -0500 Subject: [IronPython] Re strict imports In-Reply-To: <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <19113682.post@talk.nabble.com> <8cd017b80808230414n3dc76c6arcebe5cc66d924b1d@mail.gmail.com> <3140.92.83.147.51.1219494769.squirrel@mail2.webfaction.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: So here's a strange wrinkle, when I run this with the debugger (unmodified except for adding the IronPython assemblies as full-trust on the domain) it works fine and as expected. If I run it without the debugger attached it gives me the same exception as before, when I catch the exception myself I also get this tidbit: The assembly or AppDomain that failed was: Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35 The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL If I build and compile the code as Release instead of Debug I get: System.Runtime.Serialization.SerializationException: Type 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable. at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at IronPythonShell.Program.Main(String[] args) in B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 It's a little beyond odd to me, but like I said before I fear I don't fully understand what's going on behind the goo. The only consolation is that I can at least built out my scripting system in working form and later run it under a more trusted domain for production by simply removing the domain from the Runtime.Create() constructor and then adding it later. (At least, I hope this is the case) --- Leo C. On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde wrote: > The CLR doesn't dump out full exception information on SecurityExceptions > in partial trust ? you can get a lot more information if you look at the > exception in a debugger, or if you Assert for FullTrust before doing a > ToString on the permission. Once you do that, you should be able to get > more data including the demanded permission and the assembly which caused > the demand to fail, instead of the message saying "The granted set of the > failing assembly was:" which does not say which assembly is causing the > problem. > > > > Also, can you try adding IronPython.dll and IronPython.Modules.dll to the > fullTrustAssemblies argument to AppDomain.CreateDomain > ? > > > > Thanks, > > Shri > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Wed Sep 3 01:36:57 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 2 Sep 2008 16:36:57 -0700 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <8cd017b80808230414n3dc76c6arcebe5cc66d924b1d@mail.gmail.com> <3140.92.83.147.51.1219494769.squirrel@mail2.webfaction.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Do you have a simple reproduction that doesn't include any of your domain-specific code? On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: > So here's a strange wrinkle, > > when I run this with the debugger (unmodified except for adding the > IronPython assemblies as full-trust on the domain) it works fine and as > expected. If I run it without the debugger attached it gives me the same > exception as before, when I catch the exception myself I also get this > tidbit: > > The assembly or AppDomain that failed was: > Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, > PublicKeyToken=31bf3856ad364e35 > The Zone of the assembly that failed was: > MyComputer > The Url of the assembly that failed was: > > file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL > > If I build and compile the code as Release instead of Debug I get: > > System.Runtime.Serialization.SerializationException: Type > 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, > Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not > marked as serializable. > at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) > at IronPythonShell.Program.Main(String[] args) in > B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 > > It's a little beyond odd to me, but like I said before I fear I don't fully > understand what's going on behind the goo. The only consolation is that I > can at least built out my scripting system in working form and later run it > under a more trusted domain for production by simply removing the domain > from the Runtime.Create() constructor and then adding it later. (At least, I > hope this is the case) > > --- > Leo C. > > On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde wrote: > >> The CLR doesn't dump out full exception information on >> SecurityExceptions in partial trust ? you can get a lot more information if >> you look at the exception in a debugger, or if you Assert for FullTrust >> before doing a ToString on the permission. Once you do that, you should be >> able to get more data including the demanded permission and the assembly >> which caused the demand to fail, instead of the message saying "The >> granted set of the failing assembly was:" which does not say which >> assembly is causing the problem. >> >> >> >> Also, can you try adding IronPython.dll and IronPython.Modules.dll to the >> fullTrustAssemblies argument to AppDomain.CreateDomain >> ? >> >> >> >> Thanks, >> >> Shri >> >> >> > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Sep 3 01:45:43 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 2 Sep 2008 16:45:43 -0700 Subject: [IronPython] Specified language provider type is not registered. In-Reply-To: <48bdbf9b.092a400a.629a.13d7@mx.google.com> References: <48bdbf9b.092a400a.629a.13d7@mx.google.com> Message-ID: Right. That's expected behavior. The exception is caught there, isn't it? DLR can be tweaked so that it dumps debugging information about generated IL, trees, etc. Compiler developers building their own language on top of DLR might want to use DLR_* options while debugging their compilers to get useful information out of DLR. Tomas From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Tuesday, September 02, 2008 3:34 PM To: Tomas Matousek; 'Discussion of IronPython' Subject: Re: [IronPython] Specified language provider type is not registered. Oh D'uh, Thanks! It got further now, but I had built the binaries in Debug mode and there was an Environment permission exception in: internal static class DebugOptions { private static string ReadDebugString(string name) { #if DEBUG && !SILVERLIGHT try { return Environment.GetEnvironmentVariable("DLR_" + name); Of course, I will go back and build in Release mode, but I thought it's something you should know - the assembly acts differently in partial trust based on the type of release mode. Thanks, ________________________________ From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Tuesday, September 02, 2008 12:25 PM To: Discussion of IronPython; hellosticky at gmail.com Subject: RE: [IronPython] Specified language provider type is not registered. The problem in your code is that you update "setup" variable after it is passed to ScriptRuntime. You need to first initialize the setup and then pass it to runtime ctor (the ctor uses the setup object to create and configure DLR and once that done no changes are possible). setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); ScriptRuntime runtime = new ScriptRuntime(setup); Does this work? Tomas From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, September 01, 2008 10:26 PM To: hellosticky at gmail.com; Discussion of IronPython Subject: Re: [IronPython] Specified language provider type is not registered. Get the ScriptEngine directly from IronPython.Hosting.Python instead of going through the runtime. On Mon, Sep 1, 2008 at 10:19 PM, KE > wrote: Hi, I've compiled IronPython from the latest source code, and added some strong name keys to run in a partial trust AppDomain, but I can't quite get the ScriptEngine created: System.ArgumentException: Unknown language name: 'py' at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String languageName) at mycode The code creating this is: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); ScriptRuntime runtime = new ScriptRuntime(setup); setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); runtime.LoadAssembly(assembly); runtime.IO.SetOutput(ms, writer); ScriptEngine engine = runtime.GetEngine("py"); ScriptScope scope = engine.CreateScope(); I would prefer to do this programmatically, without any external .config files, if possible. Thanks! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellosticky at gmail.com Wed Sep 3 02:16:53 2008 From: hellosticky at gmail.com (KE) Date: Tue, 2 Sep 2008 20:16:53 -0400 Subject: [IronPython] Specified language provider type is not registered. In-Reply-To: Message-ID: <48bdd7a0.1f2a400a.075f.ffffe631@mx.google.com> That makes sense. Unfortunately, it did not catch the exception. It threw a SecurityException into my application which caused it to crash. I have switched to Release mode so it is no longer an issue for me. Thanks, _____ From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Tuesday, September 02, 2008 7:46 PM To: hellosticky at gmail.com; Discussion of IronPython Subject: RE: [IronPython] Specified language provider type is not registered. Right. That's expected behavior. The exception is caught there, isn't it? DLR can be tweaked so that it dumps debugging information about generated IL, trees, etc. Compiler developers building their own language on top of DLR might want to use DLR_* options while debugging their compilers to get useful information out of DLR. Tomas From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Tuesday, September 02, 2008 3:34 PM To: Tomas Matousek; 'Discussion of IronPython' Subject: Re: [IronPython] Specified language provider type is not registered. Oh D'uh, Thanks! It got further now, but I had built the binaries in Debug mode and there was an Environment permission exception in: internal static class DebugOptions { private static string ReadDebugString(string name) { #if DEBUG && !SILVERLIGHT try { return Environment.GetEnvironmentVariable("DLR_" + name); Of course, I will go back and build in Release mode, but I thought it's something you should know - the assembly acts differently in partial trust based on the type of release mode. Thanks, _____ From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Tuesday, September 02, 2008 12:25 PM To: Discussion of IronPython; hellosticky at gmail.com Subject: RE: [IronPython] Specified language provider type is not registered. The problem in your code is that you update "setup" variable after it is passed to ScriptRuntime. You need to first initialize the setup and then pass it to runtime ctor (the ctor uses the setup object to create and configure DLR and once that done no changes are possible). setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); ScriptRuntime runtime = new ScriptRuntime(setup); Does this work? Tomas From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, September 01, 2008 10:26 PM To: hellosticky at gmail.com; Discussion of IronPython Subject: Re: [IronPython] Specified language provider type is not registered. Get the ScriptEngine directly from IronPython.Hosting.Python instead of going through the runtime. On Mon, Sep 1, 2008 at 10:19 PM, KE wrote: Hi, I've compiled IronPython from the latest source code, and added some strong name keys to run in a partial trust AppDomain, but I can't quite get the ScriptEngine created: System.ArgumentException: Unknown language name: 'py' at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngine(String languageName) at mycode The code creating this is: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(); ScriptRuntime runtime = new ScriptRuntime(setup); setup.LanguageSetups.Add(Python.CreateLanguageSetup(null)); runtime.LoadAssembly(assembly); runtime.IO.SetOutput(ms, writer); ScriptEngine engine = runtime.GetEngine("py"); ScriptScope scope = engine.CreateScope(); I would prefer to do this programmatically, without any external .config files, if possible. Thanks! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From desleo at gmail.com Wed Sep 3 02:38:13 2008 From: desleo at gmail.com (Leo Carbajal) Date: Tue, 2 Sep 2008 19:38:13 -0500 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <3140.92.83.147.51.1219494769.squirrel@mail2.webfaction.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: This is a condensed version. You'll have to sign the assembly or you'll get an error at the domain creation step, other than that this should run just by starting a new console application, adding the IPY and DLR DLLs, and then copying and pasting this file over the default generated code. Even after starting a new project to make sure my sample builds I still observe the same behavior. --- LC On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher wrote: > Do you have a simple reproduction that doesn't include any of your > domain-specific code? > > On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: > >> So here's a strange wrinkle, >> >> when I run this with the debugger (unmodified except for adding the >> IronPython assemblies as full-trust on the domain) it works fine and as >> expected. If I run it without the debugger attached it gives me the same >> exception as before, when I catch the exception myself I also get this >> tidbit: >> >> The assembly or AppDomain that failed was: >> Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, >> PublicKeyToken=31bf3856ad364e35 >> The Zone of the assembly that failed was: >> MyComputer >> The Url of the assembly that failed was: >> >> file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL >> >> If I build and compile the code as Release instead of Debug I get: >> >> System.Runtime.Serialization.SerializationException: Type >> 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, >> Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not >> marked as serializable. >> at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) >> at IronPythonShell.Program.Main(String[] args) in >> B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 >> >> It's a little beyond odd to me, but like I said before I fear I don't >> fully understand what's going on behind the goo. The only consolation is >> that I can at least built out my scripting system in working form and later >> run it under a more trusted domain for production by simply removing the >> domain from the Runtime.Create() constructor and then adding it later. (At >> least, I hope this is the case) >> >> --- >> Leo C. >> >> On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde wrote: >> >>> The CLR doesn't dump out full exception information on >>> SecurityExceptions in partial trust ? you can get a lot more information if >>> you look at the exception in a debugger, or if you Assert for FullTrust >>> before doing a ToString on the permission. Once you do that, you should be >>> able to get more data including the demanded permission and the assembly >>> which caused the demand to fail, instead of the message saying "The >>> granted set of the failing assembly was:" which does not say which >>> assembly is causing the problem. >>> >>> >>> >>> Also, can you try adding IronPython.dll and IronPython.Modules.dll to the >>> fullTrustAssemblies argument to AppDomain.CreateDomain >>> ? >>> >>> >>> >>> Thanks, >>> >>> Shri >>> >>> >>> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Program.cs URL: From desleo at gmail.com Wed Sep 3 03:32:56 2008 From: desleo at gmail.com (Leo Carbajal) Date: Tue, 2 Sep 2008 20:32:56 -0500 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Ok, so I think I misunderstood what a LinkDemand was, as well as the fact that the exception I'm getting is expected behavior. I added the [assembly: AllowPartiallyTrustedCallers] attribute to my assembly and now things work fine outside of the debug environment. From what I (now) understand, using the LinkDemand attribute is so that the partially trusted assembly (i.e. the scripts) *can't* access that method. Does that sound right to you guru types? To test this I imported System.Windows.Forms and tried to call the MessageBox.Show() method which failed while running in the domain, as expected. When I removed the LinkDemand from the ScriptableItem class the calls to it in the script also worked fine. So all I have to do is decorate the classes I don't want to be imported from my assembly into the script with LinkDemands, I think? Is there some way to reverse that, I.E. some way that I can decorate the classes I want to be accessible rather than the other way around? I suppose another alternative is to create the ScriptableItem wrappers in their own assembly and just reference that, as well as make it callable by partially trusted callers, while leaving my own assembly alone and thus off-limits to an import. I will play with it some more, I think. I'm sorry to have wasted some of your time. =\ --- LC On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal wrote: > This is a condensed version. You'll have to sign the assembly or you'll get > an error at the domain creation step, other than that this should run just > by starting a new console application, adding the IPY and DLR DLLs, and then > copying and pasting this file over the default generated code. > > Even after starting a new project to make sure my sample builds I still > observe the same behavior. > > --- > LC > > > On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher wrote: > >> Do you have a simple reproduction that doesn't include any of your >> domain-specific code? >> >> On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: >> >>> So here's a strange wrinkle, >>> >>> when I run this with the debugger (unmodified except for adding the >>> IronPython assemblies as full-trust on the domain) it works fine and as >>> expected. If I run it without the debugger attached it gives me the same >>> exception as before, when I catch the exception myself I also get this >>> tidbit: >>> >>> The assembly or AppDomain that failed was: >>> Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, >>> PublicKeyToken=31bf3856ad364e35 >>> The Zone of the assembly that failed was: >>> MyComputer >>> The Url of the assembly that failed was: >>> >>> file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL >>> >>> If I build and compile the code as Release instead of Debug I get: >>> >>> System.Runtime.Serialization.SerializationException: Type >>> 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, >>> Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not >>> marked as serializable. >>> at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) >>> at IronPythonShell.Program.Main(String[] args) in >>> B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 >>> >>> It's a little beyond odd to me, but like I said before I fear I don't >>> fully understand what's going on behind the goo. The only consolation is >>> that I can at least built out my scripting system in working form and later >>> run it under a more trusted domain for production by simply removing the >>> domain from the Runtime.Create() constructor and then adding it later. (At >>> least, I hope this is the case) >>> >>> --- >>> Leo C. >>> >>> On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde wrote: >>> >>>> The CLR doesn't dump out full exception information on >>>> SecurityExceptions in partial trust ? you can get a lot more information if >>>> you look at the exception in a debugger, or if you Assert for FullTrust >>>> before doing a ToString on the permission. Once you do that, you should be >>>> able to get more data including the demanded permission and the assembly >>>> which caused the demand to fail, instead of the message saying "The >>>> granted set of the failing assembly was:" which does not say which >>>> assembly is causing the problem. >>>> >>>> >>>> >>>> Also, can you try adding IronPython.dll and IronPython.Modules.dll to >>>> the fullTrustAssemblies argument to AppDomain.CreateDomain >>>> ? >>>> >>>> >>>> >>>> Thanks, >>>> >>>> Shri >>>> >>>> >>>> >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Sep 3 04:10:55 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 2 Sep 2008 19:10:55 -0700 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <8cd017b80808230905p6a58461eva1d66bc771704e86@mail.gmail.com> <6f4025010808231144u43a87eb7r9b0b2099fad9a4ef@mail.gmail.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> To avoid the link demands you can mark your assembly as being SecurityTransparent - see http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will force link demands from your assembly to turn into full demands which will fail when they hit the untrusted script code. And full demands will of course also fail normally. Also just a couple of other comments: You (probably) shouldn't be marking IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core as full trust - we're also security critical so we don't need to be trusted at all. You also probably don't want to be granting reflection or file-io - pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient for what you're doing so far. Finally if you need to occasionally elevate permissions in your object model you can mark your assembly as SecurityCritical and then have individual methods which are audited and elevate appropriately. But you also might just want to restrict the surface area by not having many public types other than the object model you're exposing. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Tuesday, September 02, 2008 6:33 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports Ok, so I think I misunderstood what a LinkDemand was, as well as the fact that the exception I'm getting is expected behavior. I added the [assembly: AllowPartiallyTrustedCallers] attribute to my assembly and now things work fine outside of the debug environment. From what I (now) understand, using the LinkDemand attribute is so that the partially trusted assembly (i.e. the scripts) can't access that method. Does that sound right to you guru types? To test this I imported System.Windows.Forms and tried to call the MessageBox.Show() method which failed while running in the domain, as expected. When I removed the LinkDemand from the ScriptableItem class the calls to it in the script also worked fine. So all I have to do is decorate the classes I don't want to be imported from my assembly into the script with LinkDemands, I think? Is there some way to reverse that, I.E. some way that I can decorate the classes I want to be accessible rather than the other way around? I suppose another alternative is to create the ScriptableItem wrappers in their own assembly and just reference that, as well as make it callable by partially trusted callers, while leaving my own assembly alone and thus off-limits to an import. I will play with it some more, I think. I'm sorry to have wasted some of your time. =\ --- LC On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal > wrote: This is a condensed version. You'll have to sign the assembly or you'll get an error at the domain creation step, other than that this should run just by starting a new console application, adding the IPY and DLR DLLs, and then copying and pasting this file over the default generated code. Even after starting a new project to make sure my sample builds I still observe the same behavior. --- LC On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher > wrote: Do you have a simple reproduction that doesn't include any of your domain-specific code? On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal > wrote: So here's a strange wrinkle, when I run this with the debugger (unmodified except for adding the IronPython assemblies as full-trust on the domain) it works fine and as expected. If I run it without the debugger attached it gives me the same exception as before, when I catch the exception myself I also get this tidbit: The assembly or AppDomain that failed was: Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35 The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL If I build and compile the code as Release instead of Debug I get: System.Runtime.Serialization.SerializationException: Type 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable. at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at IronPythonShell.Program.Main(String[] args) in B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 It's a little beyond odd to me, but like I said before I fear I don't fully understand what's going on behind the goo. The only consolation is that I can at least built out my scripting system in working form and later run it under a more trusted domain for production by simply removing the domain from the Runtime.Create() constructor and then adding it later. (At least, I hope this is the case) --- Leo C. On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde > wrote: The CLR doesn't dump out full exception information on SecurityExceptions in partial trust - you can get a lot more information if you look at the exception in a debugger, or if you Assert for FullTrust before doing a ToString on the permission. Once you do that, you should be able to get more data including the demanded permission and the assembly which caused the demand to fail, instead of the message saying "The granted set of the failing assembly was:" which does not say which assembly is causing the problem. Also, can you try adding IronPython.dll and IronPython.Modules.dll to the fullTrustAssemblies argument to AppDomain.CreateDomain? Thanks, Shri _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From desleo at gmail.com Wed Sep 3 04:26:18 2008 From: desleo at gmail.com (Leo Carbajal) Date: Tue, 2 Sep 2008 21:26:18 -0500 Subject: [IronPython] Re strict imports In-Reply-To: <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <19113682.post@talk.nabble.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: Dino, Thanks for the advice on Security Transparent. The IO permission seems necessary in order to load scripts from a file, as is the actual plan in the end - the example I attached not withstanding. Also, for some reason scripts fail unless I grant the UnmanagedCode flag, in addition to Execution. This is kind of problematic since UnmanagedCode allows me to do: import clr clr.AddReference("mscorlib.dll") import System from System import Environment Environment.Exit(9) Which I think is kinda bad. =\ Without UnmanagedCode imports don't work and even this won't work: i = 200 while i > 0: i = i - 1 print "Done in the second verse. Yes?" Print by itself works, though, and other functions such as Environment.CommandLine and such are correctly stopped unless called through a method I expose that asserts the appropriate permission set. Still, that Exit thing is rather crippling. Unfortunately the application I'm building will be run by the type of people that have too much time on their hands, I'm not sure how to plug that kind of hole without resorting to filtering each file for 'naughty' commands. --- LC On Tue, Sep 2, 2008 at 9:10 PM, Dino Viehland wrote: > To avoid the link demands you can mark your assembly as being > SecurityTransparent ? see > http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will > force link demands from your assembly to turn into full demands which will > fail when they hit the untrusted script code. And full demands will of > course also fail normally. > > > > Also just a couple of other comments: You (probably) shouldn't be marking > IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core > as full trust ? we're also security critical so we don't need to be trusted > at all. You also probably don't want to be granting reflection or file-io ? > pset.AddPermission(new > SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient > for what you're doing so far. > > > > Finally if you need to occasionally elevate permissions in your object > model you can mark your assembly as SecurityCritical and then have > individual methods which are audited and elevate appropriately. But you > also might just want to restrict the surface area by not having many public > types other than the object model you're exposing. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal > *Sent:* Tuesday, September 02, 2008 6:33 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Re strict imports > > > > Ok, so I think I misunderstood what a LinkDemand was, as well as the fact > that the exception I'm getting is expected behavior. > > > I added the [assembly: AllowPartiallyTrustedCallers] attribute to my > assembly and now things work fine outside of the debug environment. From > what I (now) understand, using the LinkDemand attribute is so that the > partially trusted assembly (i.e. the scripts) *can't* access that method. > Does that sound right to you guru types? To test this I imported > System.Windows.Forms and tried to call the MessageBox.Show() method which > failed while running in the domain, as expected. When I removed the > LinkDemand from the ScriptableItem class the calls to it in the script also > worked fine. > > So all I have to do is decorate the classes I don't want to be imported > from my assembly into the script with LinkDemands, I think? Is there some > way to reverse that, I.E. some way that I can decorate the classes I want to > be accessible rather than the other way around? I suppose another > alternative is to create the ScriptableItem wrappers in their own assembly > and just reference that, as well as make it callable by partially trusted > callers, while leaving my own assembly alone and thus off-limits to an > import. > > I will play with it some more, I think. I'm sorry to have wasted some of > your time. =\ > > --- > LC > > On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal wrote: > > This is a condensed version. You'll have to sign the assembly or you'll get > an error at the domain creation step, other than that this should run just > by starting a new console application, adding the IPY and DLR DLLs, and then > copying and pasting this file over the default generated code. > > Even after starting a new project to make sure my sample builds I still > observe the same behavior. > > --- > LC > > > > On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher > wrote: > > Do you have a simple reproduction that doesn't include any of your > domain-specific code? > > On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: > > So here's a strange wrinkle, > > when I run this with the debugger (unmodified except for adding the > IronPython assemblies as full-trust on the domain) it works fine and as > expected. If I run it without the debugger attached it gives me the same > exception as before, when I catch the exception myself I also get this > tidbit: > > The assembly or AppDomain that failed was: > Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, > PublicKeyToken=31bf3856ad364e35 > The Zone of the assembly that failed was: > MyComputer > The Url of the assembly that failed was: > > file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL > > If I build and compile the code as Release instead of Debug I get: > > System.Runtime.Serialization.SerializationException: Type > 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, > Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not > marked as serializable. > > > at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) > > at IronPythonShell.Program.Main(String[] args) in > B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 > > It's a little beyond odd to me, but like I said before I fear I don't fully > understand what's going on behind the goo. The only consolation is that I > can at least built out my scripting system in working form and later run it > under a more trusted domain for production by simply removing the domain > from the Runtime.Create() constructor and then adding it later. (At least, I > hope this is the case) > > --- > Leo C. > > > > On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde > wrote: > > The CLR doesn't dump out full exception information on SecurityExceptions > in partial trust ? you can get a lot more information if you look at the > exception in a debugger, or if you Assert for FullTrust before doing a > ToString on the permission. Once you do that, you should be able to get > more data including the demanded permission and the assembly which caused > the demand to fail, instead of the message saying "The granted set of the > failing assembly was:" which does not say which assembly is causing the > problem. > > > > Also, can you try adding IronPython.dll and IronPython.Modules.dll to the > fullTrustAssemblies argument to AppDomain.CreateDomain > ? > > > > Thanks, > > Shri > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Sep 3 04:49:47 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 2 Sep 2008 19:49:47 -0700 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <8cd017b80808240256u57444c0cpdf99717475d763f3@mail.gmail.com> <48B2F26A.2040501@voidspace.org.uk> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC2355421A58A8E5@NA-EXMSG-C102.redmond.corp.microsoft.com> To allow access to the imports the next step in this will be providing your own PlatformAdapationLayer. You'll need to subclass ScriptHost and specify that type as the HostType for a ScriptRuntimeSetup. Your PAL can then provide access to a limited file system or a virtual file system from which the files are imported. All of the IronPython import logic will then go through the PAL - you could check out the Silverlight PAL (BrowserPAL.cs) for an example. For me the loop/print is working w/ just Execution permission. I've just taken your original Program.cs, added APTCA, restricted the permissions to Execution, and removed full trust from the Ipy/DLR DLLs. What's the stack trace of the exception here? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Tuesday, September 02, 2008 7:26 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports Dino, Thanks for the advice on Security Transparent. The IO permission seems necessary in order to load scripts from a file, as is the actual plan in the end - the example I attached not withstanding. Also, for some reason scripts fail unless I grant the UnmanagedCode flag, in addition to Execution. This is kind of problematic since UnmanagedCode allows me to do: import clr clr.AddReference("mscorlib.dll") import System from System import Environment Environment.Exit(9) Which I think is kinda bad. =\ Without UnmanagedCode imports don't work and even this won't work: i = 200 while i > 0: i = i - 1 print "Done in the second verse. Yes?" Print by itself works, though, and other functions such as Environment.CommandLine and such are correctly stopped unless called through a method I expose that asserts the appropriate permission set. Still, that Exit thing is rather crippling. Unfortunately the application I'm building will be run by the type of people that have too much time on their hands, I'm not sure how to plug that kind of hole without resorting to filtering each file for 'naughty' commands. --- LC On Tue, Sep 2, 2008 at 9:10 PM, Dino Viehland > wrote: To avoid the link demands you can mark your assembly as being SecurityTransparent - see http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will force link demands from your assembly to turn into full demands which will fail when they hit the untrusted script code. And full demands will of course also fail normally. Also just a couple of other comments: You (probably) shouldn't be marking IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core as full trust - we're also security critical so we don't need to be trusted at all. You also probably don't want to be granting reflection or file-io - pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient for what you're doing so far. Finally if you need to occasionally elevate permissions in your object model you can mark your assembly as SecurityCritical and then have individual methods which are audited and elevate appropriately. But you also might just want to restrict the surface area by not having many public types other than the object model you're exposing. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Tuesday, September 02, 2008 6:33 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports Ok, so I think I misunderstood what a LinkDemand was, as well as the fact that the exception I'm getting is expected behavior. I added the [assembly: AllowPartiallyTrustedCallers] attribute to my assembly and now things work fine outside of the debug environment. From what I (now) understand, using the LinkDemand attribute is so that the partially trusted assembly (i.e. the scripts) can't access that method. Does that sound right to you guru types? To test this I imported System.Windows.Forms and tried to call the MessageBox.Show() method which failed while running in the domain, as expected. When I removed the LinkDemand from the ScriptableItem class the calls to it in the script also worked fine. So all I have to do is decorate the classes I don't want to be imported from my assembly into the script with LinkDemands, I think? Is there some way to reverse that, I.E. some way that I can decorate the classes I want to be accessible rather than the other way around? I suppose another alternative is to create the ScriptableItem wrappers in their own assembly and just reference that, as well as make it callable by partially trusted callers, while leaving my own assembly alone and thus off-limits to an import. I will play with it some more, I think. I'm sorry to have wasted some of your time. =\ --- LC On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal > wrote: This is a condensed version. You'll have to sign the assembly or you'll get an error at the domain creation step, other than that this should run just by starting a new console application, adding the IPY and DLR DLLs, and then copying and pasting this file over the default generated code. Even after starting a new project to make sure my sample builds I still observe the same behavior. --- LC On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher > wrote: Do you have a simple reproduction that doesn't include any of your domain-specific code? On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal > wrote: So here's a strange wrinkle, when I run this with the debugger (unmodified except for adding the IronPython assemblies as full-trust on the domain) it works fine and as expected. If I run it without the debugger attached it gives me the same exception as before, when I catch the exception myself I also get this tidbit: The assembly or AppDomain that failed was: Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35 The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL If I build and compile the code as Release instead of Debug I get: System.Runtime.Serialization.SerializationException: Type 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable. at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at IronPythonShell.Program.Main(String[] args) in B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 It's a little beyond odd to me, but like I said before I fear I don't fully understand what's going on behind the goo. The only consolation is that I can at least built out my scripting system in working form and later run it under a more trusted domain for production by simply removing the domain from the Runtime.Create() constructor and then adding it later. (At least, I hope this is the case) --- Leo C. On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde > wrote: The CLR doesn't dump out full exception information on SecurityExceptions in partial trust - you can get a lot more information if you look at the exception in a debugger, or if you Assert for FullTrust before doing a ToString on the permission. Once you do that, you should be able to get more data including the demanded permission and the assembly which caused the demand to fail, instead of the message saying "The granted set of the failing assembly was:" which does not say which assembly is causing the problem. Also, can you try adding IronPython.dll and IronPython.Modules.dll to the fullTrustAssemblies argument to AppDomain.CreateDomain? Thanks, Shri _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at mcneel.com Wed Sep 3 05:01:31 2008 From: steve at mcneel.com (Steve Baer) Date: Tue, 2 Sep 2008 20:01:31 -0700 Subject: [IronPython] Problem calling proper version of function Message-ID: <231B443E702245069D0C7EA4108635D1@mcneel.com> This may just be how Python works, but I wanted to check with you guys first. Say I have an assembly named MyLibrary that contains the following code: namespace MyLibrary { public interface IMyInterface { string MyProperty{ get;} } public class MyClass : IMyInterface { string IMyInterface.MyProperty { get { return "MyInterface version of MyProperty"; } } public string MyProperty { get { return "MyClass version of MyProperty"; } } public static IMyInterface GetInterface(){ return new MyClass();} public static MyClass GetClass() { return new MyClass(); } } } ------------------------------------------------------------- A console application with the following code MyLibrary.IMyInterface a = MyLibrary.MyClass.GetInterface(); Console.WriteLine("MyInterface call = " + a.MyProperty); MyLibrary.MyClass b = MyLibrary.MyClass.GetClass(); Console.WriteLine("MyClass call = " + b.MyProperty); Will produce the following output: MyInterface call = MyInterface version of MyProperty MyClass call = MyClass version of MyProperty ------------------------------------------------------------- Now if I use IronPython and write a script that looks like the following import clr clr.AddReference("MyLibrary") import MyLibrary a = MyLibrary.MyClass.GetInterface() print "MyInterface call = ", a.MyProperty b = MyLibrary.MyClass.GetClass() print "MyClass call = ", b.MyProperty The output of this script is MyInterface call = MyClass version of MyProperty MyClass call = MyClass version of MyProperty I've been testing IronPython on our CAD application and everything has been working great except for this issue. It is actually a pretty big issue for me because the way I wrapped our C++ SDK for .NET uses this feature quite a bit. If this is the expected result in python, is there a way to force the interface version of the property_get function to be called? Thanks, -Steve Steve Baer Robert McNeel & Associates www.rhino3d.com www.mcneel.com From dinov at microsoft.com Wed Sep 3 05:22:46 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 2 Sep 2008 20:22:46 -0700 Subject: [IronPython] Problem calling proper version of function In-Reply-To: <231B443E702245069D0C7EA4108635D1@mcneel.com> References: <231B443E702245069D0C7EA4108635D1@mcneel.com> Message-ID: <350E7D38B6D819428718949920EC2355421A58A8FC@NA-EXMSG-C102.redmond.corp.microsoft.com> We never have strong typing so we'll never see the difference between GetInterface() and GetClass(). Instead we'll always just see that we have a MyClass and do the lookup based upon that. The worst case scenario here is you'll need to do IMyInterface.MyProperty.GetValue(instance). OTOH if you can make MyClass or "public string MyProperty" internal then they'd just not be visible to IronPython. That'd mean we'd pick up the explicit interface implementation as of the IronPython 2.0B4 I believe. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steve Baer Sent: Tuesday, September 02, 2008 8:02 PM To: Users at lists.ironpython.com Subject: [IronPython] Problem calling proper version of function This may just be how Python works, but I wanted to check with you guys first. Say I have an assembly named MyLibrary that contains the following code: namespace MyLibrary { public interface IMyInterface { string MyProperty{ get;} } public class MyClass : IMyInterface { string IMyInterface.MyProperty { get { return "MyInterface version of MyProperty"; } } public string MyProperty { get { return "MyClass version of MyProperty"; } } public static IMyInterface GetInterface(){ return new MyClass();} public static MyClass GetClass() { return new MyClass(); } } } ------------------------------------------------------------- A console application with the following code MyLibrary.IMyInterface a = MyLibrary.MyClass.GetInterface(); Console.WriteLine("MyInterface call = " + a.MyProperty); MyLibrary.MyClass b = MyLibrary.MyClass.GetClass(); Console.WriteLine("MyClass call = " + b.MyProperty); Will produce the following output: MyInterface call = MyInterface version of MyProperty MyClass call = MyClass version of MyProperty ------------------------------------------------------------- Now if I use IronPython and write a script that looks like the following import clr clr.AddReference("MyLibrary") import MyLibrary a = MyLibrary.MyClass.GetInterface() print "MyInterface call = ", a.MyProperty b = MyLibrary.MyClass.GetClass() print "MyClass call = ", b.MyProperty The output of this script is MyInterface call = MyClass version of MyProperty MyClass call = MyClass version of MyProperty I've been testing IronPython on our CAD application and everything has been working great except for this issue. It is actually a pretty big issue for me because the way I wrapped our C++ SDK for .NET uses this feature quite a bit. If this is the expected result in python, is there a way to force the interface version of the property_get function to be called? Thanks, -Steve Steve Baer Robert McNeel & Associates www.rhino3d.com www.mcneel.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From desleo at gmail.com Wed Sep 3 06:06:01 2008 From: desleo at gmail.com (Leo Carbajal) Date: Tue, 2 Sep 2008 23:06:01 -0500 Subject: [IronPython] Re strict imports In-Reply-To: <350E7D38B6D819428718949920EC2355421A58A8E5@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <19113682.post@talk.nabble.com> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8E5@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: The PAL stuff looks scary! Ok, not really, but I'll have to look at it when I'm not close to falling asleep. The benefits here are pretty nice, but probably not something I want to muck with half-heartedly. The stack trace for this one is as follows: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. *at System.Scripting.Com.ComMetaObject.IsComObject(Object obj)* at System.Scripting.Actions.MetaAction.Bind[T](Object[] args) at System.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 originalMonomorphicRule, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at $1##1(Closure , Scope , LanguageContext ) at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at IronPythonShell.Program.Main(String[] args) in C:\Users\Leo\Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 63 The action that failed was: LinkDemand The type of the first permission that failed was: System.Security.Permissions.SecurityPermission The first permission that failed was: I'm running the exact same file you mentioned, with the exact same changes to the assembly. I'll paste it here, in case I'm missing something ridiculously obvious, since the contents of the Main method are now rather small: PermissionSet pset = new PermissionSet(PermissionState.None); pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); pset.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); pset.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, AppDomain.CurrentDomain.BaseDirectory)); AppDomainSetup domainSetup = new AppDomainSetup(); domainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; // create the sandboxed domain AppDomain sandbox = AppDomain.CreateDomain( "Sandboxed Domain", AppDomain.CurrentDomain.Evidence, domainSetup, pset, CreateStrongName(Assembly.GetExecutingAssembly())); StringBuilder script = new StringBuilder(); script.AppendLine("i = 200"); script.AppendLine("while i > 0: i = i - 1"); script.AppendLine("print \"Done in the second verse. Yes?\""); try { ScriptRuntime runtime = ScriptRuntime.Create(sandbox); ScriptEngine engine = runtime.GetEngineByFileExtension("py"); ScriptScope scope = engine.CreateScope(); ScriptSource source = engine.CreateScriptSourceFromString(script.ToString(), System.Scripting.SourceCodeKind.Statements); source.Execute(scope); } catch (Exception e) { Console.WriteLine(e); } Console.ReadKey(); On Tue, Sep 2, 2008 at 9:49 PM, Dino Viehland wrote: > To allow access to the imports the next step in this will be providing > your own PlatformAdapationLayer. You'll need to subclass ScriptHost and > specify that type as the HostType for a ScriptRuntimeSetup. Your PAL can > then provide access to a limited file system or a virtual file system from > which the files are imported. All of the IronPython import logic will then > go through the PAL ? you could check out the Silverlight PAL (BrowserPAL.cs) > for an example. > > > > For me the loop/print is working w/ just Execution permission. I've just > taken your original Program.cs, added APTCA, restricted the permissions to > Execution, and removed full trust from the Ipy/DLR DLLs. What's the stack > trace of the exception here? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal > *Sent:* Tuesday, September 02, 2008 7:26 PM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Re strict imports > > > > Dino, > > Thanks for the advice on Security Transparent. The IO permission seems > necessary in order to load scripts from a file, as is the actual plan in the > end - the example I attached not withstanding. Also, for some reason scripts > fail unless I grant the UnmanagedCode flag, in addition to Execution. This > is kind of problematic since UnmanagedCode allows me to do: > > import clr > clr.AddReference("mscorlib.dll") > import System > from System import Environment > Environment.Exit(9) > > Which I think is kinda bad. =\ > > Without UnmanagedCode imports don't work and even this won't work: > > i = 200 > while i > 0: > i = i - 1 > print "Done in the second verse. Yes?" > > Print by itself works, though, and other functions such as > Environment.CommandLine and such are correctly stopped unless called through > a method I expose that asserts the appropriate permission set. Still, that > Exit thing is rather crippling. Unfortunately the application I'm building > will be run by the type of people that have too much time on their hands, > I'm not sure how to plug that kind of hole without resorting to filtering > each file for 'naughty' commands. > > --- > LC > > On Tue, Sep 2, 2008 at 9:10 PM, Dino Viehland wrote: > > To avoid the link demands you can mark your assembly as being > SecurityTransparent ? see > http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will > force link demands from your assembly to turn into full demands which will > fail when they hit the untrusted script code. And full demands will of > course also fail normally. > > > > Also just a couple of other comments: You (probably) shouldn't be marking > IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core > as full trust ? we're also security critical so we don't need to be trusted > at all. You also probably don't want to be granting reflection or file-io ? > pset.AddPermission(new > SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient > for what you're doing so far. > > > > Finally if you need to occasionally elevate permissions in your object > model you can mark your assembly as SecurityCritical and then have > individual methods which are audited and elevate appropriately. But you > also might just want to restrict the surface area by not having many public > types other than the object model you're exposing. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal > *Sent:* Tuesday, September 02, 2008 6:33 PM > > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Re strict imports > > > > Ok, so I think I misunderstood what a LinkDemand was, as well as the fact > that the exception I'm getting is expected behavior. > > > > I added the [assembly: AllowPartiallyTrustedCallers] attribute to my > assembly and now things work fine outside of the debug environment. From > what I (now) understand, using the LinkDemand attribute is so that the > partially trusted assembly (i.e. the scripts) *can't* access that method. > Does that sound right to you guru types? To test this I imported > System.Windows.Forms and tried to call the MessageBox.Show() method which > failed while running in the domain, as expected. When I removed the > LinkDemand from the ScriptableItem class the calls to it in the script also > worked fine. > > So all I have to do is decorate the classes I don't want to be imported > from my assembly into the script with LinkDemands, I think? Is there some > way to reverse that, I.E. some way that I can decorate the classes I want to > be accessible rather than the other way around? I suppose another > alternative is to create the ScriptableItem wrappers in their own assembly > and just reference that, as well as make it callable by partially trusted > callers, while leaving my own assembly alone and thus off-limits to an > import. > > I will play with it some more, I think. I'm sorry to have wasted some of > your time. =\ > > --- > LC > > On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal wrote: > > This is a condensed version. You'll have to sign the assembly or you'll get > an error at the domain creation step, other than that this should run just > by starting a new console application, adding the IPY and DLR DLLs, and then > copying and pasting this file over the default generated code. > > Even after starting a new project to make sure my sample builds I still > observe the same behavior. > > --- > LC > > > > On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher > wrote: > > Do you have a simple reproduction that doesn't include any of your > domain-specific code? > > On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: > > So here's a strange wrinkle, > > when I run this with the debugger (unmodified except for adding the > IronPython assemblies as full-trust on the domain) it works fine and as > expected. If I run it without the debugger attached it gives me the same > exception as before, when I catch the exception myself I also get this > tidbit: > > The assembly or AppDomain that failed was: > Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, > PublicKeyToken=31bf3856ad364e35 > The Zone of the assembly that failed was: > MyComputer > The Url of the assembly that failed was: > > file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL > > If I build and compile the code as Release instead of Debug I get: > > System.Runtime.Serialization.SerializationException: Type > 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, > Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not > marked as serializable. > > > at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) > > at IronPythonShell.Program.Main(String[] args) in > B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 > > It's a little beyond odd to me, but like I said before I fear I don't fully > understand what's going on behind the goo. The only consolation is that I > can at least built out my scripting system in working form and later run it > under a more trusted domain for production by simply removing the domain > from the Runtime.Create() constructor and then adding it later. (At least, I > hope this is the case) > > --- > Leo C. > > > > On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde > wrote: > > The CLR doesn't dump out full exception information on SecurityExceptions > in partial trust ? you can get a lot more information if you look at the > exception in a debugger, or if you Assert for FullTrust before doing a > ToString on the permission. Once you do that, you should be able to get > more data including the demanded permission and the assembly which caused > the demand to fail, instead of the message saying "The granted set of the > failing assembly was:" which does not say which assembly is causing the > problem. > > > > Also, can you try adding IronPython.dll and IronPython.Modules.dll to the > fullTrustAssemblies argument to AppDomain.CreateDomain > ? > > > > Thanks, > > Shri > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at mcneel.com Wed Sep 3 06:20:23 2008 From: steve at mcneel.com (Steve Baer) Date: Tue, 2 Sep 2008 21:20:23 -0700 Subject: [IronPython] Problem calling proper version of function In-Reply-To: <350E7D38B6D819428718949920EC2355421A58A8FC@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <231B443E702245069D0C7EA4108635D1@mcneel.com> <350E7D38B6D819428718949920EC2355421A58A8FC@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <15763A71325B4BDC9A8B9A5D3326FD9B@mcneel.com> Hi Dino, Thanks for the quick feedback. That's what I had feared may be the answer. I'll just have to rethink how we'll make IronPython available to Rhino. It is good to know that there is an alternate way to call the interface property. Thanks, -Steve Steve Baer Robert McNeel & Associates www.rhino3d.com www.mcneel.com ----- Original Message ----- From: "Dino Viehland" To: "Discussion of IronPython" Sent: Tuesday, September 02, 2008 8:22 PM Subject: Re: [IronPython] Problem calling proper version of function > We never have strong typing so we'll never see the difference between > GetInterface() and GetClass(). Instead we'll always just see that we have > a MyClass and do the lookup based upon that. The worst case scenario here > is you'll need to do IMyInterface.MyProperty.GetValue(instance). > > OTOH if you can make MyClass or "public string MyProperty" internal then > they'd just not be visible to IronPython. That'd mean we'd pick up the > explicit interface implementation as of the IronPython 2.0B4 I believe. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steve Baer > Sent: Tuesday, September 02, 2008 8:02 PM > To: Users at lists.ironpython.com > Subject: [IronPython] Problem calling proper version of function > > This may just be how Python works, but I wanted to check with you guys > first. > > Say I have an assembly named MyLibrary that contains the following code: > namespace MyLibrary > { > public interface IMyInterface > { > string MyProperty{ get;} > } > public class MyClass : IMyInterface > { > string IMyInterface.MyProperty > { > get { return "MyInterface version of MyProperty"; } > } > public string MyProperty > { > get { return "MyClass version of MyProperty"; } > } > public static IMyInterface GetInterface(){ return new MyClass();} > public static MyClass GetClass() { return new MyClass(); } > } > } > ------------------------------------------------------------- > A console application with the following code > MyLibrary.IMyInterface a = MyLibrary.MyClass.GetInterface(); > Console.WriteLine("MyInterface call = " + a.MyProperty); > MyLibrary.MyClass b = MyLibrary.MyClass.GetClass(); > Console.WriteLine("MyClass call = " + b.MyProperty); > > Will produce the following output: > MyInterface call = MyInterface version of MyProperty > MyClass call = MyClass version of MyProperty > ------------------------------------------------------------- > > Now if I use IronPython and write a script that looks like the following > > import clr > clr.AddReference("MyLibrary") > import MyLibrary > a = MyLibrary.MyClass.GetInterface() > print "MyInterface call = ", a.MyProperty > b = MyLibrary.MyClass.GetClass() > print "MyClass call = ", b.MyProperty > > The output of this script is > MyInterface call = MyClass version of MyProperty > MyClass call = MyClass version of MyProperty > > I've been testing IronPython on our CAD application and everything has > been > working great except for this issue. It is actually a pretty big issue for > me because the way I wrapped our C++ SDK for .NET uses this feature quite > a > bit. If this is the expected result in python, is there a way to force the > interface version of the property_get function to be called? > > Thanks, > -Steve > > Steve Baer > Robert McNeel & Associates > www.rhino3d.com > www.mcneel.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at microsoft.com Wed Sep 3 06:44:30 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 2 Sep 2008 21:44:30 -0700 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <710DF26F214D2B4BB94287123FFE980A229951C9A1@NA-EXMSG-C104.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8E5@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC2355421A58A922@NA-EXMSG-C102.redmond.corp.microsoft.com> I thought that one had gotten fixed but maybe it hasn't or maybe it changed while I'm on vacation - I was looking at beta 4 sources and removing the things I thought we had changed since then. Either way it should be easy to fix but I'll have to talk to the DLR guys when I'm back from vacation on Thursday :) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Tuesday, September 02, 2008 9:06 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports The PAL stuff looks scary! Ok, not really, but I'll have to look at it when I'm not close to falling asleep. The benefits here are pretty nice, but probably not something I want to muck with half-heartedly. The stack trace for this one is as follows: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Scripting.Com.ComMetaObject.IsComObject(Object obj) at System.Scripting.Actions.MetaAction.Bind[T](Object[] args) at System.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 originalMonomorphicRule, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at $1##1(Closure , Scope , LanguageContext ) at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at IronPythonShell.Program.Main(String[] args) in C:\Users\Leo\Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 63 The action that failed was: LinkDemand The type of the first permission that failed was: System.Security.Permissions.SecurityPermission The first permission that failed was: I'm running the exact same file you mentioned, with the exact same changes to the assembly. I'll paste it here, in case I'm missing something ridiculously obvious, since the contents of the Main method are now rather small: PermissionSet pset = new PermissionSet(PermissionState.None); pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); pset.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); pset.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, AppDomain.CurrentDomain.BaseDirectory)); AppDomainSetup domainSetup = new AppDomainSetup(); domainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; // create the sandboxed domain AppDomain sandbox = AppDomain.CreateDomain( "Sandboxed Domain", AppDomain.CurrentDomain.Evidence, domainSetup, pset, CreateStrongName(Assembly.GetExecutingAssembly())); StringBuilder script = new StringBuilder(); script.AppendLine("i = 200"); script.AppendLine("while i > 0: i = i - 1"); script.AppendLine("print \"Done in the second verse. Yes?\""); try { ScriptRuntime runtime = ScriptRuntime.Create(sandbox); ScriptEngine engine = runtime.GetEngineByFileExtension("py"); ScriptScope scope = engine.CreateScope(); ScriptSource source = engine.CreateScriptSourceFromString(script.ToString(), System.Scripting.SourceCodeKind.Statements); source.Execute(scope); } catch (Exception e) { Console.WriteLine(e); } Console.ReadKey(); On Tue, Sep 2, 2008 at 9:49 PM, Dino Viehland > wrote: To allow access to the imports the next step in this will be providing your own PlatformAdapationLayer. You'll need to subclass ScriptHost and specify that type as the HostType for a ScriptRuntimeSetup. Your PAL can then provide access to a limited file system or a virtual file system from which the files are imported. All of the IronPython import logic will then go through the PAL - you could check out the Silverlight PAL (BrowserPAL.cs) for an example. For me the loop/print is working w/ just Execution permission. I've just taken your original Program.cs, added APTCA, restricted the permissions to Execution, and removed full trust from the Ipy/DLR DLLs. What's the stack trace of the exception here? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Tuesday, September 02, 2008 7:26 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports Dino, Thanks for the advice on Security Transparent. The IO permission seems necessary in order to load scripts from a file, as is the actual plan in the end - the example I attached not withstanding. Also, for some reason scripts fail unless I grant the UnmanagedCode flag, in addition to Execution. This is kind of problematic since UnmanagedCode allows me to do: import clr clr.AddReference("mscorlib.dll") import System from System import Environment Environment.Exit(9) Which I think is kinda bad. =\ Without UnmanagedCode imports don't work and even this won't work: i = 200 while i > 0: i = i - 1 print "Done in the second verse. Yes?" Print by itself works, though, and other functions such as Environment.CommandLine and such are correctly stopped unless called through a method I expose that asserts the appropriate permission set. Still, that Exit thing is rather crippling. Unfortunately the application I'm building will be run by the type of people that have too much time on their hands, I'm not sure how to plug that kind of hole without resorting to filtering each file for 'naughty' commands. --- LC On Tue, Sep 2, 2008 at 9:10 PM, Dino Viehland > wrote: To avoid the link demands you can mark your assembly as being SecurityTransparent - see http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will force link demands from your assembly to turn into full demands which will fail when they hit the untrusted script code. And full demands will of course also fail normally. Also just a couple of other comments: You (probably) shouldn't be marking IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core as full trust - we're also security critical so we don't need to be trusted at all. You also probably don't want to be granting reflection or file-io - pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient for what you're doing so far. Finally if you need to occasionally elevate permissions in your object model you can mark your assembly as SecurityCritical and then have individual methods which are audited and elevate appropriately. But you also might just want to restrict the surface area by not having many public types other than the object model you're exposing. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: Tuesday, September 02, 2008 6:33 PM To: Discussion of IronPython Subject: Re: [IronPython] Re strict imports Ok, so I think I misunderstood what a LinkDemand was, as well as the fact that the exception I'm getting is expected behavior. I added the [assembly: AllowPartiallyTrustedCallers] attribute to my assembly and now things work fine outside of the debug environment. From what I (now) understand, using the LinkDemand attribute is so that the partially trusted assembly (i.e. the scripts) can't access that method. Does that sound right to you guru types? To test this I imported System.Windows.Forms and tried to call the MessageBox.Show() method which failed while running in the domain, as expected. When I removed the LinkDemand from the ScriptableItem class the calls to it in the script also worked fine. So all I have to do is decorate the classes I don't want to be imported from my assembly into the script with LinkDemands, I think? Is there some way to reverse that, I.E. some way that I can decorate the classes I want to be accessible rather than the other way around? I suppose another alternative is to create the ScriptableItem wrappers in their own assembly and just reference that, as well as make it callable by partially trusted callers, while leaving my own assembly alone and thus off-limits to an import. I will play with it some more, I think. I'm sorry to have wasted some of your time. =\ --- LC On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal > wrote: This is a condensed version. You'll have to sign the assembly or you'll get an error at the domain creation step, other than that this should run just by starting a new console application, adding the IPY and DLR DLLs, and then copying and pasting this file over the default generated code. Even after starting a new project to make sure my sample builds I still observe the same behavior. --- LC On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher > wrote: Do you have a simple reproduction that doesn't include any of your domain-specific code? On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal > wrote: So here's a strange wrinkle, when I run this with the debugger (unmodified except for adding the IronPython assemblies as full-trust on the domain) it works fine and as expected. If I run it without the debugger attached it gives me the same exception as before, when I catch the exception myself I also get this tidbit: The assembly or AppDomain that failed was: Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35 The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL If I build and compile the code as Release instead of Debug I get: System.Runtime.Serialization.SerializationException: Type 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable. at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) at IronPythonShell.Program.Main(String[] args) in B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 It's a little beyond odd to me, but like I said before I fear I don't fully understand what's going on behind the goo. The only consolation is that I can at least built out my scripting system in working form and later run it under a more trusted domain for production by simply removing the domain from the Runtime.Create() constructor and then adding it later. (At least, I hope this is the case) --- Leo C. On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde > wrote: The CLR doesn't dump out full exception information on SecurityExceptions in partial trust - you can get a lot more information if you look at the exception in a debugger, or if you Assert for FullTrust before doing a ToString on the permission. Once you do that, you should be able to get more data including the demanded permission and the assembly which caused the demand to fail, instead of the message saying "The granted set of the failing assembly was:" which does not say which assembly is causing the problem. Also, can you try adding IronPython.dll and IronPython.Modules.dll to the fullTrustAssemblies argument to AppDomain.CreateDomain? Thanks, Shri _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Wed Sep 3 07:19:47 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 2 Sep 2008 22:19:47 -0700 Subject: [IronPython] Re strict imports In-Reply-To: <350E7D38B6D819428718949920EC2355421A58A922@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <19113682.post@talk.nabble.com> <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8E5@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A922@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: It was fixed post-beta 4, if I recall correctly. This should work if you download one of the nightly drops. On Tue, Sep 2, 2008 at 9:44 PM, Dino Viehland wrote: > I thought that one had gotten fixed but maybe it hasn't or maybe it > changed while I'm on vacation - I was looking at beta 4 sources and removing > the things I thought we had changed since then. Either way it should be > easy to fix but I'll have to talk to the DLR guys when I'm back from > vacation on Thursday J > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal > *Sent:* Tuesday, September 02, 2008 9:06 PM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Re strict imports > > > > The PAL stuff looks scary! Ok, not really, but I'll have to look at it when > I'm not close to falling asleep. The benefits here are pretty nice, but > probably not something I want to muck with half-heartedly. > > The stack trace for this one is as follows: > System.Security.SecurityException: Request for the permission of type > 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. > *at System.Scripting.Com.ComMetaObject.IsComObject(Object obj)* > at System.Scripting.Actions.MetaAction.Bind[T](Object[] args) > at System.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 > originalMonomorphicRule, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at $1##1(Closure , Scope , LanguageContext ) > at > System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) > at IronPythonShell.Program.Main(String[] args) in > C:\Users\Leo\Documents\Visual Studio > 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 63 > The action that failed was: > LinkDemand > The type of the first permission that failed was: > System.Security.Permissions.SecurityPermission > The first permission that failed was: > > > I'm running the exact same file you mentioned, with the exact same changes > to the assembly. I'll paste it here, in case I'm missing something > ridiculously obvious, since the contents of the Main method are now rather > small: > > PermissionSet pset = new PermissionSet(PermissionState.None); > pset.AddPermission(new > SecurityPermission(SecurityPermissionFlag.Execution)); > pset.AddPermission(new > ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); > pset.AddPermission(new > FileIOPermission(FileIOPermissionAccess.PathDiscovery | > FileIOPermissionAccess.Read, AppDomain.CurrentDomain.BaseDirectory)); > AppDomainSetup domainSetup = new AppDomainSetup(); > domainSetup.ApplicationBase = > AppDomain.CurrentDomain.BaseDirectory; > > // create the sandboxed domain > AppDomain sandbox = AppDomain.CreateDomain( > "Sandboxed Domain", > AppDomain.CurrentDomain.Evidence, > domainSetup, > pset, > CreateStrongName(Assembly.GetExecutingAssembly())); > > > StringBuilder script = new StringBuilder(); > script.AppendLine("i = 200"); > script.AppendLine("while i > 0: i = i - 1"); > script.AppendLine("print \"Done in the second verse. Yes?\""); > > try > { > ScriptRuntime runtime = > ScriptRuntime.Create(sandbox); > ScriptEngine engine = > runtime.GetEngineByFileExtension("py"); > ScriptScope scope = engine.CreateScope(); > > ScriptSource source = > engine.CreateScriptSourceFromString(script.ToString(), > System.Scripting.SourceCodeKind.Statements); > source.Execute(scope); > } > catch (Exception e) > { > Console.WriteLine(e); > } > > Console.ReadKey(); > > On Tue, Sep 2, 2008 at 9:49 PM, Dino Viehland > wrote: > > To allow access to the imports the next step in this will be providing your > own PlatformAdapationLayer. You'll need to subclass ScriptHost and specify > that type as the HostType for a ScriptRuntimeSetup. Your PAL can then > provide access to a limited file system or a virtual file system from which > the files are imported. All of the IronPython import logic will then go > through the PAL ? you could check out the Silverlight PAL (BrowserPAL.cs) > for an example. > > > > For me the loop/print is working w/ just Execution permission. I've just > taken your original Program.cs, added APTCA, restricted the permissions to > Execution, and removed full trust from the Ipy/DLR DLLs. What's the stack > trace of the exception here? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal > *Sent:* Tuesday, September 02, 2008 7:26 PM > > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Re strict imports > > > > Dino, > > Thanks for the advice on Security Transparent. The IO permission seems > necessary in order to load scripts from a file, as is the actual plan in the > end - the example I attached not withstanding. Also, for some reason scripts > fail unless I grant the UnmanagedCode flag, in addition to Execution. This > is kind of problematic since UnmanagedCode allows me to do: > > import clr > clr.AddReference("mscorlib.dll") > import System > from System import Environment > Environment.Exit(9) > > Which I think is kinda bad. =\ > > Without UnmanagedCode imports don't work and even this won't work: > > i = 200 > while i > 0: > i = i - 1 > print "Done in the second verse. Yes?" > > Print by itself works, though, and other functions such as > Environment.CommandLine and such are correctly stopped unless called through > a method I expose that asserts the appropriate permission set. Still, that > Exit thing is rather crippling. Unfortunately the application I'm building > will be run by the type of people that have too much time on their hands, > I'm not sure how to plug that kind of hole without resorting to filtering > each file for 'naughty' commands. > > --- > LC > > On Tue, Sep 2, 2008 at 9:10 PM, Dino Viehland wrote: > > To avoid the link demands you can mark your assembly as being > SecurityTransparent ? see > http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will > force link demands from your assembly to turn into full demands which will > fail when they hit the untrusted script code. And full demands will of > course also fail normally. > > > > Also just a couple of other comments: You (probably) shouldn't be marking > IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core > as full trust ? we're also security critical so we don't need to be trusted > at all. You also probably don't want to be granting reflection or file-io ? > pset.AddPermission(new > SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient > for what you're doing so far. > > > > Finally if you need to occasionally elevate permissions in your object > model you can mark your assembly as SecurityCritical and then have > individual methods which are audited and elevate appropriately. But you > also might just want to restrict the surface area by not having many public > types other than the object model you're exposing. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal > *Sent:* Tuesday, September 02, 2008 6:33 PM > > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Re strict imports > > > > Ok, so I think I misunderstood what a LinkDemand was, as well as the fact > that the exception I'm getting is expected behavior. > > > > I added the [assembly: AllowPartiallyTrustedCallers] attribute to my > assembly and now things work fine outside of the debug environment. From > what I (now) understand, using the LinkDemand attribute is so that the > partially trusted assembly (i.e. the scripts) *can't* access that method. > Does that sound right to you guru types? To test this I imported > System.Windows.Forms and tried to call the MessageBox.Show() method which > failed while running in the domain, as expected. When I removed the > LinkDemand from the ScriptableItem class the calls to it in the script also > worked fine. > > So all I have to do is decorate the classes I don't want to be imported > from my assembly into the script with LinkDemands, I think? Is there some > way to reverse that, I.E. some way that I can decorate the classes I want to > be accessible rather than the other way around? I suppose another > alternative is to create the ScriptableItem wrappers in their own assembly > and just reference that, as well as make it callable by partially trusted > callers, while leaving my own assembly alone and thus off-limits to an > import. > > I will play with it some more, I think. I'm sorry to have wasted some of > your time. =\ > > --- > LC > > On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal wrote: > > This is a condensed version. You'll have to sign the assembly or you'll get > an error at the domain creation step, other than that this should run just > by starting a new console application, adding the IPY and DLR DLLs, and then > copying and pasting this file over the default generated code. > > Even after starting a new project to make sure my sample builds I still > observe the same behavior. > > --- > LC > > > > On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher > wrote: > > Do you have a simple reproduction that doesn't include any of your > domain-specific code? > > On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: > > So here's a strange wrinkle, > > when I run this with the debugger (unmodified except for adding the > IronPython assemblies as full-trust on the domain) it works fine and as > expected. If I run it without the debugger attached it gives me the same > exception as before, when I catch the exception myself I also get this > tidbit: > > The assembly or AppDomain that failed was: > Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, > PublicKeyToken=31bf3856ad364e35 > The Zone of the assembly that failed was: > MyComputer > The Url of the assembly that failed was: > > file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL > > If I build and compile the code as Release instead of Debug I get: > > System.Runtime.Serialization.SerializationException: Type > 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, > Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not > marked as serializable. > > > at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) > > at IronPythonShell.Program.Main(String[] args) in > B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 > > It's a little beyond odd to me, but like I said before I fear I don't fully > understand what's going on behind the goo. The only consolation is that I > can at least built out my scripting system in working form and later run it > under a more trusted domain for production by simply removing the domain > from the Runtime.Create() constructor and then adding it later. (At least, I > hope this is the case) > > --- > Leo C. > > > > On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde > wrote: > > The CLR doesn't dump out full exception information on SecurityExceptions > in partial trust ? you can get a lot more information if you look at the > exception in a debugger, or if you Assert for FullTrust before doing a > ToString on the permission. Once you do that, you should be able to get > more data including the demanded permission and the assembly which caused > the demand to fail, instead of the message saying "The granted set of the > failing assembly was:" which does not say which assembly is causing the > problem. > > > > Also, can you try adding IronPython.dll and IronPython.Modules.dll to the > fullTrustAssemblies argument to AppDomain.CreateDomain > ? > > > > Thanks, > > Shri > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inigomaringarcia at gmail.com Wed Sep 3 09:14:04 2008 From: inigomaringarcia at gmail.com (Inigo Marin Garcia) Date: Wed, 3 Sep 2008 09:14:04 +0200 Subject: [IronPython] unsuscribe Message-ID: <49bd9cb0809030014wff1942co824ca2fbb51bfc3b@mail.gmail.com> -- Saludos I?igo Marin Garcia -------------- next part -------------- An HTML attachment was scrubbed... URL: From desleo at gmail.com Wed Sep 3 13:44:50 2008 From: desleo at gmail.com (Leo Carbajal) Date: Wed, 3 Sep 2008 06:44:50 -0500 Subject: [IronPython] Re strict imports In-Reply-To: References: <19113682.post@talk.nabble.com> <350E7D38B6D819428718949920EC2355421A58A8D5@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A8E5@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421A58A922@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: If it will be fixed on the next release then that's good enough for me, I'll simply change ScriptRuntime.Create(sandbox) to ScriptRuntime.Create() until then. The IO permission isn't that big of a deal to me since it's only read and the path that I'm exposing will contain only the scripts, which will be visible and editable by other means in the application anyway. As long as they can't look outside of that directory or modify it programatically in a way that I can't track, I'm gold. Thank you for your patience, I had to learn this security stuff eventually. =) --- LC On Wed, Sep 3, 2008 at 12:19 AM, Curt Hagenlocher wrote: > It was fixed post-beta 4, if I recall correctly. This should work if you > download one of the nightly drops. > > > On Tue, Sep 2, 2008 at 9:44 PM, Dino Viehland wrote: > >> I thought that one had gotten fixed but maybe it hasn't or maybe it >> changed while I'm on vacation - I was looking at beta 4 sources and removing >> the things I thought we had changed since then. Either way it should be >> easy to fix but I'll have to talk to the DLR guys when I'm back from >> vacation on Thursday J >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal >> *Sent:* Tuesday, September 02, 2008 9:06 PM >> >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] Re strict imports >> >> >> >> The PAL stuff looks scary! Ok, not really, but I'll have to look at it >> when I'm not close to falling asleep. The benefits here are pretty nice, but >> probably not something I want to muck with half-heartedly. >> >> The stack trace for this one is as follows: >> System.Security.SecurityException: Request for the permission of type >> 'System.Security.Permissions.SecurityPermission, mscorlib, Version= >> 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. >> *at System.Scripting.Com.ComMetaObject.IsComObject(Object obj)* >> at System.Scripting.Actions.MetaAction.Bind[T](Object[] args) >> at System.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 >> originalMonomorphicRule, Object[] args) >> at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) >> at >> System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite >> site, T0 arg0, T1 arg1) >> at $1##1(Closure , Scope , LanguageContext ) >> at >> System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression >> code, Scope scope) >> at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink >> errorSink) >> at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) >> at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) >> at IronPythonShell.Program.Main(String[] args) in >> C:\Users\Leo\Documents\Visual Studio >> 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 63 >> The action that failed was: >> LinkDemand >> The type of the first permission that failed was: >> System.Security.Permissions.SecurityPermission >> The first permission that failed was: >> >> >> I'm running the exact same file you mentioned, with the exact same changes >> to the assembly. I'll paste it here, in case I'm missing something >> ridiculously obvious, since the contents of the Main method are now rather >> small: >> >> PermissionSet pset = new PermissionSet(PermissionState.None); >> pset.AddPermission(new >> SecurityPermission(SecurityPermissionFlag.Execution)); >> pset.AddPermission(new >> ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); >> pset.AddPermission(new >> FileIOPermission(FileIOPermissionAccess.PathDiscovery | >> FileIOPermissionAccess.Read, AppDomain.CurrentDomain.BaseDirectory)); >> AppDomainSetup domainSetup = new AppDomainSetup(); >> domainSetup.ApplicationBase = >> AppDomain.CurrentDomain.BaseDirectory; >> >> // create the sandboxed domain >> AppDomain sandbox = AppDomain.CreateDomain( >> "Sandboxed Domain", >> AppDomain.CurrentDomain.Evidence, >> domainSetup, >> pset, >> CreateStrongName(Assembly.GetExecutingAssembly())); >> >> >> StringBuilder script = new StringBuilder(); >> script.AppendLine("i = 200"); >> script.AppendLine("while i > 0: i = i - 1"); >> script.AppendLine("print \"Done in the second verse. Yes?\""); >> >> try >> { >> ScriptRuntime runtime = >> ScriptRuntime.Create(sandbox); >> ScriptEngine engine = >> runtime.GetEngineByFileExtension("py"); >> ScriptScope scope = engine.CreateScope(); >> >> ScriptSource source = >> engine.CreateScriptSourceFromString(script.ToString(), >> System.Scripting.SourceCodeKind.Statements); >> source.Execute(scope); >> } >> catch (Exception e) >> { >> Console.WriteLine(e); >> } >> >> Console.ReadKey(); >> >> On Tue, Sep 2, 2008 at 9:49 PM, Dino Viehland >> wrote: >> >> To allow access to the imports the next step in this will be providing >> your own PlatformAdapationLayer. You'll need to subclass ScriptHost and >> specify that type as the HostType for a ScriptRuntimeSetup. Your PAL can >> then provide access to a limited file system or a virtual file system from >> which the files are imported. All of the IronPython import logic will then >> go through the PAL ? you could check out the Silverlight PAL (BrowserPAL.cs) >> for an example. >> >> >> >> For me the loop/print is working w/ just Execution permission. I've just >> taken your original Program.cs, added APTCA, restricted the permissions to >> Execution, and removed full trust from the Ipy/DLR DLLs. What's the stack >> trace of the exception here? >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal >> *Sent:* Tuesday, September 02, 2008 7:26 PM >> >> >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] Re strict imports >> >> >> >> Dino, >> >> Thanks for the advice on Security Transparent. The IO permission seems >> necessary in order to load scripts from a file, as is the actual plan in the >> end - the example I attached not withstanding. Also, for some reason scripts >> fail unless I grant the UnmanagedCode flag, in addition to Execution. This >> is kind of problematic since UnmanagedCode allows me to do: >> >> import clr >> clr.AddReference("mscorlib.dll") >> import System >> from System import Environment >> Environment.Exit(9) >> >> Which I think is kinda bad. =\ >> >> Without UnmanagedCode imports don't work and even this won't work: >> >> i = 200 >> while i > 0: >> i = i - 1 >> print "Done in the second verse. Yes?" >> >> Print by itself works, though, and other functions such as >> Environment.CommandLine and such are correctly stopped unless called through >> a method I expose that asserts the appropriate permission set. Still, that >> Exit thing is rather crippling. Unfortunately the application I'm building >> will be run by the type of people that have too much time on their hands, >> I'm not sure how to plug that kind of hole without resorting to filtering >> each file for 'naughty' commands. >> >> --- >> LC >> >> On Tue, Sep 2, 2008 at 9:10 PM, Dino Viehland >> wrote: >> >> To avoid the link demands you can mark your assembly as being >> SecurityTransparent ? see >> http://blogs.msdn.com/shawnfa/archive/2005/08/31/458641.aspx. That will >> force link demands from your assembly to turn into full demands which will >> fail when they hit the untrusted script code. And full demands will of >> course also fail normally. >> >> >> >> Also just a couple of other comments: You (probably) shouldn't be marking >> IronPython/IronPython.Modules/Microsoft.Scripting/Microsoft.Scripting.Core >> as full trust ? we're also security critical so we don't need to be trusted >> at all. You also probably don't want to be granting reflection or file-io ? >> pset.AddPermission(new >> SecurityPermission(SecurityPermissionFlag.Execution)); should be sufficient >> for what you're doing so far. >> >> >> >> Finally if you need to occasionally elevate permissions in your object >> model you can mark your assembly as SecurityCritical and then have >> individual methods which are audited and elevate appropriately. But you >> also might just want to restrict the surface area by not having many public >> types other than the object model you're exposing. >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Leo Carbajal >> *Sent:* Tuesday, September 02, 2008 6:33 PM >> >> >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] Re strict imports >> >> >> >> Ok, so I think I misunderstood what a LinkDemand was, as well as the fact >> that the exception I'm getting is expected behavior. >> >> >> >> I added the [assembly: AllowPartiallyTrustedCallers] attribute to my >> assembly and now things work fine outside of the debug environment. From >> what I (now) understand, using the LinkDemand attribute is so that the >> partially trusted assembly (i.e. the scripts) *can't* access that method. >> Does that sound right to you guru types? To test this I imported >> System.Windows.Forms and tried to call the MessageBox.Show() method which >> failed while running in the domain, as expected. When I removed the >> LinkDemand from the ScriptableItem class the calls to it in the script also >> worked fine. >> >> So all I have to do is decorate the classes I don't want to be imported >> from my assembly into the script with LinkDemands, I think? Is there some >> way to reverse that, I.E. some way that I can decorate the classes I want to >> be accessible rather than the other way around? I suppose another >> alternative is to create the ScriptableItem wrappers in their own assembly >> and just reference that, as well as make it callable by partially trusted >> callers, while leaving my own assembly alone and thus off-limits to an >> import. >> >> I will play with it some more, I think. I'm sorry to have wasted some of >> your time. =\ >> >> --- >> LC >> >> On Tue, Sep 2, 2008 at 7:38 PM, Leo Carbajal wrote: >> >> This is a condensed version. You'll have to sign the assembly or you'll >> get an error at the domain creation step, other than that this should run >> just by starting a new console application, adding the IPY and DLR DLLs, and >> then copying and pasting this file over the default generated code. >> >> Even after starting a new project to make sure my sample builds I still >> observe the same behavior. >> >> --- >> LC >> >> >> >> On Tue, Sep 2, 2008 at 6:36 PM, Curt Hagenlocher >> wrote: >> >> Do you have a simple reproduction that doesn't include any of your >> domain-specific code? >> >> On Tue, Sep 2, 2008 at 4:30 PM, Leo Carbajal wrote: >> >> So here's a strange wrinkle, >> >> when I run this with the debugger (unmodified except for adding the >> IronPython assemblies as full-trust on the domain) it works fine and as >> expected. If I run it without the debugger attached it gives me the same >> exception as before, when I catch the exception myself I also get this >> tidbit: >> >> The assembly or AppDomain that failed was: >> Microsoft.Scripting, Version=1.0.0.4000, Culture=neutral, >> PublicKeyToken=31bf3856ad364e35 >> The Zone of the assembly that failed was: >> MyComputer >> The Url of the assembly that failed was: >> >> file:///B:/Code/IronPythonShell/IronPythonShell/bin/Debug/Microsoft.Scripting.DLL >> >> If I build and compile the code as Release instead of Debug I get: >> >> System.Runtime.Serialization.SerializationException: Type >> 'System.Scripting.SourceUnit' in assembly 'Microsoft.Scripting.Core, >> Version=1.0.0.4000, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not >> marked as serializable. >> >> >> at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) >> >> at IronPythonShell.Program.Main(String[] args) in >> B:\Code\IronPythonShell\IronPythonShell\Program.cs:line 54 >> >> It's a little beyond odd to me, but like I said before I fear I don't >> fully understand what's going on behind the goo. The only consolation is >> that I can at least built out my scripting system in working form and later >> run it under a more trusted domain for production by simply removing the >> domain from the Runtime.Create() constructor and then adding it later. (At >> least, I hope this is the case) >> >> --- >> Leo C. >> >> >> >> On Tue, Sep 2, 2008 at 4:50 PM, Shri Borde >> wrote: >> >> The CLR doesn't dump out full exception information on SecurityExceptions >> in partial trust ? you can get a lot more information if you look at the >> exception in a debugger, or if you Assert for FullTrust before doing a >> ToString on the permission. Once you do that, you should be able to get >> more data including the demanded permission and the assembly which caused >> the demand to fail, instead of the message saying "The granted set of the >> failing assembly was:" which does not say which assembly is causing the >> problem. >> >> >> >> Also, can you try adding IronPython.dll and IronPython.Modules.dll to the >> fullTrustAssemblies argument to AppDomain.CreateDomain >> ? >> >> >> >> Thanks, >> >> Shri >> >> >> >> >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Wed Sep 3 19:07:21 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 3 Sep 2008 12:07:21 -0500 Subject: [IronPython] Beta 4 or build from source? Message-ID: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> Hi All, Well the time has come again to upgrade to a newer version of IronPython. I'm tempted to try one of the source code drops instead of Beta 4,is there any reason I shouldn't use this morning's drop? I'm happy to see that the performance of IronPython has been improving constantly. Performance is key, I've upgraded my development PC twice, and am running at a 20% overclock just to keep the edit, refresh, debug cycles down to a reasonable amount of time. A large Silverlight project takes a while to load in the browser :( Incidentally bugs in psycopg2 drove me to create a ctypes client library for PostgreSQL. This was my last remaining C library on the backend, so I'm no longer tied to CPython. I eventually (early next year) intend to compare IronPython on Mono to CPython 2.5 for running the backend server, and choose the fastest of the two for final testing and deployment. I expect I'll be pleasantly surprised by IronPython. -Dan From dfugate at microsoft.com Wed Sep 3 19:13:03 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 3 Sep 2008 10:13:03 -0700 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> Message-ID: Ipy.exe startup time took a ~60% hit a couple weeks ago which we're trying to get fixed before IP 2.0B5. Also, there might be a few socket issues we're also in the process of fixing for Beta 5. That said, there have been a huge number of bugs that have been fixed since Beta 4. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Wednesday, September 03, 2008 10:07 AM To: Discussion of IronPython Subject: [IronPython] Beta 4 or build from source? Hi All, Well the time has come again to upgrade to a newer version of IronPython. I'm tempted to try one of the source code drops instead of Beta 4,is there any reason I shouldn't use this morning's drop? I'm happy to see that the performance of IronPython has been improving constantly. Performance is key, I've upgraded my development PC twice, and am running at a 20% overclock just to keep the edit, refresh, debug cycles down to a reasonable amount of time. A large Silverlight project takes a while to load in the browser :( Incidentally bugs in psycopg2 drove me to create a ctypes client library for PostgreSQL. This was my last remaining C library on the backend, so I'm no longer tied to CPython. I eventually (early next year) intend to compare IronPython on Mono to CPython 2.5 for running the backend server, and choose the fastest of the two for final testing and deployment. I expect I'll be pleasantly surprised by IronPython. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Sep 3 19:13:29 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 03 Sep 2008 18:13:29 +0100 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> Message-ID: <48BEC5B9.1070402@voidspace.org.uk> Dan Eloff wrote: > Hi All, > > Well the time has come again to upgrade to a newer version of > IronPython. I'm tempted to try one of the source code drops instead of > Beta 4,is there any reason I shouldn't use this morning's drop? > There have been further performance improvements from beta 4 in the latest code drop. Another reason to use it is that the hosting API has changed *again* - but hopefully for the last time! Michael > I'm happy to see that the performance of IronPython has been improving > constantly. Performance is key, I've upgraded my development PC twice, > and am running at a 20% overclock just to keep the edit, refresh, > debug cycles down to a reasonable amount of time. A large Silverlight > project takes a while to load in the browser :( > > Incidentally bugs in psycopg2 drove me to create a ctypes client > library for PostgreSQL. This was my last remaining C library on the > backend, so I'm no longer tied to CPython. I eventually (early next > year) intend to compare IronPython on Mono to CPython 2.5 for running > the backend server, and choose the fastest of the two for final > testing and deployment. I expect I'll be pleasantly surprised by > IronPython. > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From seshapv at microsoft.com Wed Sep 3 19:17:51 2008 From: seshapv at microsoft.com (Seshadri Pillailokam Vijayaraghavan) Date: Wed, 3 Sep 2008 10:17:51 -0700 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> Message-ID: <4F06AAB8EC03C349A5D6D0A797C4881C65A03B148A@NA-EXMSG-C112.redmond.corp.microsoft.com> The latest sources also include some breaking changes to the Hosting API in the way the runtime and engine are initialized. So if your app is also a host, you would have to spend time fixing these changes. However, it probably isn't a lot of work to incorporate this change and this is something you would have to eventually do going forward. Thanks sesh -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate Sent: Wednesday, September 03, 2008 10:13 AM To: Discussion of IronPython Subject: Re: [IronPython] Beta 4 or build from source? Ipy.exe startup time took a ~60% hit a couple weeks ago which we're trying to get fixed before IP 2.0B5. Also, there might be a few socket issues we're also in the process of fixing for Beta 5. That said, there have been a huge number of bugs that have been fixed since Beta 4. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Wednesday, September 03, 2008 10:07 AM To: Discussion of IronPython Subject: [IronPython] Beta 4 or build from source? Hi All, Well the time has come again to upgrade to a newer version of IronPython. I'm tempted to try one of the source code drops instead of Beta 4,is there any reason I shouldn't use this morning's drop? I'm happy to see that the performance of IronPython has been improving constantly. Performance is key, I've upgraded my development PC twice, and am running at a 20% overclock just to keep the edit, refresh, debug cycles down to a reasonable amount of time. A large Silverlight project takes a while to load in the browser :( Incidentally bugs in psycopg2 drove me to create a ctypes client library for PostgreSQL. This was my last remaining C library on the backend, so I'm no longer tied to CPython. I eventually (early next year) intend to compare IronPython on Mono to CPython 2.5 for running the backend server, and choose the fastest of the two for final testing and deployment. I expect I'll be pleasantly surprised by IronPython. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Wed Sep 3 23:56:49 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 3 Sep 2008 14:56:49 -0700 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3019@NA-EXMSG-C116.redmond.corp.microsoft.com> > Well the time has come again to upgrade to a newer version of > IronPython. I'm tempted to try one of the source code drops instead of > Beta 4,is there any reason I shouldn't use this morning's drop? I say go for it! =) > I'm happy to see that the performance of IronPython has been improving > constantly. Performance is key, I've upgraded my development PC twice, > and am running at a 20% overclock just to keep the edit, refresh, > debug cycles down to a reasonable amount of time. A large Silverlight > project takes a while to load in the browser :( Like how long? Is it as bad as DLRConsole, or worse? From dan.eloff at gmail.com Thu Sep 4 00:00:49 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 3 Sep 2008 17:00:49 -0500 Subject: [IronPython] What version of CLR is required to build latest IronPython sources? Message-ID: <4817b6fc0809031500p6fd30c9fj55a10fc766ad1b41@mail.gmail.com> I opened the Visual Studio 2008 Command Prompt and typed clrver: c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>clrver Versions installed on the machine: v2.0.50727 Is this good enough, or do I need to install a different CLR version to build IronPython? (I'm getting build errors, so perhaps this is the reason) -Dan From seshapv at microsoft.com Thu Sep 4 00:17:59 2008 From: seshapv at microsoft.com (Seshadri Pillailokam Vijayaraghavan) Date: Wed, 3 Sep 2008 15:17:59 -0700 Subject: [IronPython] What version of CLR is required to build latest IronPython sources? In-Reply-To: <4817b6fc0809031500p6fd30c9fj55a10fc766ad1b41@mail.gmail.com> References: <4817b6fc0809031500p6fd30c9fj55a10fc766ad1b41@mail.gmail.com> Message-ID: <4F06AAB8EC03C349A5D6D0A797C4881C65A03B1738@NA-EXMSG-C112.redmond.corp.microsoft.com> This should be good enough. This is the version that's installed by VS 9.0 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Wednesday, September 03, 2008 3:01 PM To: Discussion of IronPython Subject: [IronPython] What version of CLR is required to build latest IronPython sources? I opened the Visual Studio 2008 Command Prompt and typed clrver: c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>clrver Versions installed on the machine: v2.0.50727 Is this good enough, or do I need to install a different CLR version to build IronPython? (I'm getting build errors, so perhaps this is the reason) -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From srivatsn at microsoft.com Thu Sep 4 00:23:35 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Wed, 3 Sep 2008 15:23:35 -0700 Subject: [IronPython] What version of CLR is required to build latest IronPython sources? In-Reply-To: <4F06AAB8EC03C349A5D6D0A797C4881C65A03B1738@NA-EXMSG-C112.redmond.corp.microsoft.com> References: <4817b6fc0809031500p6fd30c9fj55a10fc766ad1b41@mail.gmail.com> <4F06AAB8EC03C349A5D6D0A797C4881C65A03B1738@NA-EXMSG-C112.redmond.corp.microsoft.com> Message-ID: You need to look at the minor version as well. You need to have atleast the SP1 version of .NET 2.0 which means that the version should be greater than v2.0.50727.1433. One way to find out is look at the file properties of \Microsoft.NET\Framework\v2.0.50727\fusion.dll. That's what MSIs use to figure out the .net version. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seshadri Pillailokam Vijayaraghavan Sent: Wednesday, September 03, 2008 3:18 PM To: Discussion of IronPython Subject: Re: [IronPython] What version of CLR is required to build latest IronPython sources? This should be good enough. This is the version that's installed by VS 9.0 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Wednesday, September 03, 2008 3:01 PM To: Discussion of IronPython Subject: [IronPython] What version of CLR is required to build latest IronPython sources? I opened the Visual Studio 2008 Command Prompt and typed clrver: c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>clrver Versions installed on the machine: v2.0.50727 Is this good enough, or do I need to install a different CLR version to build IronPython? (I'm getting build errors, so perhaps this is the reason) -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Thu Sep 4 00:26:10 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 3 Sep 2008 17:26:10 -0500 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3019@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3019@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809031526l4918e9d4u7d5228a7c064f6c7@mail.gmail.com> On Wed, Sep 3, 2008 at 4:56 PM, Jimmy Schementi wrote: >> I'm happy to see that the performance of IronPython has been improving >> constantly. Performance is key, I've upgraded my development PC twice, >> and am running at a 20% overclock just to keep the edit, refresh, >> debug cycles down to a reasonable amount of time. A large Silverlight >> project takes a while to load in the browser :( > > Like how long? Is it as bad as DLRConsole, or worse? Door #2. It takes 22 seconds from cold, and 16 seconds after that. This is with everything running on localhost. I'm running a Core2 Duo @ 3.6 GHz with 6MB L2 cache, 1600MHz fsb, 6GB 800MHz DDR2, Raid 0 HD. It can get close to a full minute on slower hardware. -Dan From dan.eloff at gmail.com Thu Sep 4 00:41:50 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 3 Sep 2008 17:41:50 -0500 Subject: [IronPython] What version of CLR is required to build latest IronPython sources? In-Reply-To: References: <4817b6fc0809031500p6fd30c9fj55a10fc766ad1b41@mail.gmail.com> <4F06AAB8EC03C349A5D6D0A797C4881C65A03B1738@NA-EXMSG-C112.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809031541k390ad986v6097ffc061d2465f@mail.gmail.com> I verified that I have version v2.0.50727.1434 I was also able to build "Build Release". However attempts to build "Silverlight Release" fail with errors like: Error 18 The type 'System.Runtime.Serialization.ISerializable' exists in both 'c:\Downloads\Source Code\IronPython\IronPython\Bin\Silverlight Release\Microsoft.Scripting.Core.dll' and 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll' C:\Downloads\Source Code\IronPython\IronPython\Src\Microsoft.Scripting\SymbolId.cs 24 30 Microsoft.Scripting Any idea what I need to do to get Silverlight Release to build? Thanks, -Dan On Wed, Sep 3, 2008 at 5:23 PM, Srivatsn Narayanan wrote: > You need to look at the minor version as well. You need to have atleast the SP1 version of .NET 2.0 which means that the version should be greater than v2.0.50727.1433. > > One way to find out is look at the file properties of \Microsoft.NET\Framework\v2.0.50727\fusion.dll. That's what MSIs use to figure out the .net version. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seshadri Pillailokam Vijayaraghavan > Sent: Wednesday, September 03, 2008 3:18 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What version of CLR is required to build latest IronPython sources? > > This should be good enough. This is the version that's installed by VS 9.0 > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Wednesday, September 03, 2008 3:01 PM > To: Discussion of IronPython > Subject: [IronPython] What version of CLR is required to build latest IronPython sources? > > I opened the Visual Studio 2008 Command Prompt and typed clrver: > > c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>clrver > Versions installed on the machine: > v2.0.50727 > > Is this good enough, or do I need to install a different CLR version > to build IronPython? (I'm getting build errors, so perhaps this is the > reason) > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Jimmy.Schementi at microsoft.com Thu Sep 4 00:41:58 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 3 Sep 2008 15:41:58 -0700 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: <4817b6fc0809031526l4918e9d4u7d5228a7c064f6c7@mail.gmail.com> References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3019@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0809031526l4918e9d4u7d5228a7c064f6c7@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3085@NA-EXMSG-C116.redmond.corp.microsoft.com> > >> I'm happy to see that the performance of IronPython has been > improving > >> constantly. Performance is key, I've upgraded my development PC > twice, > >> and am running at a 20% overclock just to keep the edit, refresh, > >> debug cycles down to a reasonable amount of time. A large > Silverlight > >> project takes a while to load in the browser :( > > > > Like how long? Is it as bad as DLRConsole, or worse? > > Door #2. > > It takes 22 seconds from cold, and 16 seconds after that. This is with > everything running on localhost. > > I'm running a Core2 Duo @ 3.6 GHz with 6MB L2 cache, 1600MHz fsb, 6GB > 800MHz DDR2, Raid 0 HD. > > It can get close to a full minute on slower hardware. HOLY F*#$*$&#^$*&@^#*$@^#! That's horrrrrrrrrrrrrrible. Like, how big is this app? Or is it just compute intensive? Have you done some poking around to see where the slowness is from? Anything that can be reproduced we'd want to track in our perf lab. ~js From Jimmy.Schementi at microsoft.com Thu Sep 4 01:43:22 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 3 Sep 2008 16:43:22 -0700 Subject: [IronPython] What version of CLR is required to build latest IronPython sources? In-Reply-To: <4817b6fc0809031541k390ad986v6097ffc061d2465f@mail.gmail.com> References: <4817b6fc0809031500p6fd30c9fj55a10fc766ad1b41@mail.gmail.com> <4F06AAB8EC03C349A5D6D0A797C4881C65A03B1738@NA-EXMSG-C112.redmond.corp.microsoft.com> <4817b6fc0809031541k390ad986v6097ffc061d2465f@mail.gmail.com> Message-ID: Looks like it's linking to the desktop mscorlib. Make sure any references point to c:\program files\microsoft silverlight. Btw, the sdlsdk bits are not that much different than this drop ... ~Jimmy Sent from my phone On Sep 3, 2008, at 3:42 PM, "Dan Eloff" wrote: > I verified that I have version v2.0.50727.1434 > > I was also able to build "Build Release". However attempts to build > "Silverlight Release" fail with errors like: > > Error 18 The type > 'System.Runtime.Serialization.ISerializable' exists > in both 'c:\Downloads\Source > Code\IronPython\IronPython\Bin\Silverlight > Release\Microsoft.Scripting.Core.dll' and > 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll' C: > \Downloads\Source > Code\IronPython\IronPython\Src\Microsoft.Scripting\SymbolId.cs > 24 30 Microsoft.Scripting > > Any idea what I need to do to get Silverlight Release to build? > > Thanks, > -Dan > > On Wed, Sep 3, 2008 at 5:23 PM, Srivatsn Narayanan > wrote: >> You need to look at the minor version as well. You need to have >> atleast the SP1 version of .NET 2.0 which means that the version >> should be greater than v2.0.50727.1433. >> >> One way to find out is look at the file properties of >> \Microsoft.NET\Framework\v2.0.50727\fusion.dll. That's what MSIs >> use to figure out the .net version. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com >> ] On Behalf Of Seshadri Pillailokam Vijayaraghavan >> Sent: Wednesday, September 03, 2008 3:18 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] What version of CLR is required to build >> latest IronPython sources? >> >> This should be good enough. This is the version that's installed by >> VS 9.0 >> >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com >> ] On Behalf Of Dan Eloff >> Sent: Wednesday, September 03, 2008 3:01 PM >> To: Discussion of IronPython >> Subject: [IronPython] What version of CLR is required to build >> latest IronPython sources? >> >> I opened the Visual Studio 2008 Command Prompt and typed clrver: >> >> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>clrver >> Versions installed on the machine: >> v2.0.50727 >> >> Is this good enough, or do I need to install a different CLR version >> to build IronPython? (I'm getting build errors, so perhaps this is >> the >> reason) >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dan.eloff at gmail.com Thu Sep 4 07:04:46 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Thu, 4 Sep 2008 00:04:46 -0500 Subject: [IronPython] Beta 4 or build from source? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3085@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0809031007vf07bf49y1c1045ad5ed95afc@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3019@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0809031526l4918e9d4u7d5228a7c064f6c7@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489E4A3085@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809032204k130b3c26ta293c72d42db989e@mail.gmail.com> On Wed, Sep 3, 2008 at 5:41 PM, Jimmy Schementi wrote: >> >> It takes 22 seconds from cold, and 16 seconds after that. This is with >> everything running on localhost. >> >> I'm running a Core2 Duo @ 3.6 GHz with 6MB L2 cache, 1600MHz fsb, 6GB >> 800MHz DDR2, Raid 0 HD. >> >> It can get close to a full minute on slower hardware. > > HOLY F*#$*$&#^$*&@^#*$@^#! > > That's horrrrrrrrrrrrrrible. Like, how big is this app? Or is it just compute intensive? Have you done some poking around to see where the slowness is from? Anything that can be reproduced we'd want to track in our perf lab. > No expensive computations at all. Just 100 .py files and only 1 dll other than DLR/IPY. I've done some "poking around" in the past and found module importing to be taking over 50% of that time. I created a script to make timing things in silverlight a little easier: http://www.ironpython.info/index.php/Profiling I wish there was a profiler for silverlight... And then I scattered some milestone() calls around the code. Here's the results: Loading/ipy startup time takes about ~3 seconds. Here's what happens with execution of app.py being the reference point of 0 seconds. * module importing - 4.114 I've started the first and only WebRequest at this point. * more module importing - 8.834 (note we're up to 50% of the 16 seconds now) * parse, evaluate, render templates - 10.56 * last python code executes - 11.188 No code left to execute. There's so little to render, and I know how fast silverlight can render, beats me what is going on here. Now a full 8.5 seconds after the request was supposedly sent, the response arrives at 12.525. * unserializing - 13.356 seconds * updating interface - 13.564 seconds Module importing is well known to be a bottleneck. I may take the unadvised approach of precompiling all .py files with the desktop CLR and hacking them to change references to Silverlight assemblies in order to skim some time off this. I can then hack Chiron to re-compile only changed files. First I think I can optimize some of the imports to happen later on demand by moving some imports into function bodies, if I can cut enough off this I won't bother trying to compile them. The part I find disturbing is the server responds in subsecond time to the request. Responses come in on a background thread in silverlight b2, so why the hell does it take 8.5 seconds before anything starts happening here? I have a whole cpu core sitting idle. So I did some digging. By 4.114 I've executed BeginGetResponse. But the request is just queued until silverlight is idle some time after 11.188. Then it is sent and the response comes back subsecond, like expected. This could cut 15% off the load time if the request could be sent at anytime in the first 6 seconds after BeginGetResponse. In a production environment, when it takes many seconds to get a response from the server, this behavior will really add to the load time. I don't know what could cause that delay. That's the only request sent to that port, not even a request for the client access policy (I send that with cache forever headers). I'm going to spend this weekend optimizing the hell out of load time and see what I can achieve. Over the next 6 months of clicking refresh, I'm sure I'll get the time back :) -Dan From fuzzyman at voidspace.org.uk Thu Sep 4 16:33:10 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 04 Sep 2008 15:33:10 +0100 Subject: [IronPython] Pickle bug Message-ID: <48BFF1A6.8070807@voidspace.org.uk> Pickle on IronPython doesn't preserve sufficient information to unpickle floats accurately: CPython: >>> a = 1 /3.0 >>> import cPickle as pickle >>> pickle.loads(pickle.dumps(a)) == a IronPython: >>> import cPickle as pickle >>> a = 1 /3.0 >>> pickle.loads(pickle.dumps(a)) == a False This is actually causing us numerical errors in Resolver One. CPython is actually very careful about its string representation of floats so that this is possible. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From christian.muirhead at resolversystems.com Thu Sep 4 16:41:46 2008 From: christian.muirhead at resolversystems.com (Christian Muirhead) Date: Thu, 04 Sep 2008 15:41:46 +0100 Subject: [IronPython] Pickle bug In-Reply-To: <48BFF1A6.8070807@voidspace.org.uk> References: <48BFF1A6.8070807@voidspace.org.uk> Message-ID: <48BFF3AA.7010403@resolversystems.com> Michael Foord wrote: > Pickle on IronPython doesn't preserve sufficient information to unpickle > floats accurately: > > CPython: > >>> a = 1 /3.0 > >>> import cPickle as pickle > >>> pickle.loads(pickle.dumps(a)) == a (Michael meant to say that this was True) > > IronPython: > >>> import cPickle as pickle > >>> a = 1 /3.0 > >>> pickle.loads(pickle.dumps(a)) == a > False > > This is actually causing us numerical errors in Resolver One. CPython is > actually very careful about its string representation of floats so that > this is possible. I think it's because IP cPickle is relying on the .NET Double.ToString which isn't as truthful as cPython's repr. The issue's covered here: http://www.python.org/doc/current/tut/node16.html xtian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From curt at hagenlocher.org Thu Sep 4 16:46:25 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 4 Sep 2008 07:46:25 -0700 Subject: [IronPython] Pickle bug In-Reply-To: <48BFF3AA.7010403@resolversystems.com> References: <48BFF1A6.8070807@voidspace.org.uk> <48BFF3AA.7010403@resolversystems.com> Message-ID: Yes, we should probably change this to use System.Double.ToString('G17') On Thu, Sep 4, 2008 at 7:41 AM, Christian Muirhead < christian.muirhead at resolversystems.com> wrote: > Michael Foord wrote: > >> Pickle on IronPython doesn't preserve sufficient information to unpickle >> floats accurately: >> >> CPython: >> >>> a = 1 /3.0 >> >>> import cPickle as pickle >> >>> pickle.loads(pickle.dumps(a)) == a >> > (Michael meant to say that this was True) > >> >> IronPython: >> >>> import cPickle as pickle >> >>> a = 1 /3.0 >> >>> pickle.loads(pickle.dumps(a)) == a >> False >> >> This is actually causing us numerical errors in Resolver One. CPython is >> actually very careful about its string representation of floats so that this >> is possible. >> > > I think it's because IP cPickle is relying on the .NET Double.ToString > which isn't as truthful as cPython's repr. > > The issue's covered here: > http://www.python.org/doc/current/tut/node16.html > > xtian > > > -- > Christian Muirhead > Resolver Systems > christian.muirhead at resolversystems.com > We're hiring! http://www.resolversystems.com/jobs/ > > > Resolver Systems Ltd > 17a Clerkenwell Road, London EC1M 5RD, UK > VAT No.: GB 893 5643 79 Registered in England and Wales as company number > 5467329. > Registered address: 843 Finchley Road, London NW11 8NA, UK > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke14free at gmail.com Fri Sep 5 12:08:09 2008 From: luke14free at gmail.com (luke14free) Date: Fri, 05 Sep 2008 12:08:09 +0200 Subject: [IronPython] System.Windows error no module named Windows Message-ID: <48C10509.5040907@gmail.com> Hello, I'm a newbuy of Iron Python, I've just installed it and wanted to see how it was. After a few common problems I've tried to run via execfile() tutorial\\calculator.py However I get an error: No module named windows Even after I've done: import clr clr.AddReference("System.Xml") from System.Xml import * dir() I've Visual Studio 2005 and 2008 on my pc. Any hint? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Fri Sep 5 14:36:15 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 05 Sep 2008 13:36:15 +0100 Subject: [IronPython] System.Windows error no module named Windows In-Reply-To: <48C10509.5040907@gmail.com> References: <48C10509.5040907@gmail.com> Message-ID: <48C127BF.7080301@voidspace.org.uk> luke14free wrote: > Hello, > I'm a newbuy of Iron Python, I've just installed it and wanted to see > how it was. After a few common problems I've tried to run via > execfile() tutorial\\calculator.py > However I get an error: > No module named windows > Even after I've done: > > import clr > > clr.AddReference("System.Xml") > > from System.Xml import * > > dir() > > I've Visual Studio 2005 and 2008 on my pc. Any hint? It is likely that 'calculator.py' is trying to use Windows Forms or WPF. IIRC calculator.py is a WPF app - so you need to add references to the WPF assemblies. Michael > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From luke14free at gmail.com Fri Sep 5 14:42:26 2008 From: luke14free at gmail.com (luke14free) Date: Fri, 05 Sep 2008 14:42:26 +0200 Subject: [IronPython] System.Windows error no module named Windows In-Reply-To: <48C127BF.7080301@voidspace.org.uk> References: <48C10509.5040907@gmail.com> <48C127BF.7080301@voidspace.org.uk> Message-ID: <48C12932.5010306@gmail.com> Michael Foord ha scritto: > > It is likely that 'calculator.py' is trying to use Windows Forms or > WPF. IIRC calculator.py is a WPF app - so you need to add references > to the WPF assemblies. > > Michael How do I do that? From fuzzyman at voidspace.org.uk Fri Sep 5 15:23:28 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 05 Sep 2008 14:23:28 +0100 Subject: [IronPython] System.Windows error no module named Windows In-Reply-To: <48C12932.5010306@gmail.com> References: <48C10509.5040907@gmail.com> <48C127BF.7080301@voidspace.org.uk> <48C12932.5010306@gmail.com> Message-ID: <48C132D0.3020409@voidspace.org.uk> luke14free wrote: > Michael Foord ha scritto: >> >> It is likely that 'calculator.py' is trying to use Windows Forms or >> WPF. IIRC calculator.py is a WPF app - so you need to add references >> to the WPF assemblies. >> >> Michael > How do I do that? Try this: import clr clr.AddReference('presentationframework') clr.AddReference('windowsbase') clr.AddReference('presentationcore') You will need .NET 3 installed. Michael > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From luke14free at gmail.com Fri Sep 5 16:07:16 2008 From: luke14free at gmail.com (luke14free) Date: Fri, 05 Sep 2008 16:07:16 +0200 Subject: [IronPython] System.Windows error no module named Windows In-Reply-To: <48C132D0.3020409@voidspace.org.uk> References: <48C10509.5040907@gmail.com> <48C127BF.7080301@voidspace.org.uk> <48C12932.5010306@gmail.com> <48C132D0.3020409@voidspace.org.uk> Message-ID: <48C13D14.5020205@gmail.com> Michael Foord ha scritto: > Try this: > > import clr > clr.AddReference('presentationframework') > clr.AddReference('windowsbase') > clr.AddReference('presentationcore') > > You will need .NET 3 installed. > > Michael import clr clr.AddReference('presentationframework') clr.AddReference('windowsbase') clr.AddReference('presentationcore') execfile("tutorial\\calculator.py") I execute and nothing appears on screen! No errors so far... From curt at hagenlocher.org Fri Sep 5 17:05:00 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 5 Sep 2008 08:05:00 -0700 Subject: [IronPython] System.Windows error no module named Windows In-Reply-To: <48C13D14.5020205@gmail.com> References: <48C10509.5040907@gmail.com> <48C127BF.7080301@voidspace.org.uk> <48C12932.5010306@gmail.com> <48C132D0.3020409@voidspace.org.uk> <48C13D14.5020205@gmail.com> Message-ID: On Fri, Sep 5, 2008 at 7:07 AM, luke14free wrote: > > execfile("tutorial\\calculator.py") > > I execute and nothing appears on screen! No errors so far... It's not really setup to use in this fashion -- for one thing, you need to manually load the XAML for the UI. Look at Tutorial.htm for more details. -- Curt Hagenlocher curt at hagenlocher.org From sefirah6990 at katamail.com Fri Sep 5 17:46:41 2008 From: sefirah6990 at katamail.com (sefirah6990 at katamail.com) Date: Fri, 5 Sep 2008 17:46:41 +0200 Subject: [IronPython] What is FunctionEnvironment16Dictionary? Message-ID: <10895.1220629601@katamail.com> An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Sep 5 18:07:02 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Sep 2008 09:07:02 -0700 Subject: [IronPython] What is FunctionEnvironment16Dictionary? In-Reply-To: <10895.1220629601@katamail.com> References: <10895.1220629601@katamail.com> Message-ID: <350E7D38B6D819428718949920EC2355421AE94BF9@NA-EXMSG-C102.redmond.corp.microsoft.com> It should mean the function is a closure that contains less than 16 variables. Alternately it might be that the function calls locals(), unqualified exec, eval, dir(), or vars() and we?ve promoted the locals into an environment. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of sefirah6990 at katamail.com Sent: Friday, September 05, 2008 8:47 AM To: users at lists.ironpython.com Subject: [IronPython] What is FunctionEnvironment16Dictionary? Hi, i'm an IronPython newbie. I am not able to find some documentation about the class FunctionEnvironment16Dictionary. What is it? What is its usage? If one parameter of this type is present in a signature of a method, what could it mean? Thanks a lot for help! ________________________________ Nuova grafica e nuove funzionalit?! Crea subito Gratis la tua nuova Casella di Posta Katamail -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellosticky at gmail.com Fri Sep 5 20:00:50 2008 From: hellosticky at gmail.com (KE) Date: Fri, 5 Sep 2008 14:00:50 -0400 Subject: [IronPython] -X:SaveAssemblies Message-ID: <48c173fc.1917400a.2cde.ffffb447@mx.google.com> Hi, I find it odd that the ConsoleOptions class only has a single FileName string property. This forces the creation of pyc.py for creating a DLL with one or more files to compile, whereas I believe the functionality in pyc.py of creating a DLL from one or more input files should be right in the DLR. OptionsParser even already has a switch for -X:SaveAssemblies. IronRuby makes the same assumption. It adds the experimental -save option to ir.exe, assuming only one input file (with the rest of the args being arguments). I think it would be unfortunate if then IronRuby would need a separate irc.rb to mimic pyc.py... rinse and repeat for every other language. Are people in agreement and this is just caused because ConsoleOptions started off as executing one input file with args, and the issue of compiling to a DLL was unforeseen? Is this planned to be changed? I would be interested in changing this, so I don't mind doing the coding, but I don't want to code something that is opposed on some unforeseen philosophical basis. Thanks, From vernondcole at gmail.com Fri Sep 5 21:54:09 2008 From: vernondcole at gmail.com (Vernon Cole) Date: Fri, 5 Sep 2008 13:54:09 -0600 Subject: [IronPython] adodbapi 2.2.1 (bugfix) release. Message-ID: I found a bug in adodbapi v2.2 already. When putting data into a numeric database column, if the input was in a string (as for example the value of a wxPython grid cell), then the data would be truncated to the binary length of the field. So if I tried tried putting "12345" into an integer column, the value 1234 would be stored, because integers are 4 bytes long. This took me a while to find, since I kept looking at my wxwidgets code before finally uncovering adodbapi as the culpret. The fixed version is in the pywin32 CVS and in http://sourceforge.net/projects/adodbapi . For some good news, Mike Driscoll reports: I used your adodbapi module in my wxPython / SqlAlchemy program today and it > seemed to be returning the same data as the default module (which I think is > pyobdc). I don't know if my application truly stresses adodbapi , but it > does make lots of calls and accesses multiple tables in multiple databases. > > If anyone can test SqlAlchemy -> adodbapi -> IronPython please let us know if it works. -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From hellosticky at gmail.com Fri Sep 5 22:12:39 2008 From: hellosticky at gmail.com (KE) Date: Fri, 5 Sep 2008 16:12:39 -0400 Subject: [IronPython] -X:SaveAssemblies Message-ID: <48c192e2.0c2d400a.0498.2d55@mx.google.com> Just to add, here are some problems with the pyc.py approach rather than putting this logic into the DLR/DLR-implementor: 1. Worse performance since the file needs to be compiled and run 2. The pyc.py file itself is required to move around with the other libraries when distributing a DLR-based runtime which needs to compile code Thanks, -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Friday, September 05, 2008 2:01 PM To: IronPython; IronRuby (ironruby-core at rubyforge.org) Subject: -X:SaveAssemblies Hi, I find it odd that the ConsoleOptions class only has a single FileName string property. This forces the creation of pyc.py for creating a DLL with one or more files to compile, whereas I believe the functionality in pyc.py of creating a DLL from one or more input files should be right in the DLR. OptionsParser even already has a switch for -X:SaveAssemblies. IronRuby makes the same assumption. It adds the experimental -save option to ir.exe, assuming only one input file (with the rest of the args being arguments). I think it would be unfortunate if then IronRuby would need a separate irc.rb to mimic pyc.py... rinse and repeat for every other language. Are people in agreement and this is just caused because ConsoleOptions started off as executing one input file with args, and the issue of compiling to a DLL was unforeseen? Is this planned to be changed? I would be interested in changing this, so I don't mind doing the coding, but I don't want to code something that is opposed on some unforeseen philosophical basis. Thanks, From curt at hagenlocher.org Fri Sep 5 22:14:03 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 5 Sep 2008 13:14:03 -0700 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: <48c173fc.1917400a.2cde.ffffb447@mx.google.com> References: <48c173fc.1917400a.2cde.ffffb447@mx.google.com> Message-ID: On Fri, Sep 5, 2008 at 11:00 AM, KE wrote: > Hi, > > I find it odd that the ConsoleOptions class only has a single FileName > string property. This forces the creation of pyc.py for creating a DLL with > one or more files to compile, whereas I believe the functionality in pyc.py > of creating a DLL from one or more input files should be right in the DLR. > OptionsParser even already has a switch for -X:SaveAssemblies. -X:SaveAssemblies is for debugging purposes and does not produce output equivalent to that produced by pyc.py. -- Curt Hagenlocher curt at hagenlocher.org From hellosticky at gmail.com Fri Sep 5 22:18:40 2008 From: hellosticky at gmail.com (KE) Date: Fri, 5 Sep 2008 16:18:40 -0400 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: Message-ID: <48c1944b.1b2d400a.4d1a.377b@mx.google.com> > -X:SaveAssemblies is for debugging purposes and does not produce > output equivalent to that produced by pyc.py. Okay, but my question still stands of whether or not part or all of the function of pyc.py should be moved into the DLR (obviously with some virtual methods for implementers)? Thanks, From curt at hagenlocher.org Fri Sep 5 22:21:23 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 5 Sep 2008 13:21:23 -0700 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: <48c1944b.1b2d400a.4d1a.377b@mx.google.com> References: <48c1944b.1b2d400a.4d1a.377b@mx.google.com> Message-ID: On Fri, Sep 5, 2008 at 1:18 PM, KE wrote: >> -X:SaveAssemblies is for debugging purposes and does not produce >> output equivalent to that produced by pyc.py. > > Okay, but my question still stands of whether or not part or all of the > function of pyc.py should be moved into the DLR (obviously with some virtual > methods for implementers)? The bulk of the compiler code is actually in the DLR and in IronPython itself. pyc.py is a user-friendly wrapper around that functionality. There's no reason you couldn't use pyc.py to compile itself, if you wanted to distribute it in a binary form. If you've got a real-world scenario that you don't think we've adequately addressed, you'll need to provide more information before we can understand the shortcomings of this approach. -- Curt Hagenlocher curt at hagenlocher.org From hellosticky at gmail.com Fri Sep 5 22:28:20 2008 From: hellosticky at gmail.com (KE) Date: Fri, 5 Sep 2008 16:28:20 -0400 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: Message-ID: <48c1968e.0c2d400a.0494.40d5@mx.google.com> >> >> Okay, but my question still stands of whether or not part or all of the >> function of pyc.py should be moved into the DLR (obviously with some >virtual >> methods for implementers)? > > The bulk of the compiler code is actually in the DLR and in IronPython > itself. pyc.py is a user-friendly wrapper around that functionality. > There's no reason you couldn't use pyc.py to compile itself, if you > wanted to distribute it in a binary form. > > If you've got a real-world scenario that you don't think we've > adequately addressed, you'll need to provide more information before > we can understand the shortcomings of this approach. The question began when I was investigating an equivalent to pyc.py in IronRuby. ir.exe has an experimental option called -save (which doesn't currently work) -- instead of some kind of irc.rb -- but it shows that the lack of a consistent approach to compiling source code files into an Assembly causes confusion for language implementers and, ultimately, users. The approach in ir.exe is inherently broken because the base DLR OptionsParser parses a single file input argument (called FileName), whereas compiling usually (not always) needs to compile more than one source file into the output file. As you mention, the DLR methods like ScriptCode.SaveToAssembly already do the bulk of the work, so why not work into this into the DLR? Thanks, From dinov at microsoft.com Fri Sep 5 23:17:56 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Sep 2008 14:17:56 -0700 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: <48c1968e.0c2d400a.0494.40d5@mx.google.com> References: <48c1968e.0c2d400a.0494.40d5@mx.google.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C61E4@NA-EXMSG-C102.redmond.corp.microsoft.com> The big reason the DLR doesn't currently handle it all is that languages are ultimately responsible for how they load the code back - for example IronPython will load the code after it's been AddReference'd. Combine that with wanting a consistent interface which both takes and returns ScriptCode objects and you start to see why the languages need to be involved. And unfortunately ScriptCode objects are outside of the hosting APIs so there's not necessarily an easy way to get at them. But if you do get a ScriptCode object in theory you can write that out to disk & load it back up. I think there's some issues which prevent Ruby from using precompilation anyway though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 1:28 PM To: 'Curt Hagenlocher' Cc: 'IronRuby'; 'Discussion of IronPython' Subject: Re: [IronPython] -X:SaveAssemblies >> >> Okay, but my question still stands of whether or not part or all of the >> function of pyc.py should be moved into the DLR (obviously with some >virtual >> methods for implementers)? > > The bulk of the compiler code is actually in the DLR and in IronPython > itself. pyc.py is a user-friendly wrapper around that functionality. > There's no reason you couldn't use pyc.py to compile itself, if you > wanted to distribute it in a binary form. > > If you've got a real-world scenario that you don't think we've > adequately addressed, you'll need to provide more information before > we can understand the shortcomings of this approach. The question began when I was investigating an equivalent to pyc.py in IronRuby. ir.exe has an experimental option called -save (which doesn't currently work) -- instead of some kind of irc.rb -- but it shows that the lack of a consistent approach to compiling source code files into an Assembly causes confusion for language implementers and, ultimately, users. The approach in ir.exe is inherently broken because the base DLR OptionsParser parses a single file input argument (called FileName), whereas compiling usually (not always) needs to compile more than one source file into the output file. As you mention, the DLR methods like ScriptCode.SaveToAssembly already do the bulk of the work, so why not work into this into the DLR? Thanks, _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From hellosticky at gmail.com Fri Sep 5 23:21:00 2008 From: hellosticky at gmail.com (KE) Date: Fri, 5 Sep 2008 17:21:00 -0400 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C61E4@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48c1a2e7.073e400a.02a3.71ab@mx.google.com> Okay, understood, although I'd think the DLR could just create an abstract base class with various Save/Load methods? The logic in pyc.py is not incredibly complex. BTW, I'd be interested in what Ruby precompilation issues you're talking? I'd like to use IronRuby in this capacity. Thanks! -----Original Message----- From: Dino Viehland [mailto:dinov at microsoft.com] Sent: Friday, September 05, 2008 5:18 PM To: hellosticky at gmail.com; Discussion of IronPython; 'Curt Hagenlocher' Cc: 'IronRuby' Subject: RE: [IronPython] -X:SaveAssemblies The big reason the DLR doesn't currently handle it all is that languages are ultimately responsible for how they load the code back - for example IronPython will load the code after it's been AddReference'd. Combine that with wanting a consistent interface which both takes and returns ScriptCode objects and you start to see why the languages need to be involved. And unfortunately ScriptCode objects are outside of the hosting APIs so there's not necessarily an easy way to get at them. But if you do get a ScriptCode object in theory you can write that out to disk & load it back up. I think there's some issues which prevent Ruby from using precompilation anyway though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 1:28 PM To: 'Curt Hagenlocher' Cc: 'IronRuby'; 'Discussion of IronPython' Subject: Re: [IronPython] -X:SaveAssemblies >> >> Okay, but my question still stands of whether or not part or all of the >> function of pyc.py should be moved into the DLR (obviously with some >virtual >> methods for implementers)? > > The bulk of the compiler code is actually in the DLR and in IronPython > itself. pyc.py is a user-friendly wrapper around that functionality. > There's no reason you couldn't use pyc.py to compile itself, if you > wanted to distribute it in a binary form. > > If you've got a real-world scenario that you don't think we've > adequately addressed, you'll need to provide more information before > we can understand the shortcomings of this approach. The question began when I was investigating an equivalent to pyc.py in IronRuby. ir.exe has an experimental option called -save (which doesn't currently work) -- instead of some kind of irc.rb -- but it shows that the lack of a consistent approach to compiling source code files into an Assembly causes confusion for language implementers and, ultimately, users. The approach in ir.exe is inherently broken because the base DLR OptionsParser parses a single file input argument (called FileName), whereas compiling usually (not always) needs to compile more than one source file into the output file. As you mention, the DLR methods like ScriptCode.SaveToAssembly already do the bulk of the work, so why not work into this into the DLR? Thanks, _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Fri Sep 5 23:23:01 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 5 Sep 2008 16:23:01 -0500 Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? Message-ID: <4817b6fc0809051423g77305d04qc362bcc1862cf58b@mail.gmail.com> I downloaded sdlsdk-0.3.0 and replaced the .dlls in the silverlight folder (C:\Program Files (x86)\Microsoft SDKs\Silverlight\v2.0\Libraries\Client) with the ones from the sdlsdk/bin folder. I created an app.py file with just "import struct". This fails: ImportError: No module named struct I guess that the sdlsdk IronPython is pretty badly broken (or is built with an internal, version of silverlight, not beta2?) If I can resolve the build errors for Silverlight Relese for the lastest IronPython source dump, will this work, or will I still be unable to import struct? What can I do to move forward here? Thanks, -Dan From dinov at microsoft.com Fri Sep 5 23:25:52 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Sep 2008 14:25:52 -0700 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: <48c1a2e7.073e400a.02a3.71ab@mx.google.com> References: <350E7D38B6D819428718949920EC2355421B1C61E4@NA-EXMSG-C102.redmond.corp.microsoft.com> <48c1a2e7.073e400a.02a3.71ab@mx.google.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C61EE@NA-EXMSG-C102.redmond.corp.microsoft.com> I'm not sure what the specific issues are - I've just heard faint murmur's that there's some issues there. Maybe Tomas knows off the top of his head? I'm not sure what an abstract base class would provide - as you said, pyc is already not that complex. CompiledLoader (how Python then loads this code back) is also pretty simple. ScriptCode.Load and ScriptCode.SaveToAssembly are already supposed to be the DLR provided helpers to make it trivial for language implementers to save/reload from disk. -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Friday, September 05, 2008 2:21 PM To: Dino Viehland; 'Discussion of IronPython'; 'Curt Hagenlocher' Cc: 'IronRuby' Subject: RE: [IronPython] -X:SaveAssemblies Okay, understood, although I'd think the DLR could just create an abstract base class with various Save/Load methods? The logic in pyc.py is not incredibly complex. BTW, I'd be interested in what Ruby precompilation issues you're talking? I'd like to use IronRuby in this capacity. Thanks! -----Original Message----- From: Dino Viehland [mailto:dinov at microsoft.com] Sent: Friday, September 05, 2008 5:18 PM To: hellosticky at gmail.com; Discussion of IronPython; 'Curt Hagenlocher' Cc: 'IronRuby' Subject: RE: [IronPython] -X:SaveAssemblies The big reason the DLR doesn't currently handle it all is that languages are ultimately responsible for how they load the code back - for example IronPython will load the code after it's been AddReference'd. Combine that with wanting a consistent interface which both takes and returns ScriptCode objects and you start to see why the languages need to be involved. And unfortunately ScriptCode objects are outside of the hosting APIs so there's not necessarily an easy way to get at them. But if you do get a ScriptCode object in theory you can write that out to disk & load it back up. I think there's some issues which prevent Ruby from using precompilation anyway though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 1:28 PM To: 'Curt Hagenlocher' Cc: 'IronRuby'; 'Discussion of IronPython' Subject: Re: [IronPython] -X:SaveAssemblies >> >> Okay, but my question still stands of whether or not part or all of the >> function of pyc.py should be moved into the DLR (obviously with some >virtual >> methods for implementers)? > > The bulk of the compiler code is actually in the DLR and in IronPython > itself. pyc.py is a user-friendly wrapper around that functionality. > There's no reason you couldn't use pyc.py to compile itself, if you > wanted to distribute it in a binary form. > > If you've got a real-world scenario that you don't think we've > adequately addressed, you'll need to provide more information before > we can understand the shortcomings of this approach. The question began when I was investigating an equivalent to pyc.py in IronRuby. ir.exe has an experimental option called -save (which doesn't currently work) -- instead of some kind of irc.rb -- but it shows that the lack of a consistent approach to compiling source code files into an Assembly causes confusion for language implementers and, ultimately, users. The approach in ir.exe is inherently broken because the base DLR OptionsParser parses a single file input argument (called FileName), whereas compiling usually (not always) needs to compile more than one source file into the output file. As you mention, the DLR methods like ScriptCode.SaveToAssembly already do the bulk of the work, so why not work into this into the DLR? Thanks, _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Fri Sep 5 23:26:23 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Sep 2008 14:26:23 -0700 Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? In-Reply-To: <4817b6fc0809051423g77305d04qc362bcc1862cf58b@mail.gmail.com> References: <4817b6fc0809051423g77305d04qc362bcc1862cf58b@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C61F0@NA-EXMSG-C102.redmond.corp.microsoft.com> Can you import _struct? We recently did the work to get this compliant w/ 2.5. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Friday, September 05, 2008 2:23 PM To: Discussion of IronPython Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? I downloaded sdlsdk-0.3.0 and replaced the .dlls in the silverlight folder (C:\Program Files (x86)\Microsoft SDKs\Silverlight\v2.0\Libraries\Client) with the ones from the sdlsdk/bin folder. I created an app.py file with just "import struct". This fails: ImportError: No module named struct I guess that the sdlsdk IronPython is pretty badly broken (or is built with an internal, version of silverlight, not beta2?) If I can resolve the build errors for Silverlight Relese for the lastest IronPython source dump, will this work, or will I still be unable to import struct? What can I do to move forward here? Thanks, -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Fri Sep 5 23:30:21 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 5 Sep 2008 14:30:21 -0700 Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C61F0@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809051423g77305d04qc362bcc1862cf58b@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C61F0@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: To expand on this just a little, CPython implements the module "_struct" in C and implementes the module "struct" in Python. As we're both aiming for parity with CPython in these matters and now redistributing the standard Python library, we changed our implementation to be _struct-compatible. Bottom line: you need to use struct.py from the standard Python libs. On Fri, Sep 5, 2008 at 2:26 PM, Dino Viehland wrote: > Can you import _struct? We recently did the work to get this compliant w/ > 2.5. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, September 05, 2008 2:23 PM > To: Discussion of IronPython > Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? > > I downloaded sdlsdk-0.3.0 and replaced the .dlls in the silverlight > folder (C:\Program Files (x86)\Microsoft > SDKs\Silverlight\v2.0\Libraries\Client) with the ones from the > sdlsdk/bin folder. I created an app.py file with just "import struct". > This fails: ImportError: No module named struct > > I guess that the sdlsdk IronPython is pretty badly broken (or is built > with an internal, version of silverlight, not beta2?) > > If I can resolve the build errors for Silverlight Relese for the > lastest IronPython source dump, will this work, or will I still be > unable to import struct? > > What can I do to move forward here? > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Fri Sep 5 23:32:22 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 5 Sep 2008 16:32:22 -0500 Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? In-Reply-To: References: <4817b6fc0809051423g77305d04qc362bcc1862cf58b@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C61F0@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809051432if356672o273049a6b06d6fc4@mail.gmail.com> Ok, great, thanks. That's an easy fix. I'll be alert for other such changes now. -Dan On Fri, Sep 5, 2008 at 4:30 PM, Curt Hagenlocher wrote: > To expand on this just a little, CPython implements the module "_struct" in > C and implementes the module "struct" in Python. As we're both aiming for > parity with CPython in these matters and now redistributing the standard > Python library, we changed our implementation to be _struct-compatible. > Bottom line: you need to use struct.py from the standard Python libs. > > On Fri, Sep 5, 2008 at 2:26 PM, Dino Viehland wrote: >> >> Can you import _struct? We recently did the work to get this compliant w/ >> 2.5. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Friday, September 05, 2008 2:23 PM >> To: Discussion of IronPython >> Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? >> >> I downloaded sdlsdk-0.3.0 and replaced the .dlls in the silverlight >> folder (C:\Program Files (x86)\Microsoft >> SDKs\Silverlight\v2.0\Libraries\Client) with the ones from the >> sdlsdk/bin folder. I created an app.py file with just "import struct". >> This fails: ImportError: No module named struct >> >> I guess that the sdlsdk IronPython is pretty badly broken (or is built >> with an internal, version of silverlight, not beta2?) >> >> If I can resolve the build errors for Silverlight Relese for the >> lastest IronPython source dump, will this work, or will I still be >> unable to import struct? >> >> What can I do to move forward here? >> >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dan.eloff at gmail.com Sat Sep 6 01:59:16 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 5 Sep 2008 18:59:16 -0500 Subject: [IronPython] Possible regression in IronPython pre b5 to do with delegates Message-ID: <4817b6fc0809051659h7cdf80fau7ee7b56acc12cdee@mail.gmail.com> Could someone please check if this is indeed a regression in the current IronPython sources? I'm using the sdlsdk version. TypeError: Value cannot be null. Parameter name: context Caused by: req.BeginGetResponse(self.handle_response, (req, success, failure)) Simply changing this to: "lambda r: self.handle_response" is enough to get past it (no idea yet it it runs fine, but it should.) Full traceback follows: at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, String paramName) at Microsoft.Scripting.Runtime.BinderOps.GetDelegate(CodeContext context, Object callableObject, Type delegateType) at _stub_$921##366(Closure , CallSite , Method ) at System.Scripting.Actions.MatchCaller.Call1[T0,TRet](Func`3 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update1[T,T0,TRet](CallSite site, T0 arg0) at _stub_$920##365(Closure , CallSite , CodeContext , Object , Object , PythonTuple ) at System.Scripting.Actions.MatchCaller.Call4[T0,T1,T2,T3,TRet](Func`6 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$13.Request$377(Closure , Object self, Object uri, Object success, Object failure, Object data) at _stub_$866##311(Closure , CallSite , CodeContext , Object , Object , String , Object ) at System.Scripting.Actions.MatchCaller.Call5[T0,T1,T2,T3,T4,TRet](Func`7 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$865##310(Closure , CallSite , CodeContext , Object , String , Object ) at System.Scripting.Actions.MatchCaller.Call4[T0,T1,T2,T3,TRet](Func`6 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$36.Load$848(Closure , Object self) at _stub_$174##43(Closure , CallSite , CodeContext , Object , Object ) at _stub_$173##42(Closure , CallSite , CodeContext , Object ) at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$9.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext context, String name) at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) at _stub_$12##2(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) at IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at S$1.startup$10() at _stub_$297##139(Closure , CallSite , CodeContext , Object ) at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$1.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at Microsoft.Scripting.Hosting.CompiledCode.Execute() at Microsoft.Scripting.Silverlight.DynamicApplication.StartMainProgram() at Microsoft.Scripting.Silverlight.DynamicApplication.DynamicApplication_Startup(Object sender, StartupEventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) From dan.eloff at gmail.com Sat Sep 6 02:16:16 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 5 Sep 2008 19:16:16 -0500 Subject: [IronPython] Regression with importing in pre b5 Message-ID: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> I'm going to make a lot of work for you guys before the day is out :) Maybe I should be posting these to the Issue Tracker? I'm just concerned they will get lost in the noise. Using sdlsdk version. It seems there are some circumstances where from pkg.module import foo Fails in pkg/__init__.py. In fact it fails by attempting to reimport __init__.py, including executing the module level code a second time (this can make the error very misleading if this code is not able to be run twice!) -Dan Full trace as follows: Line 42: from templates.galaxy_map import GalaxyMap at game\templates\__init__.py in game\templates\__init__.py, line 42 at game\templates\__init__.py in game\templates\__init__.py, line 42 at game\interface.py in game\interface.py, line 1 at game\__init__.py in game\__init__.py, line 14 at startup in app.py, line 79 at app.py in app.py, line 86 CLR Stack Trace: at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at _stub_$461##170(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple , Int32 ) at IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportWithNames(CodeContext context, String fullName, String[] names, Int32 level) at S$59.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, Scope scope, String name, List path) at IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name) at IronPython.Runtime.Operations.PythonOps.ImportFrom(CodeContext context, Object module, String name) at S$37.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, Scope scope, String name, List path) at IronPython.Runtime.Importer.ImportModuleFrom(CodeContext context, Object from, String name) at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) at _stub_$12##2(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) at IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportWithNames(CodeContext context, String fullName, String[] names, Int32 level) at S$9.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext context, String name) at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) at _stub_$12##2(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) at IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at S$1.startup$10() at _stub_$297##139(Closure , CallSite , CodeContext , Object ) at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$1.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at Microsoft.Scripting.Hosting.CompiledCode.Execute() at Microsoft.Scripting.Silverlight.DynamicApplication.StartMainProgram() at Microsoft.Scripting.Silverlight.DynamicApplication.DynamicApplication_Startup(Object sender, StartupEventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) From hellosticky at gmail.com Sat Sep 6 02:24:10 2008 From: hellosticky at gmail.com (KE) Date: Fri, 5 Sep 2008 20:24:10 -0400 Subject: [IronPython] irc.rb Message-ID: <48c1cdd5.1d3e400a.5b11.ffffe0e3@mx.google.com> Hi, I've created an irc.rb (attached) which mimics IronPython's pyc.py. It is failing on this line: Microsoft::Scripting::ScriptCode.save_to_assembly(outfile, codes.to_array()) With the following exception... Any help would be greatly appreciated. The test file I'm trying to compile is also attached. I am building on revision 140. I have also tried with the Microsoft.Scripting and Microsoft.Scripting.Core dlls from IronPython with the same result. C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll -verbose test.rb Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb... Creating output file C:\work\ironruby\co\svn\trunk\build\release\test.dll... C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:88:in `New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:in `New' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:294:in `DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:272:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:in `DefaultVisitScopeExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:218:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall er.Generated.cs:40:in `Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:in `UpdateAndExecute' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel egates.Generated.cs:52:in `Update4' from :0 -------------- next part -------------- A non-text attachment was scrubbed... Name: irc.rb Type: application/octet-stream Size: 3462 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.rb Type: application/octet-stream Size: 314 bytes Desc: not available URL: From dinov at microsoft.com Sat Sep 6 02:44:33 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Sep 2008 17:44:33 -0700 Subject: [IronPython] Possible regression in IronPython pre b5 to do with delegates In-Reply-To: <4817b6fc0809051659h7cdf80fau7ee7b56acc12cdee@mail.gmail.com> References: <4817b6fc0809051659h7cdf80fau7ee7b56acc12cdee@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6327@NA-EXMSG-C102.redmond.corp.microsoft.com> I'm pretty sure this is a bug... Tomas stumbled across something like this recently too. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Friday, September 05, 2008 4:59 PM To: Discussion of IronPython Subject: [IronPython] Possible regression in IronPython pre b5 to do with delegates Could someone please check if this is indeed a regression in the current IronPython sources? I'm using the sdlsdk version. TypeError: Value cannot be null. Parameter name: context Caused by: req.BeginGetResponse(self.handle_response, (req, success, failure)) Simply changing this to: "lambda r: self.handle_response" is enough to get past it (no idea yet it it runs fine, but it should.) Full traceback follows: at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, String paramName) at Microsoft.Scripting.Runtime.BinderOps.GetDelegate(CodeContext context, Object callableObject, Type delegateType) at _stub_$921##366(Closure , CallSite , Method ) at System.Scripting.Actions.MatchCaller.Call1[T0,TRet](Func`3 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update1[T,T0,TRet](CallSite site, T0 arg0) at _stub_$920##365(Closure , CallSite , CodeContext , Object , Object , PythonTuple ) at System.Scripting.Actions.MatchCaller.Call4[T0,T1,T2,T3,TRet](Func`6 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$13.Request$377(Closure , Object self, Object uri, Object success, Object failure, Object data) at _stub_$866##311(Closure , CallSite , CodeContext , Object , Object , String , Object ) at System.Scripting.Actions.MatchCaller.Call5[T0,T1,T2,T3,T4,TRet](Func`7 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$865##310(Closure , CallSite , CodeContext , Object , String , Object ) at System.Scripting.Actions.MatchCaller.Call4[T0,T1,T2,T3,TRet](Func`6 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$36.Load$848(Closure , Object self) at _stub_$174##43(Closure , CallSite , CodeContext , Object , Object ) at _stub_$173##42(Closure , CallSite , CodeContext , Object ) at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$9.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext context, String name) at IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) at _stub_$12##2(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) at IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at S$1.startup$10() at _stub_$297##139(Closure , CallSite , CodeContext , Object ) at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$1.Initialize(Scope $scope, LanguageContext $language) at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at Microsoft.Scripting.Hosting.CompiledCode.Execute() at Microsoft.Scripting.Silverlight.DynamicApplication.StartMainProgram() at Microsoft.Scripting.Silverlight.DynamicApplication.DynamicApplication_Startup(Object sender, StartupEventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Sat Sep 6 04:01:22 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 5 Sep 2008 21:01:22 -0500 Subject: [IronPython] How to do ScriptEngine.FormatException now? Message-ID: <4817b6fc0809051901i3def104y7153495907e9e0f4@mail.gmail.com> Hi, I've been using the source code to help me through the changes to the hosting api, but this one is difficult since there are multiple definitions of FormatException, which one should I use? -Dan From dinov at microsoft.com Sat Sep 6 05:06:31 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Sep 2008 20:06:31 -0700 Subject: [IronPython] How to do ScriptEngine.FormatException now? In-Reply-To: <4817b6fc0809051901i3def104y7153495907e9e0f4@mail.gmail.com> References: <4817b6fc0809051901i3def104y7153495907e9e0f4@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C633E@NA-EXMSG-C102.redmond.corp.microsoft.com> It's been moved into a service - you now can do engine.GetService() which gives FormatException and other exception features. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Friday, September 05, 2008 7:01 PM To: Discussion of IronPython Subject: [IronPython] How to do ScriptEngine.FormatException now? Hi, I've been using the source code to help me through the changes to the hosting api, but this one is difficult since there are multiple definitions of FormatException, which one should I use? -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Tomas.Matousek at microsoft.com Sat Sep 6 06:48:43 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 5 Sep 2008 21:48:43 -0700 Subject: [IronPython] irc.rb In-Reply-To: <48c1cdd5.1d3e400a.5b11.ffffe0e3@mx.google.com> References: <48c1cdd5.1d3e400a.5b11.ffffe0e3@mx.google.com> Message-ID: Right. This is the error Dino overheard me talking about :) As you can see from the stack trac, something seems to be broken in DLR. I'll look at it and see whether I can come with a simple fix. Precompilation is currently P2 on our task list though, so I'm afraid any more complex work would need to wait until P1's are done. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 5:24 PM To: IronRuby Cc: IronPython Subject: [IronPython] irc.rb Hi, I've created an irc.rb (attached) which mimics IronPython's pyc.py. It is failing on this line: Microsoft::Scripting::ScriptCode.save_to_assembly(outfile, codes.to_array()) With the following exception... Any help would be greatly appreciated. The test file I'm trying to compile is also attached. I am building on revision 140. I have also tried with the Microsoft.Scripting and Microsoft.Scripting.Core dlls from IronPython with the same result. C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll -verbose test.rb Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb... Creating output file C:\work\ironruby\co\svn\trunk\build\release\test.dll... C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:88:in `New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:in `New' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:294:in `DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:272:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:in `DefaultVisitScopeExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:218:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall er.Generated.cs:40:in `Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:in `UpdateAndExecute' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel egates.Generated.cs:52:in `Update4' from :0 From curt at hagenlocher.org Sat Sep 6 07:04:07 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 5 Sep 2008 22:04:07 -0700 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> Message-ID: On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: > I'm going to make a lot of work for you guys before the day is out :) > Maybe I should be posting these to the Issue Tracker? I'm just > concerned they will get lost in the noise. Absolutely. Any problems you find *please* enter them as bugs into Codeplex! Thanks. -- Curt Hagenlocher curt at hagenlocher.org From dan.eloff at gmail.com Sat Sep 6 07:56:57 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 6 Sep 2008 00:56:57 -0500 Subject: [IronPython] Possible regression in IronPython pre b5 to do with delegates In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C6327@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809051659h7cdf80fau7ee7b56acc12cdee@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6327@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809052256l33ebcdabg56459f9f5ddd0979@mail.gmail.com> It does seem like a bug. I found a way around it, and also confirmed that it still exists in the latest sources (Friday's) I went ahead and opened a ticket: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18345 -Dan On Fri, Sep 5, 2008 at 7:44 PM, Dino Viehland wrote: > I'm pretty sure this is a bug... Tomas stumbled across something like this recently too. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, September 05, 2008 4:59 PM > To: Discussion of IronPython > Subject: [IronPython] Possible regression in IronPython pre b5 to do with delegates > > Could someone please check if this is indeed a regression in the > current IronPython sources? I'm using the sdlsdk version. > > TypeError: Value cannot be null. > Parameter name: context > > Caused by: > > req.BeginGetResponse(self.handle_response, (req, success, failure)) > > Simply changing this to: "lambda r: self.handle_response" is enough to > get past it (no idea yet it it runs fine, but it should.) > > Full traceback follows: > > at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object > value, String paramName) > at Microsoft.Scripting.Runtime.BinderOps.GetDelegate(CodeContext > context, Object callableObject, Type delegateType) > at _stub_$921##366(Closure , CallSite , Method ) > at System.Scripting.Actions.MatchCaller.Call1[T0,TRet](Func`3 > target, CallSite site, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at System.Scripting.Actions.UpdateDelegates.Update1[T,T0,TRet](CallSite > site, T0 arg0) > at _stub_$920##365(Closure , CallSite , CodeContext , Object , > Object , PythonTuple ) > at System.Scripting.Actions.MatchCaller.Call4[T0,T1,T2,T3,TRet](Func`6 > target, CallSite site, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at System.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$13.Request$377(Closure , Object self, Object uri, Object > success, Object failure, Object data) > at _stub_$866##311(Closure , CallSite , CodeContext , Object , > Object , String , Object ) > at System.Scripting.Actions.MatchCaller.Call5[T0,T1,T2,T3,T4,TRet](Func`7 > target, CallSite site, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at System.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) > at _stub_$865##310(Closure , CallSite , CodeContext , Object , > String , Object ) > at System.Scripting.Actions.MatchCaller.Call4[T0,T1,T2,T3,TRet](Func`6 > target, CallSite site, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at System.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$36.Load$848(Closure , Object self) > at _stub_$174##43(Closure , CallSite , CodeContext , Object , Object ) > at _stub_$173##42(Closure , CallSite , CodeContext , Object ) > at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 > target, CallSite site, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$9.Initialize(Scope $scope, LanguageContext $language) > at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at Microsoft.Scripting.ScriptCode.Run(Scope scope) > at IronPython.Runtime.PythonContext.CreateModule(String fileName, > Scope scope, ScriptCode scriptCode, ModuleOptions options) > at IronPython.Runtime.PythonContext.CompileModule(String fileName, > String moduleName, SourceUnit sourceCode, ModuleOptions options, > ScriptCode& scriptCode) > at IronPython.Runtime.PythonContext.CompileModule(String fileName, > String moduleName, SourceUnit sourceCode, ModuleOptions options) > at IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext > context, SourceUnit sourceCode, String name, String path) > at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext > context, String name, String path) > at IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext > context, String name, String path) > at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, > String name, String fullName, List path) > at IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext > context, String name) > at IronPython.Runtime.Importer.ImportModule(CodeContext context, > Object globals, String modName, Boolean bottom, Int32 level) > at IronPython.Runtime.Builtin.__import__(CodeContext context, > String name, Object globals, Object locals, Object fromlist, Int32 > level) > at IronPython.Runtime.Builtin.__import__(CodeContext context, > String name, Object globals, Object locals, Object fromlist) > at _stub_$12##2(Closure , CallSite , CodeContext , Object , String > , IAttributesCollection , IAttributesCollection , PythonTuple ) > at IronPython.Runtime.Importer.Import(CodeContext context, String > fullName, PythonTuple from, Int32 level) > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level) > at S$1.startup$10() > at _stub_$297##139(Closure , CallSite , CodeContext , Object ) > at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 > target, CallSite site, Object[] args) > at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$1.Initialize(Scope $scope, LanguageContext $language) > at Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at Microsoft.Scripting.ScriptCode.Run(Scope scope) > at Microsoft.Scripting.Hosting.CompiledCode.Execute() > at Microsoft.Scripting.Silverlight.DynamicApplication.StartMainProgram() > at Microsoft.Scripting.Silverlight.DynamicApplication.DynamicApplication_Startup(Object > sender, StartupEventArgs e) > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > typeIndex, Delegate handlerDelegate, Object sender, Object args) > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dan.eloff at gmail.com Sat Sep 6 08:03:46 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 6 Sep 2008 01:03:46 -0500 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> Message-ID: <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher wrote: > On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: >> I'm going to make a lot of work for you guys before the day is out :) >> Maybe I should be posting these to the Issue Tracker? I'm just >> concerned they will get lost in the noise. > > Absolutely. Any problems you find *please* enter them as bugs into Codeplex! > Be careful what you wish for :) http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346 -Dan From hellosticky at gmail.com Sat Sep 6 12:50:20 2008 From: hellosticky at gmail.com (KE) Date: Sat, 6 Sep 2008 06:50:20 -0400 Subject: [IronPython] irc.rb In-Reply-To: Message-ID: <48c26097.062a400a.4076.34d7@mx.google.com> Thanks! I've also created a bug report: http://rubyforge.org/tracker/index.php?func=detail&aid=21839&group_id=4359&a tid=16798 This includes the irc.rb which I think IronRuby will be interested in including in the IronRuby distribution as well.. I'll try to step through into this bug and understand what's going on, although I have no clue what I'm looking at :) Thanks, -----Original Message----- From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Saturday, September 06, 2008 12:49 AM To: hellosticky at gmail.com; Discussion of IronPython; IronRuby Subject: RE: [IronPython] irc.rb Right. This is the error Dino overheard me talking about :) As you can see from the stack trac, something seems to be broken in DLR. I'll look at it and see whether I can come with a simple fix. Precompilation is currently P2 on our task list though, so I'm afraid any more complex work would need to wait until P1's are done. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 5:24 PM To: IronRuby Cc: IronPython Subject: [IronPython] irc.rb Hi, I've created an irc.rb (attached) which mimics IronPython's pyc.py. It is failing on this line: Microsoft::Scripting::ScriptCode.save_to_assembly(outfile, codes.to_array()) With the following exception... Any help would be greatly appreciated. The test file I'm trying to compile is also attached. I am building on revision 140. I have also tried with the Microsoft.Scripting and Microsoft.Scripting.Core dlls from IronPython with the same result. C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll -verbose test.rb Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb... Creating output file C:\work\ironruby\co\svn\trunk\build\release\test.dll... C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:88:in `New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:in `New' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:294:in `DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:272:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:in `DefaultVisitScopeExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:218:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall er.Generated.cs:40:in `Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:in `UpdateAndExecute' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel egates.Generated.cs:52:in `Update4' from :0 From hellosticky at gmail.com Sat Sep 6 13:25:00 2008 From: hellosticky at gmail.com (KE) Date: Sat, 6 Sep 2008 07:25:00 -0400 Subject: [IronPython] irc.rb Message-ID: <48c268b7.1138400a.55da.ffff8b45@mx.google.com> Okay, well I found two code problems in two IR implementations of IExpressionSerializable: /ironruby/Runtime/Calls/rubycallaction.cs CreateExpression() is passing the wrong second Type parameter. It should be typeof(RubyCallSignature) /ironruby/Runtime/Calls/rubycallsignature.cs CreateExpression() is not passing enough parameters. typeof(bool) and Ast.Constant(_hasRhsArgument) should be added to find the right Constructor. The next problem is: Variable '#globalScope' referenced from lambda 'C:\work\ironruby\co\svn\trunk\build\release\test.rb', but it is not defined in an outer scope In Microsoft.Scripting.Core.dll!System.Linq.Expressions.Compiler.VariableBinder .Reference(System.Linq.Expressions.Expression variable = {#globalScope}, bool hoist = false) Line 238 C# I'm guessing I haven't initialized some global context? Thanks, -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Saturday, September 06, 2008 6:50 AM To: 'Tomas Matousek'; 'Discussion of IronPython'; 'IronRuby' Subject: RE: [IronPython] irc.rb Thanks! I've also created a bug report: http://rubyforge.org/tracker/index.php?func=detail&aid=21839&group_id=4359&a tid=16798 This includes the irc.rb which I think IronRuby will be interested in including in the IronRuby distribution as well.. I'll try to step through into this bug and understand what's going on, although I have no clue what I'm looking at :) Thanks, -----Original Message----- From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Saturday, September 06, 2008 12:49 AM To: hellosticky at gmail.com; Discussion of IronPython; IronRuby Subject: RE: [IronPython] irc.rb Right. This is the error Dino overheard me talking about :) As you can see from the stack trac, something seems to be broken in DLR. I'll look at it and see whether I can come with a simple fix. Precompilation is currently P2 on our task list though, so I'm afraid any more complex work would need to wait until P1's are done. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 5:24 PM To: IronRuby Cc: IronPython Subject: [IronPython] irc.rb Hi, I've created an irc.rb (attached) which mimics IronPython's pyc.py. It is failing on this line: Microsoft::Scripting::ScriptCode.save_to_assembly(outfile, codes.to_array()) With the following exception... Any help would be greatly appreciated. The test file I'm trying to compile is also attached. I am building on revision 140. I have also tried with the Microsoft.Scripting and Microsoft.Scripting.Core dlls from IronPython with the same result. C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll -verbose test.rb Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb... Creating output file C:\work\ironruby\co\svn\trunk\build\release\test.dll... C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:88:in `New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:in `New' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:294:in `DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:272:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:in `DefaultVisitScopeExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:218:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall er.Generated.cs:40:in `Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:in `UpdateAndExecute' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel egates.Generated.cs:52:in `Update4' from :0 From hellosticky at gmail.com Sat Sep 6 14:07:39 2008 From: hellosticky at gmail.com (KE) Date: Sat, 6 Sep 2008 08:07:39 -0400 Subject: [IronPython] irc.rb Message-ID: <48c272b7.1c17400a.5019.7769@mx.google.com> It's coming from the call stack -> CompileLambda -> AnalyzeLambda. The LambdaExpression is "($scope, $language) => [Scope]" but AnalyzeLambda passes a null CompilerScope to VariableBinder.Bind. Somehow this same VariableBinder is used during a ExpressionType.Call to: // // AST: MethodCallExpression // (RubyOps.CreateTopLevelScope)( .localScope ( ) , (.arg #globalScope), (.arg #language), (.var #self_5_0), (.var #rfc_nonlifted_5_2), ) It is using the VariableBinder with a null parent CompilerScope on the ".arg #globalScope" evaluation -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Saturday, September 06, 2008 7:25 AM To: 'Tomas Matousek'; 'IronRuby'; IronPython Subject: RE: [IronPython] irc.rb Okay, well I found two code problems in two IR implementations of IExpressionSerializable: /ironruby/Runtime/Calls/rubycallaction.cs CreateExpression() is passing the wrong second Type parameter. It should be typeof(RubyCallSignature) /ironruby/Runtime/Calls/rubycallsignature.cs CreateExpression() is not passing enough parameters. typeof(bool) and Ast.Constant(_hasRhsArgument) should be added to find the right Constructor. The next problem is: Variable '#globalScope' referenced from lambda 'C:\work\ironruby\co\svn\trunk\build\release\test.rb', but it is not defined in an outer scope In Microsoft.Scripting.Core.dll!System.Linq.Expressions.Compiler.VariableBinder .Reference(System.Linq.Expressions.Expression variable = {#globalScope}, bool hoist = false) Line 238 C# I'm guessing I haven't initialized some global context? Thanks, -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Saturday, September 06, 2008 6:50 AM To: 'Tomas Matousek'; 'Discussion of IronPython'; 'IronRuby' Subject: RE: [IronPython] irc.rb Thanks! I've also created a bug report: http://rubyforge.org/tracker/index.php?func=detail&aid=21839&group_id=4359&a tid=16798 This includes the irc.rb which I think IronRuby will be interested in including in the IronRuby distribution as well.. I'll try to step through into this bug and understand what's going on, although I have no clue what I'm looking at :) Thanks, -----Original Message----- From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Saturday, September 06, 2008 12:49 AM To: hellosticky at gmail.com; Discussion of IronPython; IronRuby Subject: RE: [IronPython] irc.rb Right. This is the error Dino overheard me talking about :) As you can see from the stack trac, something seems to be broken in DLR. I'll look at it and see whether I can come with a simple fix. Precompilation is currently P2 on our task list though, so I'm afraid any more complex work would need to wait until P1's are done. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 5:24 PM To: IronRuby Cc: IronPython Subject: [IronPython] irc.rb Hi, I've created an irc.rb (attached) which mimics IronPython's pyc.py. It is failing on this line: Microsoft::Scripting::ScriptCode.save_to_assembly(outfile, codes.to_array()) With the following exception... Any help would be greatly appreciated. The test file I'm trying to compile is also attached. I am building on revision 140. I have also tried with the Microsoft.Scripting and Microsoft.Scripting.Core dlls from IronPython with the same result. C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll -verbose test.rb Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb... Creating output file C:\work\ironruby\co\svn\trunk\build\release\test.dll... C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:88:in `New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:in `New' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:294:in `DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:272:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:in `DefaultVisitScopeExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:218:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall er.Generated.cs:40:in `Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:in `UpdateAndExecute' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel egates.Generated.cs:52:in `Update4' from :0 From dinov at microsoft.com Sat Sep 6 19:41:14 2008 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 6 Sep 2008 10:41:14 -0700 Subject: [IronPython] irc.rb In-Reply-To: <48c272b7.1c17400a.5019.7769@mx.google.com> References: <48c272b7.1c17400a.5019.7769@mx.google.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C638A@NA-EXMSG-C102.redmond.corp.microsoft.com> You'll probably want to track down where #globalScope is defined and make sure the newly defined variable is getting added to the list of variables in a Scope expression. If there's no scope expression you can just add one and give it the original body & the #globalScope var. Hopefully it's just the code which is immediately creating it causing the problem rather than a tree rewriter somewhere. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Saturday, September 06, 2008 5:08 AM To: Tomas Matousek; 'IronRuby'; IronPython Subject: Re: [IronPython] irc.rb It's coming from the call stack -> CompileLambda -> AnalyzeLambda. The LambdaExpression is "($scope, $language) => [Scope]" but AnalyzeLambda passes a null CompilerScope to VariableBinder.Bind. Somehow this same VariableBinder is used during a ExpressionType.Call to: // // AST: MethodCallExpression // (RubyOps.CreateTopLevelScope)( .localScope ( ) , (.arg #globalScope), (.arg #language), (.var #self_5_0), (.var #rfc_nonlifted_5_2), ) It is using the VariableBinder with a null parent CompilerScope on the ".arg #globalScope" evaluation -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Saturday, September 06, 2008 7:25 AM To: 'Tomas Matousek'; 'IronRuby'; IronPython Subject: RE: [IronPython] irc.rb Okay, well I found two code problems in two IR implementations of IExpressionSerializable: /ironruby/Runtime/Calls/rubycallaction.cs CreateExpression() is passing the wrong second Type parameter. It should be typeof(RubyCallSignature) /ironruby/Runtime/Calls/rubycallsignature.cs CreateExpression() is not passing enough parameters. typeof(bool) and Ast.Constant(_hasRhsArgument) should be added to find the right Constructor. The next problem is: Variable '#globalScope' referenced from lambda 'C:\work\ironruby\co\svn\trunk\build\release\test.rb', but it is not defined in an outer scope In Microsoft.Scripting.Core.dll!System.Linq.Expressions.Compiler.VariableBinder .Reference(System.Linq.Expressions.Expression variable = {#globalScope}, bool hoist = false) Line 238 C# I'm guessing I haven't initialized some global context? Thanks, -----Original Message----- From: KE [mailto:hellosticky at gmail.com] Sent: Saturday, September 06, 2008 6:50 AM To: 'Tomas Matousek'; 'Discussion of IronPython'; 'IronRuby' Subject: RE: [IronPython] irc.rb Thanks! I've also created a bug report: http://rubyforge.org/tracker/index.php?func=detail&aid=21839&group_id=4359&a tid=16798 This includes the irc.rb which I think IronRuby will be interested in including in the IronRuby distribution as well.. I'll try to step through into this bug and understand what's going on, although I have no clue what I'm looking at :) Thanks, -----Original Message----- From: Tomas Matousek [mailto:Tomas.Matousek at microsoft.com] Sent: Saturday, September 06, 2008 12:49 AM To: hellosticky at gmail.com; Discussion of IronPython; IronRuby Subject: RE: [IronPython] irc.rb Right. This is the error Dino overheard me talking about :) As you can see from the stack trac, something seems to be broken in DLR. I'll look at it and see whether I can come with a simple fix. Precompilation is currently P2 on our task list though, so I'm afraid any more complex work would need to wait until P1's are done. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KE Sent: Friday, September 05, 2008 5:24 PM To: IronRuby Cc: IronPython Subject: [IronPython] irc.rb Hi, I've created an irc.rb (attached) which mimics IronPython's pyc.py. It is failing on this line: Microsoft::Scripting::ScriptCode.save_to_assembly(outfile, codes.to_array()) With the following exception... Any help would be greatly appreciated. The test file I'm trying to compile is also attached. I am building on revision 140. I have also tried with the Microsoft.Scripting and Microsoft.Scripting.Core dlls from IronPython with the same result. C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll -verbose test.rb Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb... Creating output file C:\work\ironruby\co\svn\trunk\build\release\test.dll... C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:88:in `New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:in `New' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:294:in `DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:40:in `VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:264:in `DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:272:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:in `DefaultVisitScopeExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:218:in `VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:in `Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall er.Generated.cs:40:in `Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:in `UpdateAndExecute' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel egates.Generated.cs:52:in `Update4' from :0 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Sun Sep 7 02:29:16 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 6 Sep 2008 19:29:16 -0500 Subject: [IronPython] Reopening closed issues Message-ID: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> I've posted comments on #7050 and #17355 demonstrating that the issues are not yet fully resolved, but it occurs to me that it may go unnoticed. Please could someone reopen those issues so that they are not overlooked? In future would it be better if I open a new issue and link to the old one? -Dan From vernondcole at gmail.com Sun Sep 7 16:23:19 2008 From: vernondcole at gmail.com (Vernon Cole) Date: Sun, 7 Sep 2008 08:23:19 -0600 Subject: [IronPython] Fwd: adodbapi 2.2.1 (bugfix) release. In-Reply-To: References: Message-ID: [My attempt to send this to two mailing lists at once seems to have failed. This is a retry. -- VC] I found a bug in adodbapi v2.2 already. When putting data into a numeric database column, if the input was in a string (as for example the value of a wxPython grid cell), then the data would be truncated to the binary length of the field. So if I tried tried putting "12345" into an integer column, the value 1234 would be stored, because integers are 4 bytes long. This took me a while to find, since I kept looking at my wxwidgets code before finally uncovering adodbapi as the culpret. The fixed version is in the pywin32 CVS and in http://sourceforge.net/projects/adodbapi . For some good news, Mike Driscoll reports: I used your adodbapi module in my wxPython / SqlAlchemy program today and it > seemed to be returning the same data as the default module (which I think is > pyobdc). I don't know if my application truly stresses adodbapi , but it > does make lots of calls and accesses multiple tables in multiple databases. > > If anyone can test SqlAlchemy -> adodbapi -> IronPython please let us know if it works. -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From joesox at gmail.com Sun Sep 7 18:43:42 2008 From: joesox at gmail.com (JoeSox) Date: Sun, 7 Sep 2008 09:43:42 -0700 Subject: [IronPython] Engine Scope Message-ID: <785694cd0809070943y5000c47i52a2d813a7fd69ae@mail.gmail.com> Why can't I access the ArrayList class in the unworking example below? (Forgive me if this was covered previously but I couldn't find anything in the archives) ------------working example...------------------ IronPython 2.0 Beta (2.0.0.4000) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> clr.AddReference("System") >>> dir() ['__builtins__', '__doc__', '__name__', 'clr'] >>> from System.Collections import ArrayList >>> dir() ['ArrayList', '__builtins__', '__doc__', '__name__', 'clr'] >>> -------------nonworking example...----------------- ScriptEngine newengine = ScriptRuntime.Create().GetEngine("py"); ScriptScope scope = newengine.CreateScope(); string pycode = @" import clr clr.AddReference('System') from System.Collections import ArrayList"; ScriptSource source = newengine.CreateScriptSourceFromString(pycode, System.Scripting.SourceCodeKind.Statements); [Exception...] IronPython.Runtime.Exceptions.ImportException was unhandled Message="Cannot import name ArrayList" Source="IronPython" StackTrace: at IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name) at IronPython.Runtime.Operations.PythonOps.ImportFrom(CodeContext context, Object module, String name) at $1##1(Closure , Scope , LanguageContext ) at System.Scripting.ScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) at System.Scripting.ScriptCode.Run(Scope scope) at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)..... -- Later, JoeSox From fuzzyman at voidspace.org.uk Sun Sep 7 22:04:28 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 07 Sep 2008 21:04:28 +0100 Subject: [IronPython] Engine Scope In-Reply-To: <785694cd0809070943y5000c47i52a2d813a7fd69ae@mail.gmail.com> References: <785694cd0809070943y5000c47i52a2d813a7fd69ae@mail.gmail.com> Message-ID: <48C433CC.7040304@voidspace.org.uk> Hello JoeSox, If you look at the ArrayList documentation (URL below) you will see that although it lives in the System namespace, it comes from the mscorlib.dll assembly. You will have to add an additional reference in your Python code (ipy.exe adds references to both of these for you which is why your code works from the interactive interpreter). An alternative is adding the references to the assemblies from your hosting code using LoadAssembly. http://msdn.microsoft.com/en-us/library/system.collections.arraylist.aspx Michael JoeSox wrote: > Why can't I access the ArrayList class in the unworking example below? > (Forgive me if this was covered previously but I couldn't find > anything in the archives) > > ------------working example...------------------ > IronPython 2.0 Beta (2.0.0.4000) on .NET 2.0.50727.1433 > Type "help", "copyright", "credits" or "license" for more information. > >>>> import clr >>>> clr.AddReference("System") >>>> dir() >>>> > ['__builtins__', '__doc__', '__name__', 'clr'] > >>>> from System.Collections import ArrayList >>>> dir() >>>> > ['ArrayList', '__builtins__', '__doc__', '__name__', 'clr'] > > -------------nonworking example...----------------- > ScriptEngine newengine = ScriptRuntime.Create().GetEngine("py"); > ScriptScope scope = newengine.CreateScope(); > string pycode = @" > import clr > clr.AddReference('System') > from System.Collections import ArrayList"; > ScriptSource source = > newengine.CreateScriptSourceFromString(pycode, > System.Scripting.SourceCodeKind.Statements); > > [Exception...] > IronPython.Runtime.Exceptions.ImportException was unhandled > Message="Cannot import name ArrayList" > Source="IronPython" > StackTrace: > at IronPython.Runtime.Importer.ImportFrom(CodeContext context, > Object from, String name) > at IronPython.Runtime.Operations.PythonOps.ImportFrom(CodeContext > context, Object module, String name) > at $1##1(Closure , Scope , LanguageContext ) > at System.Scripting.ScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at System.Scripting.ScriptCode.Run(Scope scope) > at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope > scope)..... > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From joesox at gmail.com Sun Sep 7 22:45:03 2008 From: joesox at gmail.com (JoeSox) Date: Sun, 7 Sep 2008 13:45:03 -0700 Subject: [IronPython] Engine Scope In-Reply-To: <48C433CC.7040304@voidspace.org.uk> References: <785694cd0809070943y5000c47i52a2d813a7fd69ae@mail.gmail.com> <48C433CC.7040304@voidspace.org.uk> Message-ID: <785694cd0809071345i54290d04g733fd9a1ebcfeb22@mail.gmail.com> Perfect, thanks. On Sun, Sep 7, 2008 at 1:04 PM, Michael Foord wrote: > Hello JoeSox, > > If you look at the ArrayList documentation (URL below) you will see that > although it lives in the System namespace, it comes from the > mscorlib.dll assembly. > > You will have to add an additional reference in your Python code > (ipy.exe adds references to both of these for you which is why your code > works from the interactive interpreter). > > An alternative is adding the references to the assemblies from your > hosting code using LoadAssembly. > > http://msdn.microsoft.com/en-us/library/system.collections.arraylist.aspx > > Michael From fuzzyman at voidspace.org.uk Sun Sep 7 19:43:50 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 07 Sep 2008 18:43:50 +0100 Subject: [IronPython] Engine Scope In-Reply-To: <785694cd0809070943y5000c47i52a2d813a7fd69ae@mail.gmail.com> References: <785694cd0809070943y5000c47i52a2d813a7fd69ae@mail.gmail.com> Message-ID: <48C412D6.7080809@voidspace.org.uk> Hello JoeSox, If you look at the ArrayList documentation (URL below) you will see that although it lives in the System namespace, it comes from the mscorlib.dll assembly. You will have to add an additional reference in your Python code (ipy.exe adds references to both of these for you which is why your code works from the interactive interpreter). An alternative is adding the references to the assemblies from your hosting code using LoadAssembly. http://msdn.microsoft.com/en-us/library/system.collections.arraylist.aspx Michael JoeSox wrote: > Why can't I access the ArrayList class in the unworking example below? > (Forgive me if this was covered previously but I couldn't find > anything in the archives) > > ------------working example...------------------ > IronPython 2.0 Beta (2.0.0.4000) on .NET 2.0.50727.1433 > Type "help", "copyright", "credits" or "license" for more information. > >>>> import clr >>>> clr.AddReference("System") >>>> dir() >>>> > ['__builtins__', '__doc__', '__name__', 'clr'] > >>>> from System.Collections import ArrayList >>>> dir() >>>> > ['ArrayList', '__builtins__', '__doc__', '__name__', 'clr'] > > -------------nonworking example...----------------- > ScriptEngine newengine = ScriptRuntime.Create().GetEngine("py"); > ScriptScope scope = newengine.CreateScope(); > string pycode = @" > import clr > clr.AddReference('System') > from System.Collections import ArrayList"; > ScriptSource source = > newengine.CreateScriptSourceFromString(pycode, > System.Scripting.SourceCodeKind.Statements); > > [Exception...] > IronPython.Runtime.Exceptions.ImportException was unhandled > Message="Cannot import name ArrayList" > Source="IronPython" > StackTrace: > at IronPython.Runtime.Importer.ImportFrom(CodeContext context, > Object from, String name) > at IronPython.Runtime.Operations.PythonOps.ImportFrom(CodeContext > context, Object module, String name) > at $1##1(Closure , Scope , LanguageContext ) > at System.Scripting.ScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at System.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression > code, Scope scope) > at System.Scripting.ScriptCode.Run(Scope scope) > at System.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope > scope)..... > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From r.worbis at cubido.at Mon Sep 8 12:47:47 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Mon, 8 Sep 2008 12:47:47 +0200 Subject: [IronPython] DLR all languages release for Fullclient Message-ID: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> Hallo, can someone point me to a webpage or person that knows if there will be a release of ironpython + ironruby + JScript for the fullclient? thanks, Rainer -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Mon Sep 8 13:42:43 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Mon, 8 Sep 2008 12:42:43 +0100 Subject: [IronPython] DLR all languages release for Fullclient In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> Message-ID: At the moment there is not a pre-compiled DLR + IronRuby + IronPython for the desktop - only Silverlight. There will be once the DLR hits 1.0 (I've heard??) An older version was built for IronEditor (download the binaries), I need to update the build with the latest Silverlight SDK release. Basically, I use that code base and release and make a few tweaks for the desktop ;) Ben Blog.BenHall.me.uk On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis wrote: > > Hallo, > > can someone point me to a webpage or person that knows if there will be a > release of ironpython + ironruby + JScript for the fullclient? > > thanks, > Rainer > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From r.worbis at cubido.at Mon Sep 8 14:20:15 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Mon, 8 Sep 2008 14:20:15 +0200 Subject: [IronPython] DLR all languages release for Fullclient In-Reply-To: References: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> Message-ID: <676F9CCC1D1D3242BE4B133746E3807E53C118@XARA.cubido.linz> Thanks for the info - the most interesting thing for me is, if there will be a package with Jscript (as there was last year) Since I do not know how to compile a Silverlight Jscript version to the desktop this would be interesting. Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall Gesendet: Montag, 08. September 2008 13:43 An: Discussion of IronPython Betreff: Re: [IronPython] DLR all languages release for Fullclient At the moment there is not a pre-compiled DLR + IronRuby + IronPython for the desktop - only Silverlight. There will be once the DLR hits 1.0 (I've heard??) An older version was built for IronEditor (download the binaries), I need to update the build with the latest Silverlight SDK release. Basically, I use that code base and release and make a few tweaks for the desktop ;) Ben Blog.BenHall.me.uk On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis wrote: > > Hallo, > > can someone point me to a webpage or person that knows if there will be a > release of ironpython + ironruby + JScript for the fullclient? > > thanks, > Rainer > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From empirebuilder at gmail.com Mon Sep 8 16:45:40 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 8 Sep 2008 16:45:40 +0200 Subject: [IronPython] DLR all languages release for Fullclient In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807E53C118@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> <676F9CCC1D1D3242BE4B133746E3807E53C118@XARA.cubido.linz> Message-ID: <8cd017b80809080745v4846aecfl11c549e3dfbcc1f9@mail.gmail.com> Is the source for managed jscript available? On Mon, Sep 8, 2008 at 2:20 PM, Rainer Worbis wrote: > Thanks for the info - the most interesting thing for me is, if there will > be a package with Jscript (as there was last year) > Since I do not know how to compile a Silverlight Jscript version to the > desktop this would be interesting. > > Rainer > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall > Gesendet: Montag, 08. September 2008 13:43 > An: Discussion of IronPython > Betreff: Re: [IronPython] DLR all languages release for Fullclient > > At the moment there is not a pre-compiled DLR + IronRuby + IronPython > for the desktop - only Silverlight. There will be once the DLR hits > 1.0 (I've heard??) > > An older version was built for IronEditor (download the binaries), I > need to update the build with the latest Silverlight SDK release. > Basically, I use that code base and release and make a few tweaks for > the desktop ;) > > Ben > Blog.BenHall.me.uk > > On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis wrote: > > > > Hallo, > > > > can someone point me to a webpage or person that knows if there will be a > > release of ironpython + ironruby + JScript for the fullclient? > > > > thanks, > > Rainer > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Sep 8 17:19:48 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 8 Sep 2008 08:19:48 -0700 Subject: [IronPython] DLR all languages release for Fullclient In-Reply-To: <8cd017b80809080745v4846aecfl11c549e3dfbcc1f9@mail.gmail.com> References: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> <676F9CCC1D1D3242BE4B133746E3807E53C118@XARA.cubido.linz> <8cd017b80809080745v4846aecfl11c549e3dfbcc1f9@mail.gmail.com> Message-ID: No, or not yet anyway. I don't think they've decided yet on the best way to release this. On Mon, Sep 8, 2008 at 7:45 AM, Dody Gunawinata wrote: > Is the source for managed jscript available? > > On Mon, Sep 8, 2008 at 2:20 PM, Rainer Worbis wrote: > >> Thanks for the info - the most interesting thing for me is, if there will >> be a package with Jscript (as there was last year) >> Since I do not know how to compile a Silverlight Jscript version to the >> desktop this would be interesting. >> >> Rainer >> >> -----Urspr?ngliche Nachricht----- >> Von: users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall >> Gesendet: Montag, 08. September 2008 13:43 >> An: Discussion of IronPython >> Betreff: Re: [IronPython] DLR all languages release for Fullclient >> >> At the moment there is not a pre-compiled DLR + IronRuby + IronPython >> for the desktop - only Silverlight. There will be once the DLR hits >> 1.0 (I've heard??) >> >> An older version was built for IronEditor (download the binaries), I >> need to update the build with the latest Silverlight SDK release. >> Basically, I use that code base and release and make a few tweaks for >> the desktop ;) >> >> Ben >> Blog.BenHall.me.uk >> >> On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis >> wrote: >> > >> > Hallo, >> > >> > can someone point me to a webpage or person that knows if there will be >> a >> > release of ironpython + ironruby + JScript for the fullclient? >> > >> > thanks, >> > Rainer >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > > -- > nomadlife.org > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Sep 8 18:22:33 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 8 Sep 2008 09:22:33 -0700 Subject: [IronPython] Reopening closed issues In-Reply-To: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> I've re-opened the bugs. On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I believe we can only ask for the files by name and get them or not. In general I'd say opening a new bug might be the best way to get our attention but sending mail also works. Your comments should show up in the RSS feed so there's a good chance someone will catch them anyway. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Saturday, September 06, 2008 5:29 PM To: Discussion of IronPython Subject: [IronPython] Reopening closed issues I've posted comments on #7050 and #17355 demonstrating that the issues are not yet fully resolved, but it occurs to me that it may go unnoticed. Please could someone reopen those issues so that they are not overlooked? In future would it be better if I open a new issue and link to the old one? -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From christian2.schmidt at gmx.de Mon Sep 8 19:37:48 2008 From: christian2.schmidt at gmx.de (Christian Schmidt) Date: Mon, 08 Sep 2008 19:37:48 +0200 Subject: [IronPython] Determine used SymbolIds in an expression In-Reply-To: <48AD8DF1.5000302@gmx.de> References: <48AD8DF1.5000302@gmx.de> Message-ID: <48C562EC.2020308@gmx.de> Hi, I found some answers to my own questions. But I'm stuck again... > how can I determine the Symbols or SymbolIds that are used in an > (IP2-)expression? > Obviously I need to parse the expression. Where can I find a small > sample or tutorial on parsing in IP2? http://www.ironpython.info/index.php/The_IronPython_2_Parser Seems that the example is outdated. Here's my try, which compiles, but produces NullReferenceException when calling CreateParser and seems very complicated to me. Thanks for any help. class SymbolWalker : IronPython.Compiler.Ast.PythonWalker { public Dictionary symbols = new Dictionary(); public override bool Walk(NameExpression node) { symbols[node.Name] = 1; return true; } } IEnumerable GetSymbols(string pyExpression) { Microsoft.Scripting.Hosting.ScriptRuntime runtime = ScriptRuntime.Create(); Microsoft.Scripting.Hosting.ScriptEngine scriptEngine = runtime.GetEngine("py"); Microsoft.Scripting.Hosting.ScriptSource src = engine.CreateScriptSourceFromString(expression); System.Scripting.SourceUnit code = Microsoft.Scripting.Hosting.HostingHelpers.GetSourceUnit(src); System.Scripting.CompilerOptions opts = new System.Scripting.CompilerOptions(); System.Scripting.ErrorSink sink = System.Scripting.ErrorSink.Default; Microsoft.Scripting.Compilers.CompilerContext context = new Microsoft.Scripting.Compilers.CompilerContext(code, opts, sink); IronPython.PythonEngineOptions engineOptions = new IronPython.PythonEngineOptions(); IronPython.Compiler.Parser parser = IronPython.Compiler.Parser.CreateParser(context, engineOptions); IronPython.Compiler.Ast.Statement stmt = parser.ParseTopExpression(); SymbolWalker walker = new SymbolWalker(); stmt.Walk(walker); return walker.symbols.Keys; } From dinov at microsoft.com Tue Sep 9 06:05:46 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 8 Sep 2008 21:05:46 -0700 Subject: [IronPython] CodeContext In-Reply-To: <19127475.post@talk.nabble.com> References: <19126500.post@talk.nabble.com> <19127475.post@talk.nabble.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C69B3@NA-EXMSG-C102.redmond.corp.microsoft.com> I don't know if I missed a conclusion to this but there is a general way to get a CodeContext. A CodeContext is just a Scope and a LanguageContext. You can new up an empty scope and you can get a LanguageContext from HostingHelpers.GetLanguageContext. But all of this breaks the remoting story. If that's an issue for you there's always HostingHelpers.CallEngine which will give you the LanguageContext and run your code in the ScriptRuntime's app domain. But more on point you could also look at RuntimeHelpers.GetDynamicStackFrames which might give you the information you want w/ an easier to use interface from C#. If there's an interesting exception related goal in here we could look at adding it to the ExceptionOperations class. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Saturday, August 23, 2008 8:31 PM To: users at lists.ironpython.com Subject: Re: [IronPython] CodeContext I am try to get traceback object , for that i am trying different things Tomas Matousek wrote: The class might be actually be called ExceptionService in your bits. It was renamed recently. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tomas Matousek Sent: Saturday, August 23, 2008 7:53 PM To: Discussion of IronPython Subject: Re: [IronPython] CodeContext Does ExceptionOeprations class provide you the information you need or is something missing? You can get an instance via engine.GetService(). Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Saturday, August 23, 2008 4:56 PM To: users at lists.ironpython.com Subject: [IronPython] CodeContext how to get CodeContext from ScriptRuntime ,ScriptScope or ScriptEngine . basically i am try use this function: public static PythonTuple/*!*/ GetExceptionInfoLocal(CodeContext/*!*/ context, Exception ex) -- View this message in context: http://www.nabble.com/CodeContext-tp19126500p19126500.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ________________________________ View this message in context: Re: CodeContext Sent from the IronPython mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Tue Sep 9 23:43:26 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 9 Sep 2008 16:43:26 -0500 Subject: [IronPython] Reopening closed issues In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> On Mon, Sep 8, 2008 at 11:22 AM, Dino Viehland wrote: > On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I > believe we can only ask for the files by name and get them or not. Forgive me, but how is HTTP connected to importing? -Dan From dinov at microsoft.com Wed Sep 10 00:20:01 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Sep 2008 15:20:01 -0700 Subject: [IronPython] Reopening closed issues In-Reply-To: <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> In Silverlight we don't have access to the local file system. Instead we the DLR's PlatformAdaptionLayer, which IronPython 2.x builds upon for file access, and that is redirected to the web server. So our "file system" becomes limited by what HTTP is capable of supporting. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, September 09, 2008 2:43 PM To: Discussion of IronPython Subject: Re: [IronPython] Reopening closed issues On Mon, Sep 8, 2008 at 11:22 AM, Dino Viehland wrote: > On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I > believe we can only ask for the files by name and get them or not. Forgive me, but how is HTTP connected to importing? -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Sep 10 00:26:04 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 09 Sep 2008 23:26:04 +0100 Subject: [IronPython] Reopening closed issues In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48C6F7FC.5070306@voidspace.org.uk> Dino Viehland wrote: > In Silverlight we don't have access to the local file system. Instead we the DLR's PlatformAdaptionLayer, which IronPython 2.x builds upon for file access, and that is redirected to the web server. So our "file system" becomes limited by what HTTP is capable of supporting. > > But import is done from the xap file and not from the server right? Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, September 09, 2008 2:43 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Reopening closed issues > > On Mon, Sep 8, 2008 at 11:22 AM, Dino Viehland wrote: > >> On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I >> believe we can only ask for the files by name and get them or not. >> > > Forgive me, but how is HTTP connected to importing? > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at microsoft.com Wed Sep 10 00:50:06 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Sep 2008 15:50:06 -0700 Subject: [IronPython] Reopening closed issues In-Reply-To: <48C6F7FC.5070306@voidspace.org.uk> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6F7FC.5070306@voidspace.org.uk> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6E3B@NA-EXMSG-C102.redmond.corp.microsoft.com> I thought we were going directly to the web server but I could be wrong. Looking at the code it's not too clear to me - we go to Application.GetResourceStream(uri). I'm not sure whether that's a resource in the XAP or if that's the URI to get the resource from. If it is coming from the XAP then we might be able to check Application.ResourceDictionary to see if it has the specified URI. I'll have to talk to Jimmy about it more tomorrow. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, September 09, 2008 3:26 PM To: Discussion of IronPython Subject: Re: [IronPython] Reopening closed issues Dino Viehland wrote: > In Silverlight we don't have access to the local file system. Instead we the DLR's PlatformAdaptionLayer, which IronPython 2.x builds upon for file access, and that is redirected to the web server. So our "file system" becomes limited by what HTTP is capable of supporting. > > But import is done from the xap file and not from the server right? Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, September 09, 2008 2:43 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Reopening closed issues > > On Mon, Sep 8, 2008 at 11:22 AM, Dino Viehland wrote: > >> On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I >> believe we can only ask for the files by name and get them or not. >> > > Forgive me, but how is HTTP connected to importing? > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Sep 10 00:54:47 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 09 Sep 2008 23:54:47 +0100 Subject: [IronPython] Reopening closed issues In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C6E3B@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6F7FC.5070306@voidspace.org.uk> <350E7D38B6D819428718949920EC2355421B1C6E3B@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48C6FEB7.4030700@voidspace.org.uk> Dino Viehland wrote: > I thought we were going directly to the web server but I could be wrong. Looking at the code it's not too clear to me - we go to Application.GetResourceStream(uri). I'm not sure whether that's a resource in the XAP or if that's the URI to get the resource from. > > If it is coming from the XAP then we might be able to check Application.ResourceDictionary to see if it has the specified URI. I'll have to talk to Jimmy about it more tomorrow. > > In Silverlight 2 Beta 2 imports are definitely done from inside the xap file - and the module names that come back indicate that at the very least you know the name of the file fetched. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, September 09, 2008 3:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Reopening closed issues > > Dino Viehland wrote: > >> In Silverlight we don't have access to the local file system. Instead we the DLR's PlatformAdaptionLayer, which IronPython 2.x builds upon for file access, and that is redirected to the web server. So our "file system" becomes limited by what HTTP is capable of supporting. >> >> >> > But import is done from the xap file and not from the server right? > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Tuesday, September 09, 2008 2:43 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Reopening closed issues >> >> On Mon, Sep 8, 2008 at 11:22 AM, Dino Viehland wrote: >> >> >>> On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I >>> believe we can only ask for the files by name and get them or not. >>> >>> >> Forgive me, but how is HTTP connected to importing? >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at microsoft.com Wed Sep 10 01:07:10 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Sep 2008 16:07:10 -0700 Subject: [IronPython] Reopening closed issues In-Reply-To: <48C6FEB7.4030700@voidspace.org.uk> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6F7FC.5070306@voidspace.org.uk> <350E7D38B6D819428718949920EC2355421B1C6E3B@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6FEB7.4030700@voidspace.org.uk> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6E57@NA-EXMSG-C102.redmond.corp.microsoft.com> Ok, we might be able to enforce this then... I'll need to look at what's in that ResourceDictionary. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, September 09, 2008 3:55 PM To: Discussion of IronPython Subject: Re: [IronPython] Reopening closed issues Dino Viehland wrote: > I thought we were going directly to the web server but I could be wrong. Looking at the code it's not too clear to me - we go to Application.GetResourceStream(uri). I'm not sure whether that's a resource in the XAP or if that's the URI to get the resource from. > > If it is coming from the XAP then we might be able to check Application.ResourceDictionary to see if it has the specified URI. I'll have to talk to Jimmy about it more tomorrow. > > In Silverlight 2 Beta 2 imports are definitely done from inside the xap file - and the module names that come back indicate that at the very least you know the name of the file fetched. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, September 09, 2008 3:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Reopening closed issues > > Dino Viehland wrote: > >> In Silverlight we don't have access to the local file system. Instead we the DLR's PlatformAdaptionLayer, which IronPython 2.x builds upon for file access, and that is redirected to the web server. So our "file system" becomes limited by what HTTP is capable of supporting. >> >> >> > But import is done from the xap file and not from the server right? > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Tuesday, September 09, 2008 2:43 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Reopening closed issues >> >> On Mon, Sep 8, 2008 at 11:22 AM, Dino Viehland wrote: >> >> >>> On the Silverlight one there may be nothing we can do about it - HTTP doesn't have a dir or ls command so I >>> believe we can only ask for the files by name and get them or not. >>> >>> >> Forgive me, but how is HTTP connected to importing? >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Wed Sep 10 01:53:13 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Sep 2008 16:53:13 -0700 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6E9B@NA-EXMSG-C102.redmond.corp.microsoft.com> Do you have more info on this one? I've setup a package structure like: test\ __init__.py: print 'test.__init__' import interface interface.py: print 'test.interface' import templates templates\ __init__.py: print 'test.templates.__init__' from templates.galaxy_map import GalaxyMap # passes if I remove templates. galaxy_map.py: print 'test.templates.galaxy_map' class GalaxyMap: pass this fails on both CPython & IronPython because of "from templates.galaxy_map import GalaxyMap" but it doesn't do the import twice behavior you were seeing. It also passes if I change from templates.galaxy_map ... to just from galaxy_map ... so I'm guessing I haven't setup the repro 100% accurately. Can you point me at what I'm doing wrong? Maybe there's another package somewhere that collides with one of these names or something else strange? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Friday, September 05, 2008 11:04 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with importing in pre b5 On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher wrote: > On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: >> I'm going to make a lot of work for you guys before the day is out :) >> Maybe I should be posting these to the Issue Tracker? I'm just >> concerned they will get lost in the noise. > > Absolutely. Any problems you find *please* enter them as bugs into Codeplex! > Be careful what you wish for :) http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346 -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Wed Sep 10 02:05:20 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 9 Sep 2008 19:05:20 -0500 Subject: [IronPython] Reopening closed issues In-Reply-To: <48C6FEB7.4030700@voidspace.org.uk> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6F7FC.5070306@voidspace.org.uk> <350E7D38B6D819428718949920EC2355421B1C6E3B@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6FEB7.4030700@voidspace.org.uk> Message-ID: <4817b6fc0809091705h6845b9b4gfaf9a18e63e7e5b3@mail.gmail.com> > In Silverlight 2 Beta 2 imports are definitely done from inside the xap file > - and the module names that come back indicate that at the very least you > know the name of the file fetched. > Yes, GetResourceStream is used to access files in the .xap file. However, the module names come back in whatever case they were requested. Which means modules can be imported more than once if you use a different case. >>> import sTRING >>> sTRING >>> import string >>> string Furthermore it seems to me that from pkg import NAME can return a submodule name.py instead of a global variable NAME in pkg/__init__.py if executed before NAME is defined (say by something imported in pkg/__init__.py above declaration of NAME) This is actually how I stumbled across this. So this causes some very strange and hard to debug behavior. Hopefully there will be a way to fix this bug. -Dan From dan.eloff at gmail.com Wed Sep 10 04:08:17 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 9 Sep 2008 21:08:17 -0500 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C6E9B@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6E9B@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809091908r522efea4u72642ec2f40d5f3@mail.gmail.com> I tried to reproduce it and failed. I went back in time in the svn to look at the original code that triggers it, and it uses the importing format you use here. As you point out this won't run under IronPython or CPython. Granted it fails spectacularly under IronPython, but maybe that failure can be reproduced in CPython as well. I don't know as I have been unable to reproduce it so far outside of the original environment. Parent "test" package has a file called galaxy_map that contains a class GalaxyMap as well, which is imported by interface after "from test import templates" But I tried that in your test setup below and I got nothing but the same simple failure. Bottom line, is "from subpkg import foo" illegal? It's not a regression if it shouldn't have worked in b3 anyway. I'm sure you'd agree that your time is better spent on fixing things that should work. But if "from subpkg import foo" is allowable in some cases, then it may be worth fixing this bug. I'm willing to put in the effort required to make a reproduction if you still want to fix this, just let me know. -Dan On Tue, Sep 9, 2008 at 6:53 PM, Dino Viehland wrote: > Do you have more info on this one? I've setup a package structure like: > > test\ > __init__.py: > print 'test.__init__' > import interface > interface.py: > print 'test.interface' > import templates > templates\ > __init__.py: > print 'test.templates.__init__' > from templates.galaxy_map import GalaxyMap # passes if I remove templates. > galaxy_map.py: > print 'test.templates.galaxy_map' > class GalaxyMap: pass > > > this fails on both CPython & IronPython because of "from templates.galaxy_map import GalaxyMap" but it doesn't do the import twice behavior you were seeing. It also passes if I change from templates.galaxy_map ... to just from galaxy_map ... so I'm guessing I haven't setup the repro 100% accurately. Can you point me at what I'm doing wrong? Maybe there's another package somewhere that collides with one of these names or something else strange? > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, September 05, 2008 11:04 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Regression with importing in pre b5 > > On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher wrote: >> On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: >>> I'm going to make a lot of work for you guys before the day is out :) >>> Maybe I should be posting these to the Issue Tracker? I'm just >>> concerned they will get lost in the noise. >> >> Absolutely. Any problems you find *please* enter them as bugs into Codeplex! >> > > Be careful what you wish for :) > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346 > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at microsoft.com Wed Sep 10 05:09:46 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Sep 2008 20:09:46 -0700 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: <4817b6fc0809091908r522efea4u72642ec2f40d5f3@mail.gmail.com> References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6E9B@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091908r522efea4u72642ec2f40d5f3@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B1C6F0D@NA-EXMSG-C102.redmond.corp.microsoft.com> Well I guess it's not legal because CPython isn't allowing it :) But more interestingly after consulting http://www.python.org/doc/essays/packages.html I think it's because "from foo import bar" results in foo being searched in two locations. First is the containing modules __path__ list. 2nd is the normal module lookup process which enumerates sys.path and wouldn't know to prepend the test package when doing the search. So in this case from galaxy_map import GalaxyMap should work and find the templates local GalaxyMap because __path__ will be consulted first. Also from test.templates.galaxy_map - not to mention your relative imports solution. I actually failed to try this in b3 to see if it'll work but maybe it does. I'll check that but it's starting to sound like the import rules just got more correct w/ some other bug fix. But if you can find a repro that works in CPython but not IronPython I would definitely be interested. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, September 09, 2008 7:08 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with importing in pre b5 I tried to reproduce it and failed. I went back in time in the svn to look at the original code that triggers it, and it uses the importing format you use here. As you point out this won't run under IronPython or CPython. Granted it fails spectacularly under IronPython, but maybe that failure can be reproduced in CPython as well. I don't know as I have been unable to reproduce it so far outside of the original environment. Parent "test" package has a file called galaxy_map that contains a class GalaxyMap as well, which is imported by interface after "from test import templates" But I tried that in your test setup below and I got nothing but the same simple failure. Bottom line, is "from subpkg import foo" illegal? It's not a regression if it shouldn't have worked in b3 anyway. I'm sure you'd agree that your time is better spent on fixing things that should work. But if "from subpkg import foo" is allowable in some cases, then it may be worth fixing this bug. I'm willing to put in the effort required to make a reproduction if you still want to fix this, just let me know. -Dan On Tue, Sep 9, 2008 at 6:53 PM, Dino Viehland wrote: > Do you have more info on this one? I've setup a package structure like: > > test\ > __init__.py: > print 'test.__init__' > import interface > interface.py: > print 'test.interface' > import templates > templates\ > __init__.py: > print 'test.templates.__init__' > from templates.galaxy_map import GalaxyMap # passes if I remove templates. > galaxy_map.py: > print 'test.templates.galaxy_map' > class GalaxyMap: pass > > > this fails on both CPython & IronPython because of "from templates.galaxy_map import GalaxyMap" but it doesn't do the import twice behavior you were seeing. It also passes if I change from templates.galaxy_map ... to just from galaxy_map ... so I'm guessing I haven't setup the repro 100% accurately. Can you point me at what I'm doing wrong? Maybe there's another package somewhere that collides with one of these names or something else strange? > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, September 05, 2008 11:04 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Regression with importing in pre b5 > > On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher wrote: >> On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: >>> I'm going to make a lot of work for you guys before the day is out :) >>> Maybe I should be posting these to the Issue Tracker? I'm just >>> concerned they will get lost in the noise. >> >> Absolutely. Any problems you find *please* enter them as bugs into Codeplex! >> > > Be careful what you wish for :) > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346 > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From inflyttningshest at gmail.com Wed Sep 10 13:32:33 2008 From: inflyttningshest at gmail.com (Hannes Rahm) Date: Wed, 10 Sep 2008 13:32:33 +0200 Subject: [IronPython] Accessing classes defined in hosting c# application Message-ID: Hello people! I am developing a small multiplayer game in c# (using xna for graphics). On the server side I am doing a lot of the logic programming in IronPython. I have gotten to the point where I want to inherit from my "Entity" class defined in the hosting application source (c#) so I can specialize it for different purposes in IronPython. I do not know how to accomplish this. I have temporarily solved this by having a python wrapper class around the c# object (which I have to create using a CreateEntity() function in one of the global objects I pass in from "outside"). Alternatively I can add a public object ScriptingObject; that I can fill with what I want from python. But both these solutions seem a tad bit inelegant. Does anyone have any ideas on how to do this? Best regards /Hannes -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Sep 10 13:35:09 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 10 Sep 2008 12:35:09 +0100 Subject: [IronPython] Accessing classes defined in hosting c# application In-Reply-To: References: Message-ID: <48C7B0ED.9030007@voidspace.org.uk> Hannes Rahm wrote: > Hello people! > > I am developing a small multiplayer game in c# (using xna for graphics). > On the server side I am doing a lot of the logic programming in > IronPython. > > I have gotten to the point where I want to inherit from my "Entity" > class defined in the hosting application source (c#) so I can > specialize it for different purposes in IronPython. > I do not know how to accomplish this. IronPython classes can inherit directly from C# classes. If this *isn't* achieving what you want could you provide some specific examples? Thanks Michael Foord > > I have temporarily solved this by having a python wrapper class around > the c# object (which I have to create using a CreateEntity() function > in one of the global objects I pass in from "outside"). Alternatively > I can add a public object ScriptingObject; that I can fill with what I > want from python. But both these solutions seem a tad bit inelegant. > > Does anyone have any ideas on how to do this? > > Best regards > /Hannes > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From curt at hagenlocher.org Wed Sep 10 14:11:44 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 10 Sep 2008 05:11:44 -0700 Subject: [IronPython] Accessing classes defined in hosting c# application In-Reply-To: References: Message-ID: Are you exposing your hosting assembly to Python by calling ScriptRuntime.LoadAssembly? If so, you ought to be able to import your Entity class directly into Python and derive from it. On Wed, Sep 10, 2008 at 4:32 AM, Hannes Rahm wrote: > Hello people! > > I am developing a small multiplayer game in c# (using xna for graphics). > On the server side I am doing a lot of the logic programming in IronPython. > > I have gotten to the point where I want to inherit from my "Entity" class > defined in the hosting application source (c#) so I can specialize it for > different purposes in IronPython. > I do not know how to accomplish this. > > I have temporarily solved this by having a python wrapper class around the > c# object (which I have to create using a CreateEntity() function in one of > the global objects I pass in from "outside"). Alternatively I can add a > public object ScriptingObject; that I can fill with what I want from python. > But both these solutions seem a tad bit inelegant. > > Does anyone have any ideas on how to do this? > > Best regards > /Hannes > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinjvinj at gmail.com Wed Sep 10 16:05:58 2008 From: vinjvinj at gmail.com (Vineet Jain (gmail)) Date: Wed, 10 Sep 2008 10:05:58 -0400 Subject: [IronPython] In silverlight beta 2 is there any way to seperate the iron python assemblies from the app? Message-ID: <005001c9134e$5a4b9750$0ee2c5f0$@com> This is from Michael's web site: - Including the IronPython assemblies in every application makes even the simplest Dynamic Silverlight application painfully large. In answer to this point in a comment on his blog, John Lam replied: "Depending on how you configure your app, you can download the DSL dependencies (DLR + IronRuby) in a separate XAP that comes from one of our servers (this isn't working yet). So your XAP becomes something like 2K in that case. It will also be cached in your browser cache so it is a one-time download.". So this story will get better... I looked on John Lam's blog and saw no updates on it since April. Was wondering if there has been any progress on it and is it part of the silverlight beta 2 and the sdk 0.3? Thanks, Vineet -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian2.schmidt at gmx.de Wed Sep 10 16:58:38 2008 From: christian2.schmidt at gmx.de (Christian Schmidt) Date: Wed, 10 Sep 2008 16:58:38 +0200 Subject: [IronPython] Usage of IronPython 2 Parser Message-ID: <48C7E09E.8000609@gmx.de> Dear community, please could anyone provide an example of how to create a parser in IronPython 2.0 Beta 4. The examples I found are outdated (based on IP 2.0a3) and my own try ended in NullReferenceException (see my post on 2008-09-08). Thanks Christian From Jim.O'Leary at vancouver.ca Wed Sep 10 18:46:45 2008 From: Jim.O'Leary at vancouver.ca (O'Leary, Jim) Date: Wed, 10 Sep 2008 09:46:45 -0700 Subject: [IronPython] SOAPAction header Message-ID: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> I am trying to access a web service on a SharePoint site using IronPython. The web service can be accessed via a vb.NET app, but not from IronPython. Sniffing the packets from both IronPython and vb.NET transactions shows that the SOAP envelope and all headers are exactly the same in both transactions, except for the SOAPAction header, which is missing in the IronPython app. At a certain point the server sends back the following faultstring: Unable to handle request without a valid action parameter. Please supply a valid soap action. How to you add this header? Below is my code. I am able to authenticate, but the app chokes on the request.GetResponse() line with 500 Internal Server Error. query = Encoding.UTF8.GetBytes('''B8AF4305 -7BB5-4F9D-9553-F1144F7DEEA55000000''') request = HttpWebRequest.Create('http://myserver/ims/_vti_bin/Lists.asmx') request.Method = "POST" myCredentials = System.Net.NetworkCredential myCredentials = System.Net.CredentialCache.DefaultCredentials request.Credentials = myCredentials request.ContentType = "text/xml; charset=utf-8" request.ContentLength = query.Length request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)" requestStream = request.GetRequestStream() requestStream.Write(query,0,query.Length) response = request.GetResponse() Thanks Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Sep 10 22:15:10 2008 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 10 Sep 2008 13:15:10 -0700 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: <350E7D38B6D819428718949920EC2355421B1C6F0D@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6E9B@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091908r522efea4u72642ec2f40d5f3@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6F0D@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC2355421B339B0F@NA-EXMSG-C102.redmond.corp.microsoft.com> Ok, I've confirmed the repro works in B3 but is broken in B4. Indeed it looks like we're just more compatible w/ CPython than we were before. I'm going to go ahead and close the bug. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, September 09, 2008 8:10 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with importing in pre b5 Well I guess it's not legal because CPython isn't allowing it :) But more interestingly after consulting http://www.python.org/doc/essays/packages.html I think it's because "from foo import bar" results in foo being searched in two locations. First is the containing modules __path__ list. 2nd is the normal module lookup process which enumerates sys.path and wouldn't know to prepend the test package when doing the search. So in this case from galaxy_map import GalaxyMap should work and find the templates local GalaxyMap because __path__ will be consulted first. Also from test.templates.galaxy_map - not to mention your relative imports solution. I actually failed to try this in b3 to see if it'll work but maybe it does. I'll check that but it's starting to sound like the import rules just got more correct w/ some other bug fix. But if you can find a repro that works in CPython but not IronPython I would definitely be interested. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, September 09, 2008 7:08 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with importing in pre b5 I tried to reproduce it and failed. I went back in time in the svn to look at the original code that triggers it, and it uses the importing format you use here. As you point out this won't run under IronPython or CPython. Granted it fails spectacularly under IronPython, but maybe that failure can be reproduced in CPython as well. I don't know as I have been unable to reproduce it so far outside of the original environment. Parent "test" package has a file called galaxy_map that contains a class GalaxyMap as well, which is imported by interface after "from test import templates" But I tried that in your test setup below and I got nothing but the same simple failure. Bottom line, is "from subpkg import foo" illegal? It's not a regression if it shouldn't have worked in b3 anyway. I'm sure you'd agree that your time is better spent on fixing things that should work. But if "from subpkg import foo" is allowable in some cases, then it may be worth fixing this bug. I'm willing to put in the effort required to make a reproduction if you still want to fix this, just let me know. -Dan On Tue, Sep 9, 2008 at 6:53 PM, Dino Viehland wrote: > Do you have more info on this one? I've setup a package structure like: > > test\ > __init__.py: > print 'test.__init__' > import interface > interface.py: > print 'test.interface' > import templates > templates\ > __init__.py: > print 'test.templates.__init__' > from templates.galaxy_map import GalaxyMap # passes if I remove templates. > galaxy_map.py: > print 'test.templates.galaxy_map' > class GalaxyMap: pass > > > this fails on both CPython & IronPython because of "from templates.galaxy_map import GalaxyMap" but it doesn't do the import twice behavior you were seeing. It also passes if I change from templates.galaxy_map ... to just from galaxy_map ... so I'm guessing I haven't setup the repro 100% accurately. Can you point me at what I'm doing wrong? Maybe there's another package somewhere that collides with one of these names or something else strange? > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, September 05, 2008 11:04 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Regression with importing in pre b5 > > On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher wrote: >> On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: >>> I'm going to make a lot of work for you guys before the day is out :) >>> Maybe I should be posting these to the Issue Tracker? I'm just >>> concerned they will get lost in the noise. >> >> Absolutely. Any problems you find *please* enter them as bugs into Codeplex! >> > > Be careful what you wish for :) > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346 > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Wed Sep 10 22:59:23 2008 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 10 Sep 2008 13:59:23 -0700 Subject: [IronPython] Usage of IronPython 2 Parser In-Reply-To: <48C7E09E.8000609@gmx.de> References: <48C7E09E.8000609@gmx.de> Message-ID: <350E7D38B6D819428718949920EC2355421B339B91@NA-EXMSG-C102.redmond.corp.microsoft.com> Here's how to do it for both beta 4 & beta 5 in Python: import clr clr.AddReference('IronPython') clr.AddReference('Microsoft.Scripting') clr.AddReference('Microsoft.Scripting.Core') from IronPython.Compiler import Parser # beta 4 from Microsoft.Scripting.Hosting import HostingHelpers from Microsoft.Scripting.Hosting import ScriptRuntime from System.Scripting import ErrorSink from Microsoft.Scripting.Compilers import CompilerContext py = ScriptRuntime.Create().GetEngine('py') # beta 5 #from Microsoft.Scripting import ErrorSink #from Microsoft.Scripting.Runtime import CompilerContext #from Microsoft.Scripting.Hosting.Providers import HostingHelpers #from IronPython.Hosting import Python #py = Python.CreateEngine() # beta 5 and beyond src = HostingHelpers.GetSourceUnit(py.CreateScriptSourceFromString('print "hello"')) pylc = HostingHelpers.GetLanguageContext(py) p = Parser.CreateParser(CompilerContext(src, pylc.GetCompilerOptions(), ErrorSink.Default), pylc.Options) ast = p.ParseFile(True) print ast.Body -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Schmidt Sent: Wednesday, September 10, 2008 7:59 AM To: Discussion of IronPython Subject: [IronPython] Usage of IronPython 2 Parser Dear community, please could anyone provide an example of how to create a parser in IronPython 2.0 Beta 4. The examples I found are outdated (based on IP 2.0a3) and my own try ended in NullReferenceException (see my post on 2008-09-08). Thanks Christian _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Wed Sep 10 23:14:02 2008 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 10 Sep 2008 14:14:02 -0700 Subject: [IronPython] SOAPAction header In-Reply-To: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> References: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> Message-ID: <350E7D38B6D819428718949920EC2355421B339BB9@NA-EXMSG-C102.redmond.corp.microsoft.com> Can you post the equivalent VB.NET code? My first guess would be there's an attribute somewhere which is carrying the action - but it is just a guess. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of O'Leary, Jim Sent: Wednesday, September 10, 2008 9:47 AM To: users at lists.ironpython.com Subject: [IronPython] SOAPAction header I am trying to access a web service on a SharePoint site using IronPython. The web service can be accessed via a vb.NET app, but not from IronPython. Sniffing the packets from both IronPython and vb.NET transactions shows that the SOAP envelope and all headers are exactly the same in both transactions, except for the SOAPAction header, which is missing in the IronPython app. At a certain point the server sends back the following faultstring: Unable to handle request without a valid action parameter. Please supply a valid soap action. How to you add this header? Below is my code. I am able to authenticate, but the app chokes on the request.GetResponse() line with 500 Internal Server Error. query = Encoding.UTF8.GetBytes('''B8AF4305-7BB5-4F9D-9553-F1144F7DEEA55000000''') request = HttpWebRequest.Create('http://myserver/ims/_vti_bin/Lists.asmx') request.Method = "POST" myCredentials = System.Net.NetworkCredential myCredentials = System.Net.CredentialCache.DefaultCredentials request.Credentials = myCredentials request.ContentType = "text/xml; charset=utf-8" request.ContentLength = query.Length request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)" requestStream = request.GetRequestStream() requestStream.Write(query,0,query.Length) response = request.GetResponse() Thanks Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Sep 10 23:56:31 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 10 Sep 2008 14:56:31 -0700 Subject: [IronPython] In silverlight beta 2 is there any way to seperate the iron python assemblies from the app? In-Reply-To: <005001c9134e$5a4b9750$0ee2c5f0$@com> References: <005001c9134e$5a4b9750$0ee2c5f0$@com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EA4825D@NA-EXMSG-C116.redmond.corp.microsoft.com> My blog has up-to-date information about the Silverlight support for IPy. We don't have a well-known server to host the DLLs on, but you can definitely put the DLLs outside of the XAP. Checkout sdksdk-0.3.0-bin.zip/bin/Chiron.exe.config ... there's documentation in there that tells you how to configure Chiron to produce a XAP with the DLLs outside. I talk about it in this blog post: http://blog.jimmy.schementi.com/2008/05/story-of-ruby-and-python-in-silverlight.html Documentation is being written to go up on the codeplex site. Let me know if you'd like to contribute to it. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vineet Jain (gmail) Sent: Wednesday, September 10, 2008 7:06 AM To: users at lists.ironpython.com Subject: [IronPython] In silverlight beta 2 is there any way to seperate the iron python assemblies from the app? This is from Michael's web site: - Including the IronPython assemblies in every application makes even the simplest Dynamic Silverlight application painfully large. In answer to this point in a comment on his blog, John Lam replied: "Depending on how you configure your app, you can download the DSL dependencies (DLR + IronRuby) in a separate XAP that comes from one of our servers (this isn't working yet). So your XAP becomes something like 2K in that case. It will also be cached in your browser cache so it is a one-time download.". So this story will get better... I looked on John Lam's blog and saw no updates on it since April. Was wondering if there has been any progress on it and is it part of the silverlight beta 2 and the sdk 0.3? Thanks, Vineet -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Sep 11 00:00:51 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 10 Sep 2008 15:00:51 -0700 Subject: [IronPython] Reopening closed issues In-Reply-To: <4817b6fc0809091705h6845b9b4gfaf9a18e63e7e5b3@mail.gmail.com> References: <4817b6fc0809061729g4ca52f39m3b5007a2a6aa0633@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6551@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091443g679bbb11rbc50d19b1d35d7ab@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6DFF@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6F7FC.5070306@voidspace.org.uk> <350E7D38B6D819428718949920EC2355421B1C6E3B@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C6FEB7.4030700@voidspace.org.uk> <4817b6fc0809091705h6845b9b4gfaf9a18e63e7e5b3@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EA4826A@NA-EXMSG-C116.redmond.corp.microsoft.com> To clarify, "imports" today only look in the XAP file, they do not make a HTTP request. The HTTP request was made back in the SL1.1 days when we didn't have a XAP. In the future, this may also be able to look in IsolatedStorage, but we won't be making HTTP requests, since the request can only be made with asynchronously, and that would require continuation support. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, September 09, 2008 5:05 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Reopening closed issues > > > In Silverlight 2 Beta 2 imports are definitely done from inside the > xap file > > - and the module names that come back indicate that at the very least > you > > know the name of the file fetched. > > > > Yes, GetResourceStream is used to access files in the .xap file. > However, the module names come back in whatever case they were > requested. Which means modules can be imported more than once if you > use a different case. > > >>> import sTRING > >>> sTRING > > >>> import string > >>> string > > > Furthermore it seems to me that from pkg import NAME can return a > submodule name.py instead of a global variable NAME in pkg/__init__.py > if executed before NAME is defined (say by something imported in > pkg/__init__.py above declaration of NAME) This is actually how I > stumbled across this. > > So this causes some very strange and hard to debug behavior. Hopefully > there will be a way to fix this bug. > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Thu Sep 11 00:03:23 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 10 Sep 2008 15:03:23 -0700 Subject: [IronPython] DLR all languages release for Fullclient In-Reply-To: References: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz> <676F9CCC1D1D3242BE4B133746E3807E53C118@XARA.cubido.linz> <8cd017b80809080745v4846aecfl11c549e3dfbcc1f9@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EA48271@NA-EXMSG-C116.redmond.corp.microsoft.com> The jury is still churning on releasing the source for JScript. When I know what's going on with this, you'll know. When DLR 1.0 is out on its own codeplex site, then we'll have both Desktop and Silverlight builds of all the languages that work with the same DLR. ~Jimmy From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, September 08, 2008 8:20 AM To: dody at nomadlife.org; Discussion of IronPython Subject: Re: [IronPython] DLR all languages release for Fullclient No, or not yet anyway. I don't think they've decided yet on the best way to release this. On Mon, Sep 8, 2008 at 7:45 AM, Dody Gunawinata > wrote: Is the source for managed jscript available? On Mon, Sep 8, 2008 at 2:20 PM, Rainer Worbis > wrote: Thanks for the info - the most interesting thing for me is, if there will be a package with Jscript (as there was last year) Since I do not know how to compile a Silverlight Jscript version to the desktop this would be interesting. Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall Gesendet: Montag, 08. September 2008 13:43 An: Discussion of IronPython Betreff: Re: [IronPython] DLR all languages release for Fullclient At the moment there is not a pre-compiled DLR + IronRuby + IronPython for the desktop - only Silverlight. There will be once the DLR hits 1.0 (I've heard??) An older version was built for IronEditor (download the binaries), I need to update the build with the latest Silverlight SDK release. Basically, I use that code base and release and make a few tweaks for the desktop ;) Ben Blog.BenHall.me.uk On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis > wrote: > > Hallo, > > can someone point me to a webpage or person that knows if there will be a > release of ironpython + ironruby + JScript for the fullclient? > > thanks, > Rainer > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Sep 11 00:07:18 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 10 Sep 2008 15:07:18 -0700 Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? In-Reply-To: <4817b6fc0809051432if356672o273049a6b06d6fc4@mail.gmail.com> References: <4817b6fc0809051423g77305d04qc362bcc1862cf58b@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C61F0@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809051432if356672o273049a6b06d6fc4@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EA48277@NA-EXMSG-C116.redmond.corp.microsoft.com> FYI Dan, our source tree only builds against Silverlight 2 Beta 2; we haven't moved to an internal build since we want every build to work with the public Silverlight bits. I have built our code against an internal build, and this is minimal patching necessary to get it working, so we'll keep building against Silverlight 2 Beta 2 until the last possible moment (next public release of Silverlight). ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, September 05, 2008 2:32 PM > To: Discussion of IronPython > Subject: Re: [IronPython] sdlsdk-0.3.0 - cannot import struct? > > Ok, great, thanks. That's an easy fix. I'll be alert for other such > changes now. > > -Dan > > On Fri, Sep 5, 2008 at 4:30 PM, Curt Hagenlocher > wrote: > > To expand on this just a little, CPython implements the module > "_struct" in > > C and implementes the module "struct" in Python. As we're both > aiming for > > parity with CPython in these matters and now redistributing the > standard > > Python library, we changed our implementation to be _struct- > compatible. > > Bottom line: you need to use struct.py from the standard Python libs. > > > > On Fri, Sep 5, 2008 at 2:26 PM, Dino Viehland > wrote: > >> > >> Can you import _struct? We recently did the work to get this > compliant w/ > >> 2.5. > >> > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com > >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > >> Sent: Friday, September 05, 2008 2:23 PM > >> To: Discussion of IronPython > >> Subject: [IronPython] sdlsdk-0.3.0 - cannot import struct? > >> > >> I downloaded sdlsdk-0.3.0 and replaced the .dlls in the silverlight > >> folder (C:\Program Files (x86)\Microsoft > >> SDKs\Silverlight\v2.0\Libraries\Client) with the ones from the > >> sdlsdk/bin folder. I created an app.py file with just "import > struct". > >> This fails: ImportError: No module named struct > >> > >> I guess that the sdlsdk IronPython is pretty badly broken (or is > built > >> with an internal, version of silverlight, not beta2?) > >> > >> If I can resolve the build errors for Silverlight Relese for the > >> lastest IronPython source dump, will this work, or will I still be > >> unable to import struct? > >> > >> What can I do to move forward here? > >> > >> Thanks, > >> -Dan > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Thu Sep 11 00:31:29 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 10 Sep 2008 17:31:29 -0500 Subject: [IronPython] Regression with importing in pre b5 In-Reply-To: <350E7D38B6D819428718949920EC2355421B339B0F@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809051716w7ed771c0lb72b57630c4af1e6@mail.gmail.com> <4817b6fc0809052303n2161af80n4f5ab87a0c328c73@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6E9B@NA-EXMSG-C102.redmond.corp.microsoft.com> <4817b6fc0809091908r522efea4u72642ec2f40d5f3@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B1C6F0D@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421B339B0F@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809101531t405042beq9bd614a7093ef54e@mail.gmail.com> Turns out this one was my bad :) Sorry for wasting your time. -Dan On Wed, Sep 10, 2008 at 3:15 PM, Dino Viehland wrote: > Ok, I've confirmed the repro works in B3 but is broken in B4. Indeed it looks like we're just more compatible w/ CPython than we were before. I'm going to go ahead and close the bug. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Tuesday, September 09, 2008 8:10 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Regression with importing in pre b5 > > Well I guess it's not legal because CPython isn't allowing it :) > > But more interestingly after consulting http://www.python.org/doc/essays/packages.html I think it's because "from foo import bar" results in foo being searched in two locations. First is the containing modules __path__ list. 2nd is the normal module lookup process which enumerates sys.path and wouldn't know to prepend the test package when doing the search. So in this case from galaxy_map import GalaxyMap should work and find the templates local GalaxyMap because __path__ will be consulted first. Also from test.templates.galaxy_map - not to mention your relative imports solution. > > I actually failed to try this in b3 to see if it'll work but maybe it does. I'll check that but it's starting to sound like the import rules just got more correct w/ some other bug fix. But if you can find a repro that works in CPython but not IronPython I would definitely be interested. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, September 09, 2008 7:08 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Regression with importing in pre b5 > > I tried to reproduce it and failed. I went back in time in the svn to > look at the original code that triggers it, and it uses the importing > format you use here. As you point out this won't run under IronPython > or CPython. Granted it fails spectacularly under IronPython, but maybe > that failure can be reproduced in CPython as well. I don't know as I > have been unable to reproduce it so far outside of the original > environment. > > Parent "test" package has a file called galaxy_map that contains a > class GalaxyMap as well, which is imported by interface after "from > test import templates" But I tried that in your test setup below and I > got nothing but the same simple failure. > > Bottom line, is "from subpkg import foo" illegal? It's not a > regression if it shouldn't have worked in b3 anyway. I'm sure you'd > agree that your time is better spent on fixing things that should > work. But if "from subpkg import foo" is allowable in some cases, then > it may be worth fixing this bug. I'm willing to put in the effort > required to make a reproduction if you still want to fix this, just > let me know. > > -Dan > > On Tue, Sep 9, 2008 at 6:53 PM, Dino Viehland wrote: >> Do you have more info on this one? I've setup a package structure like: >> >> test\ >> __init__.py: >> print 'test.__init__' >> import interface >> interface.py: >> print 'test.interface' >> import templates >> templates\ >> __init__.py: >> print 'test.templates.__init__' >> from templates.galaxy_map import GalaxyMap # passes if I remove templates. >> galaxy_map.py: >> print 'test.templates.galaxy_map' >> class GalaxyMap: pass >> >> >> this fails on both CPython & IronPython because of "from templates.galaxy_map import GalaxyMap" but it doesn't do the import twice behavior you were seeing. It also passes if I change from templates.galaxy_map ... to just from galaxy_map ... so I'm guessing I haven't setup the repro 100% accurately. Can you point me at what I'm doing wrong? Maybe there's another package somewhere that collides with one of these names or something else strange? >> >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Friday, September 05, 2008 11:04 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Regression with importing in pre b5 >> >> On Sat, Sep 6, 2008 at 12:04 AM, Curt Hagenlocher wrote: >>> On Fri, Sep 5, 2008 at 5:16 PM, Dan Eloff wrote: >>>> I'm going to make a lot of work for you guys before the day is out :) >>>> Maybe I should be posting these to the Issue Tracker? I'm just >>>> concerned they will get lost in the noise. >>> >>> Absolutely. Any problems you find *please* enter them as bugs into Codeplex! >>> >> >> Be careful what you wish for :) >> >> http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18346 >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From vinjvinj at gmail.com Thu Sep 11 04:13:57 2008 From: vinjvinj at gmail.com (Vineet Jain (gmail)) Date: Wed, 10 Sep 2008 22:13:57 -0400 Subject: [IronPython] In silverlight beta 2 is there any way to seperate the iron python assemblies from the app? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489EA4825D@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <005001c9134e$5a4b9750$0ee2c5f0$@com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EA4825D@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <001e01c913b4$0d8faad0$28af0070$@com> Thanks for the link. Your article was detailed and very helpful, my xap files are going to be nice and small now. Vineet From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Wednesday, September 10, 2008 5:57 PM To: Discussion of IronPython Subject: Re: [IronPython] In silverlight beta 2 is there any way to seperate the iron python assemblies from the app? My blog has up-to-date information about the Silverlight support for IPy. We don't have a well-known server to host the DLLs on, but you can definitely put the DLLs outside of the XAP. Checkout sdksdk-0.3.0-bin.zip/bin/Chiron.exe.config ... there's documentation in there that tells you how to configure Chiron to produce a XAP with the DLLs outside. I talk about it in this blog post: http://blog.jimmy.schementi.com/2008/05/story-of-ruby-and-python-in-silverli ght.html Documentation is being written to go up on the codeplex site. Let me know if you'd like to contribute to it. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vineet Jain (gmail) Sent: Wednesday, September 10, 2008 7:06 AM To: users at lists.ironpython.com Subject: [IronPython] In silverlight beta 2 is there any way to seperate the iron python assemblies from the app? This is from Michael's web site: - Including the IronPython assemblies in every application makes even the simplest Dynamic Silverlight application painfully large. In answer to this point in a comment on his blog, John Lam replied: "Depending on how you configure your app, you can download the DSL dependencies (DLR + IronRuby) in a separate XAP that comes from one of our servers (this isn't working yet). So your XAP becomes something like 2K in that case. It will also be cached in your browser cache so it is a one-time download.". So this story will get better... I looked on John Lam's blog and saw no updates on it since April. Was wondering if there has been any progress on it and is it part of the silverlight beta 2 and the sdk 0.3? Thanks, Vineet -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Thu Sep 11 06:44:15 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Thu, 11 Sep 2008 06:44:15 +0200 Subject: [IronPython] SOAPAction header In-Reply-To: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> References: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> Message-ID: <233dfa1d0809102144o215baaddnf5d8498eabfe43f7@mail.gmail.com> Jim, first of all, why aren't you using .NET infrastructrue to invoke WebService? I suspect this is the reason, because you forgot to set he HTTP header attribute, and infrastracture (are you using generated proxy stub in VB.NET?) does this for you. You should create you proxy by deriving from System.ServiceModel.ClientBase for WCF clients, and for regular clients, you should derive from System.Web.Services.Protocols.SoapHttpClientProtocol. wsdl.exe (or svcutil.exe) does this automatically for you. And I would not create thos proxy classes in IPy, but would rather create a proxy in c# (with them tools :)) and then just use this .net object to invoke my web service from IPY like so: clr.AddReference("MyDllWhichContainsWSProxy") from MyNamespace import MyWSProxy foo = MyWSProxy foo.Url = "http://...." result = foo.MethodX([1,2,3]) I hope I'm not missing anything... rgds, Miha. ps: If you still want to do it the hard way, just add the apropriate SOAPAction HTTP header to your HTTP request. SOAPAction headers are different for each method you invoke and are defined in WSDL file. 2008/9/10 O'Leary, Jim > > > I am trying to access a web service on a SharePoint site using IronPython. > The web service can be accessed via a vb.NET app, but not from IronPython. > > Sniffing the packets from both IronPython and vb.NET transactions shows > that the SOAP envelope and all headers are exactly the same in both > transactions, except for the SOAPAction header, which is missing in the > IronPython app. > > At a certain point the server sends back the following faultstring: > > Unable to handle request without a valid action parameter. Please supply a > valid soap action. > > How to you add this header? Below is my code. I am able to authenticate, > but the app chokes on the request.GetResponse() line with 500 Internal > Server Error. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inflyttningshest at gmail.com Thu Sep 11 07:59:05 2008 From: inflyttningshest at gmail.com (Hannes Rahm) Date: Thu, 11 Sep 2008 07:59:05 +0200 Subject: [IronPython] Accessing classes defined in hosting c# application In-Reply-To: References: Message-ID: Thanks for the quick answers! I rewrote my app to use ScriptRuntime instead of the old (i guess) PythonEngine method. Once I knew about ScriptRuntime I found this quickly: http://blogs.msdn.com/seshadripv/archive/2008/07/23/how-to-create-objects-of-types-defined-in-c-inside-a-hosted-python-script.aspx /Hannes 2008/9/10 Curt Hagenlocher > Are you exposing your hosting assembly to Python by calling > ScriptRuntime.LoadAssembly? If so, you ought to be able to import your > Entity class directly into Python and derive from it. > > On Wed, Sep 10, 2008 at 4:32 AM, Hannes Rahm wrote: > >> Hello people! >> >> I am developing a small multiplayer game in c# (using xna for graphics). >> On the server side I am doing a lot of the logic programming in >> IronPython. >> >> I have gotten to the point where I want to inherit from my "Entity" class >> defined in the hosting application source (c#) so I can specialize it for >> different purposes in IronPython. >> I do not know how to accomplish this. >> >> I have temporarily solved this by having a python wrapper class around the >> c# object (which I have to create using a CreateEntity() function in one of >> the global objects I pass in from "outside"). Alternatively I can add a >> public object ScriptingObject; that I can fill with what I want from python. >> But both these solutions seem a tad bit inelegant. >> >> Does anyone have any ideas on how to do this? >> >> Best regards >> /Hannes >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.worbis at cubido.at Thu Sep 11 07:56:35 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Thu, 11 Sep 2008 07:56:35 +0200 Subject: [IronPython] DLR all languages release for Fullclient References: <676F9CCC1D1D3242BE4B133746E3807ECCB8@XARA.cubido.linz><676F9CCC1D1D3242BE4B133746E3807E53C118@XARA.cubido.linz><8cd017b80809080745v4846aecfl11c549e3dfbcc1f9@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EA48271@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <676F9CCC1D1D3242BE4B133746E3807ECCBB@XARA.cubido.linz> Hi, is there a timeframe for the decision if to go open source with JScript and/or for the DLR 1.0 codeplex site? Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com im Auftrag von Jimmy Schementi Gesendet: Do 11.09.2008 00:03 An: Discussion of IronPython; dody at nomadlife.org Betreff: Re: [IronPython] DLR all languages release for Fullclient The jury is still churning on releasing the source for JScript. When I know what's going on with this, you'll know. When DLR 1.0 is out on its own codeplex site, then we'll have both Desktop and Silverlight builds of all the languages that work with the same DLR. ~Jimmy From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, September 08, 2008 8:20 AM To: dody at nomadlife.org; Discussion of IronPython Subject: Re: [IronPython] DLR all languages release for Fullclient No, or not yet anyway. I don't think they've decided yet on the best way to release this. On Mon, Sep 8, 2008 at 7:45 AM, Dody Gunawinata > wrote: Is the source for managed jscript available? On Mon, Sep 8, 2008 at 2:20 PM, Rainer Worbis > wrote: Thanks for the info - the most interesting thing for me is, if there will be a package with Jscript (as there was last year) Since I do not know how to compile a Silverlight Jscript version to the desktop this would be interesting. Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall Gesendet: Montag, 08. September 2008 13:43 An: Discussion of IronPython Betreff: Re: [IronPython] DLR all languages release for Fullclient At the moment there is not a pre-compiled DLR + IronRuby + IronPython for the desktop - only Silverlight. There will be once the DLR hits 1.0 (I've heard??) An older version was built for IronEditor (download the binaries), I need to update the build with the latest Silverlight SDK release. Basically, I use that code base and release and make a few tweaks for the desktop ;) Ben Blog.BenHall.me.uk On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis > wrote: > > Hallo, > > can someone point me to a webpage or person that knows if there will be a > release of ironpython + ironruby + JScript for the fullclient? > > thanks, > Rainer > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4422 bytes Desc: not available URL: From oneeyedelf1 at gmail.com Thu Sep 11 11:32:02 2008 From: oneeyedelf1 at gmail.com (Knic Knic) Date: Thu, 11 Sep 2008 02:32:02 -0700 Subject: [IronPython] Can't get asynchronous delegates to work Message-ID: I am trying to get asynchronous delegates to work in 1.1.2 and 2.0 beta3, both fail for me, here is what I am trying to do from IronPython.Runtime.Calls import CallTarget0 def printHi(): print 'hi' delegate = CallTarget0(printHi) async_result = delegate.BeginInvoke(None, None) delegate.EndInvoke(async_result) Here is what I get: Traceback (most recent call last): File , line 0, in ##22 File , line 0, in EndInvoke##23 SystemError: Object reference not set to an instance of an object. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan at flanders.co.nz Thu Sep 11 12:04:45 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 11 Sep 2008 12:04:45 +0200 Subject: [IronPython] Can't get asynchronous delegates to work In-Reply-To: References: Message-ID: I had the same problem with asynchronous operations but only when I do it in a GUI layer like winforms or WPF. To get around that I used ThreadPool.QueueUserWorkItem On Thu, Sep 11, 2008 at 11:32 AM, Knic Knic wrote: > I am trying to get asynchronous delegates to work in 1.1.2 and 2.0 beta3, > both fail for me, here is what I am trying to do > > from IronPython.Runtime.Calls import CallTarget0 > > def printHi(): > print 'hi' > > delegate = CallTarget0(printHi) > async_result = delegate.BeginInvoke(None, None) > delegate.EndInvoke(async_result) > > Here is what I get: > > Traceback (most recent call last): > File , line 0, in ##22 > File , line 0, in EndInvoke##23 > SystemError: Object reference not set to an instance of an object. > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jim.O'Leary at vancouver.ca Thu Sep 11 16:33:34 2008 From: Jim.O'Leary at vancouver.ca (O'Leary, Jim) Date: Thu, 11 Sep 2008 07:33:34 -0700 Subject: [IronPython] SOAPAction header In-Reply-To: <233dfa1d0809102144o215baaddnf5d8498eabfe43f7@mail.gmail.com> References: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> <233dfa1d0809102144o215baaddnf5d8498eabfe43f7@mail.gmail.com> Message-ID: <33F6F214C97EA348B1F37BC96D2A731429E4CD@covexmb1.ds.city.vancouver.bc.ca> I'm pasting the vb.NET code. --------------------------vb.NET code BEGINS------------------------------------- Dim aWebService As New ws.lists.lists' Web service Dim myCredentials As New System.Net.NetworkCredential myCredentials = System.Net.CredentialCache.DefaultCredentials aWebService.Credentials = myCredentials aXMLnode = aWebService.GetListItems(args) --------------------------vb.NET code ENDS-------------------------------------- The reason I want to do it in IronPython is to see how it can be done if you do not use the GUI that Visual Studio provides for connecting a web service provider and consumer. I think it will work if I can add the SOAPAction header, but how do I do that? If I write: request = HttpWebRequest.Create('http://myWebServer/ims/_vti_bin/Lists.asmx') ...there is no request.SOAPAction = "GetListItems" ...Neither is there a request.SetHeader("SOAPAction", "GetListItems") Jim ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miha Valencic Sent: Wednesday, September 10, 2008 9:44 PM To: Discussion of IronPython Subject: Re: [IronPython] SOAPAction header Jim, first of all, why aren't you using .NET infrastructrue to invoke WebService? I suspect this is the reason, because you forgot to set he HTTP header attribute, and infrastracture (are you using generated proxy stub in VB.NET?) does this for you. You should create you proxy by deriving from System.ServiceModel.ClientBase for WCF clients, and for regular clients, you should derive from System.Web.Services.Protocols.SoapHttpClientProtocol. wsdl.exe (or svcutil.exe) does this automatically for you. And I would not create thos proxy classes in IPy, but would rather create a proxy in c# (with them tools :)) and then just use this .net object to invoke my web service from IPY like so: clr.AddReference("MyDllWhichContainsWSProxy") from MyNamespace import MyWSProxy foo = MyWSProxy foo.Url = "http://...." result = foo.MethodX([1,2,3]) I hope I'm not missing anything... rgds, Miha. ps: If you still want to do it the hard way, just add the apropriate SOAPAction HTTP header to your HTTP request. SOAPAction headers are different for each method you invoke and are defined in WSDL file. 2008/9/10 O'Leary, Jim > I am trying to access a web service on a SharePoint site using IronPython. The web service can be accessed via a vb.NET app, but not from IronPython. Sniffing the packets from both IronPython and vb.NET transactions shows that the SOAP envelope and all headers are exactly the same in both transactions, except for the SOAPAction header, which is missing in the IronPython app. At a certain point the server sends back the following faultstring: Unable to handle request without a valid action parameter. Please supply a valid soap action. How to you add this header? Below is my code. I am able to authenticate, but the app chokes on the request.GetResponse() line with 500 Internal Server Error. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Sep 11 17:54:31 2008 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Sep 2008 08:54:31 -0700 Subject: [IronPython] Can't get asynchronous delegates to work In-Reply-To: References: Message-ID: <350E7D38B6D819428718949920EC2355421B339E98@NA-EXMSG-C102.redmond.corp.microsoft.com> You're hitting a CLR bug. Here's an explanation of the issue: http://lists.ironpython.com/pipermail/users-ironpython.com/2008-May/007073.html and here's a potential work around: http://lists.ironpython.com/pipermail/users-ironpython.com/2008-May/007078.html It looks like they're still working on fixing it. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Knic Knic Sent: Thursday, September 11, 2008 2:32 AM To: users at lists.ironpython.com Subject: [IronPython] Can't get asynchronous delegates to work I am trying to get asynchronous delegates to work in 1.1.2 and 2.0 beta3, both fail for me, here is what I am trying to do from IronPython.Runtime.Calls import CallTarget0 def printHi(): print 'hi' delegate = CallTarget0(printHi) async_result = delegate.BeginInvoke(None, None) delegate.EndInvoke(async_result) Here is what I get: Traceback (most recent call last): File , line 0, in ##22 File , line 0, in EndInvoke##23 SystemError: Object reference not set to an instance of an object. -------------- next part -------------- An HTML attachment was scrubbed... URL: From MHarelick at ise.com Thu Sep 11 20:32:20 2008 From: MHarelick at ise.com (Harelick, Matthew) Date: Thu, 11 Sep 2008 14:32:20 -0400 Subject: [IronPython] Integrating with Visual Studio Message-ID: Hello: I am having some problems integrating IronPython with Visual Studio. I have installed IronPython 1.1.2 . I have installed Visual Studio and the Visual Studio SDK. After I run buildSetup I get errors like : File of type 'File' with name '..\Project\obj\Release\ConsoleApp.zip' could not be found. Please advise Thanks Matthew Harelick -------------- next part -------------- An HTML attachment was scrubbed... URL: From olegtk at microsoft.com Thu Sep 11 21:04:33 2008 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Thu, 11 Sep 2008 12:04:33 -0700 Subject: [IronPython] Integrating with Visual Studio In-Reply-To: References: Message-ID: Looks like buildSetup was having trouble building the solution in Release mode. Try to build the solution in Release mode to see if there are any problems. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harelick, Matthew Sent: Thursday, September 11, 2008 11:32 AM To: users at lists.ironpython.com Subject: [IronPython] Integrating with Visual Studio Hello: I am having some problems integrating IronPython with Visual Studio. I have installed IronPython 1.1.2 . I have installed Visual Studio and the Visual Studio SDK. After I run buildSetup I get errors like : File of type 'File' with name '..\Project\obj\Release\ConsoleApp.zip' could not be found. Please advise Thanks Matthew Harelick -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Sep 11 22:05:43 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 11 Sep 2008 13:05:43 -0700 Subject: [IronPython] DLR all languages release for Fullclient In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807ECCBB@XARA.cubido.linz> Message-ID: Open source JScript => not sure if it's even going to happen, and if it does I don't know when. Again, when I know, you'll know =) DLR 1.0 site will be live soon, and bits will start to show up within a month. Again, this won't happen in a vacuum too, so you'll hear from me when there's stuff. ~js On 9/10/08 10:56 PM, "Rainer Worbis" wrote: > Hi, > > is there a timeframe for the decision if to go open source with JScript and/or > for the DLR 1.0 codeplex site? > > Rainer > > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com im Auftrag von Jimmy Schementi > Gesendet: Do 11.09.2008 00:03 > An: Discussion of IronPython; dody at nomadlife.org > Betreff: Re: [IronPython] DLR all languages release for Fullclient > > The jury is still churning on releasing the source for JScript. When I know > what's going on with this, you'll know. > > When DLR 1.0 is out on its own codeplex site, then we'll have both Desktop and > Silverlight builds of all the languages that work with the same DLR. > > ~Jimmy > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher > Sent: Monday, September 08, 2008 8:20 AM > To: dody at nomadlife.org; Discussion of IronPython > Subject: Re: [IronPython] DLR all languages release for Fullclient > > No, or not yet anyway. I don't think they've decided yet on the best way to > release this. > On Mon, Sep 8, 2008 at 7:45 AM, Dody Gunawinata > > wrote: > Is the source for managed jscript available? > On Mon, Sep 8, 2008 at 2:20 PM, Rainer Worbis > > wrote: > Thanks for the info - the most interesting thing for me is, if there will be a > package with Jscript (as there was last year) > Since I do not know how to compile a Silverlight Jscript version to the > desktop this would be interesting. > > Rainer > > -----Urspr?ngliche Nachricht----- > Von: > users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com on.com>] Im Auftrag von Ben Hall > Gesendet: Montag, 08. September 2008 13:43 > An: Discussion of IronPython > Betreff: Re: [IronPython] DLR all languages release for Fullclient > > At the moment there is not a pre-compiled DLR + IronRuby + IronPython > for the desktop - only Silverlight. There will be once the DLR hits > 1.0 (I've heard??) > > An older version was built for IronEditor (download the binaries), I > need to update the build with the latest Silverlight SDK release. > Basically, I use that code base and release and make a few tweaks for > the desktop ;) > > Ben > Blog.BenHall.me.uk > > On Mon, Sep 8, 2008 at 11:47 AM, Rainer Worbis > > wrote: >> >> Hallo, >> >> can someone point me to a webpage or person that knows if there will be a >> release of ironpython + ironruby + JScript for the fullclient? >> >> thanks, >> Rainer >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -- > nomadlife.org > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From MHarelick at ise.com Thu Sep 11 22:17:32 2008 From: MHarelick at ise.com (Harelick, Matthew) Date: Thu, 11 Sep 2008 16:17:32 -0400 Subject: [IronPython] Integrating with Visual Studio In-Reply-To: References: Message-ID: Hi: I am running this from the command line to simply integrate IronPython with Visual Studio. I am not sure what Release mode has to do with this script or how to enable it. Thanks Matthew Harelick Date: Thu, 11 Sep 2008 12:04:33 -0700 From: Oleg Tkachenko Subject: Re: [IronPython] Integrating with Visual Studio To: Discussion of IronPython Message-ID: Content-Type: text/plain; charset="us-ascii" Looks like buildSetup was having trouble building the solution in Release mode. Try to build the solution in Release mode to see if there are any problems. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harelick, Matthew Sent: Thursday, September 11, 2008 11:32 AM To: users at lists.ironpython.com Subject: [IronPython] Integrating with Visual Studio Hello: I am having some problems integrating IronPython with Visual Studio. I have installed IronPython 1.1.2 . I have installed Visual Studio and the Visual Studio SDK. After I run buildSetup I get errors like : File of type 'File' with name '..\Project\obj\Release\ConsoleApp.zip' could not be found. Please advise Thanks Matthew Harelick From olegtk at microsoft.com Thu Sep 11 22:28:27 2008 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Thu, 11 Sep 2008 13:28:27 -0700 Subject: [IronPython] Integrating with Visual Studio In-Reply-To: References: Message-ID: Ok, what's your goal in the first place? If you just want to use IronPython in Visual Studio, install IronPythonStudioIntegratedSetup release from http://www.codeplex.com/IronPythonStudio/Release/ProjectReleases.aspx?ReleaseId=8934. You don't need to install Visual Studio SDK to use IronPython Studio. -- Oleg -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harelick, Matthew Sent: Thursday, September 11, 2008 1:18 PM To: users at lists.ironpython.com Subject: [IronPython] Integrating with Visual Studio Hi: I am running this from the command line to simply integrate IronPython with Visual Studio. I am not sure what Release mode has to do with this script or how to enable it. Thanks Matthew Harelick Date: Thu, 11 Sep 2008 12:04:33 -0700 From: Oleg Tkachenko Subject: Re: [IronPython] Integrating with Visual Studio To: Discussion of IronPython Message-ID: Content-Type: text/plain; charset="us-ascii" Looks like buildSetup was having trouble building the solution in Release mode. Try to build the solution in Release mode to see if there are any problems. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harelick, Matthew Sent: Thursday, September 11, 2008 11:32 AM To: users at lists.ironpython.com Subject: [IronPython] Integrating with Visual Studio Hello: I am having some problems integrating IronPython with Visual Studio. I have installed IronPython 1.1.2 . I have installed Visual Studio and the Visual Studio SDK. After I run buildSetup I get errors like : File of type 'File' with name '..\Project\obj\Release\ConsoleApp.zip' could not be found. Please advise Thanks Matthew Harelick _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jeanmarc.pouchoulon at gmail.com Fri Sep 12 00:35:02 2008 From: jeanmarc.pouchoulon at gmail.com (jean-marc pouchoulon) Date: Fri, 12 Sep 2008 00:35:02 +0200 Subject: [IronPython] unicode problem with vmware api Message-ID: <48C99D16.1080003@gmail.com> Helo ironpython list , I'm trying to use ironpython with the vi-toolkit api for .net The C# code looks like that: DiagnosticManager diagMgr = (DiagnosticManager) client.GetView(client.ServiceContent.DiagnosticManager, null); DiagnosticManagerLogHeader log = diagMgr.BrowseDiagnosticLog(null, "hostd", 999999999, null); I "translate" these lines in ironpython code: diagMgr = client.GetView(client.ServiceContent.DiagnosticManager, None) diagMgrLog = diagMgr.BrowseDiagnosticLog(None, "hostd", 999999999, None) unfortunately I've got an error on hostd key: "A specified parameter was not correct. key" I read that ironpython has only unicode string and I suppose that the problem is here. is there is a way to transform "hostd" in byte strings ? thanks for your help. jean-marc pouchoulon From curt at hagenlocher.org Fri Sep 12 00:37:53 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 11 Sep 2008 15:37:53 -0700 Subject: [IronPython] unicode problem with vmware api In-Reply-To: <48C99D16.1080003@gmail.com> References: <48C99D16.1080003@gmail.com> Message-ID: C# also has only Unicode strings -- so if this works from C# then it's not likely that Unicode is the problem. On Thu, Sep 11, 2008 at 3:35 PM, jean-marc pouchoulon < jeanmarc.pouchoulon at gmail.com> wrote: > Helo ironpython list , > > I'm trying to use ironpython with the vi-toolkit api for .net > The C# code looks like that: > > DiagnosticManager diagMgr = (DiagnosticManager) > client.GetView(client.ServiceContent.DiagnosticManager, null); > DiagnosticManagerLogHeader log = diagMgr.BrowseDiagnosticLog(null, "hostd", > 999999999, null); > > I "translate" these lines in ironpython code: > > diagMgr = client.GetView(client.ServiceContent.DiagnosticManager, None) > diagMgrLog = diagMgr.BrowseDiagnosticLog(None, "hostd", 999999999, None) > > unfortunately I've got an error on hostd key: > > "A specified parameter was not correct. key" > > I read that ironpython has only unicode string and I suppose that the > problem is here. > is there is a way to transform "hostd" in byte strings ? > > > thanks for your help. > > jean-marc pouchoulon > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Sep 12 00:41:55 2008 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Sep 2008 15:41:55 -0700 Subject: [IronPython] unicode problem with vmware api In-Reply-To: <48C99D16.1080003@gmail.com> References: <48C99D16.1080003@gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B33A20F@NA-EXMSG-C102.redmond.corp.microsoft.com> .NET only has unicode strings as well so that's likely not the problem - it's really just a problem when dealing w/ pre-existing Python code not other .NET code. Could something earlier be different? You might be able to get some ideas by looking at diagMgr.BrowseDiagnosticLog.__doc__ if you haven't already. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jean-marc pouchoulon Sent: Thursday, September 11, 2008 3:35 PM To: users at lists.ironpython.com Subject: [IronPython] unicode problem with vmware api Helo ironpython list , I'm trying to use ironpython with the vi-toolkit api for .net The C# code looks like that: DiagnosticManager diagMgr = (DiagnosticManager) client.GetView(client.ServiceContent.DiagnosticManager, null); DiagnosticManagerLogHeader log = diagMgr.BrowseDiagnosticLog(null, "hostd", 999999999, null); I "translate" these lines in ironpython code: diagMgr = client.GetView(client.ServiceContent.DiagnosticManager, None) diagMgrLog = diagMgr.BrowseDiagnosticLog(None, "hostd", 999999999, None) unfortunately I've got an error on hostd key: "A specified parameter was not correct. key" I read that ironpython has only unicode string and I suppose that the problem is here. is there is a way to transform "hostd" in byte strings ? thanks for your help. jean-marc pouchoulon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jeanmarc.pouchoulon at gmail.com Fri Sep 12 00:57:47 2008 From: jeanmarc.pouchoulon at gmail.com (jean-marc pouchoulon) Date: Fri, 12 Sep 2008 00:57:47 +0200 Subject: [IronPython] unicode problem with vmware api In-Reply-To: <350E7D38B6D819428718949920EC2355421B33A20F@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <48C99D16.1080003@gmail.com> <350E7D38B6D819428718949920EC2355421B33A20F@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48C9A26B.5070009@gmail.com> Dino Viehland a ?crit : > .NET only has unicode strings as well so that's likely not the problem - it's really just a problem when dealing w/ pre-existing Python code not other .NET code. > > ok > Could something earlier be different? You might be able to get some ideas by looking at diagMgr.BrowseDiagnosticLog.__doc__ if you haven't already. > nothing clear for me: >>>help(diagMgr.BrowseDiagnosticLog) Help on builtin_function_or_method in module __builtin__ | | | Data and other attributes defined here: | | __call__(...) | x.__call__(...) <==> x(...) | Property __doc__ | Get: str Documentation(self) | | __eq__(...) | x.__eq__(y) <==> x==y | __getitem__(...) | object get_Item(self, object key) | __init__(...) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | Property __name__ | Get: str Name(self) | | __new__(...) | T.__new__(S, ...) -> a new object with type S, a subtype of T | Property __self__ | Get: object Self(self) | in Perl the code is slightly different # get ServiceContent my $content = Vim::get_service_content(); my $diagMgr = Vim::get_view(mo_ref => $content->diagnosticManager); # Obtain the last line of the logfile by setting an arbitrarily large # line number as the starting point my $log = $diagMgr->BrowseDiagnosticLog( key => "hostd", start => "999999999"); my $lineEnd = $log->lineEnd; thanks for your answers > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jean-marc pouchoulon > Sent: Thursday, September 11, 2008 3:35 PM > To: users at lists.ironpython.com > Subject: [IronPython] unicode problem with vmware api > > Helo ironpython list , > > I'm trying to use ironpython with the vi-toolkit api for .net > The C# code looks like that: > > DiagnosticManager diagMgr = (DiagnosticManager) > client.GetView(client.ServiceContent.DiagnosticManager, null); > DiagnosticManagerLogHeader log = diagMgr.BrowseDiagnosticLog(null, > "hostd", 999999999, null); > > I "translate" these lines in ironpython code: > > diagMgr = client.GetView(client.ServiceContent.DiagnosticManager, None) > diagMgrLog = diagMgr.BrowseDiagnosticLog(None, "hostd", 999999999, None) > > unfortunately I've got an error on hostd key: > > "A specified parameter was not correct. key" > > I read that ironpython has only unicode string and I suppose that the > problem is here. > is there is a way to transform "hostd" in byte strings ? > > > thanks for your help. > > jean-marc pouchoulon > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jeanmarc.pouchoulon at gmail.com Fri Sep 12 01:08:05 2008 From: jeanmarc.pouchoulon at gmail.com (jean-marc pouchoulon) Date: Fri, 12 Sep 2008 01:08:05 +0200 Subject: [IronPython] unicode problem with vmware api In-Reply-To: <48C9A26B.5070009@gmail.com> References: <48C99D16.1080003@gmail.com> <350E7D38B6D819428718949920EC2355421B33A20F@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C9A26B.5070009@gmail.com> Message-ID: <48C9A4D5.7000409@gmail.com> > > >>>help(diagMgr.BrowseDiagnosticLog) print diagMgr.BrowseDiagnosticLog.__doc__ is better 'DiagnosticManagerLogHeader BrowseDiagnosticLog(self, ManagedObjectReference host, str key, Nullable[int] start, Nullable[int] lines)' diagMgrLog = diagMgr.BrowseDiagnosticLog(phy5.MoRef, "hostd", 999999999, None) >>>diagMgrLog thanks it works From miha.valencic at gmail.com Fri Sep 12 01:17:46 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Fri, 12 Sep 2008 01:17:46 +0200 Subject: [IronPython] SOAPAction header In-Reply-To: <33F6F214C97EA348B1F37BC96D2A731429E4CD@covexmb1.ds.city.vancouver.bc.ca> References: <33F6F214C97EA348B1F37BC96D2A731429E4B8@covexmb1.ds.city.vancouver.bc.ca> <233dfa1d0809102144o215baaddnf5d8498eabfe43f7@mail.gmail.com> <33F6F214C97EA348B1F37BC96D2A731429E4CD@covexmb1.ds.city.vancouver.bc.ca> Message-ID: <233dfa1d0809111617w36898522u636dd8048321ca7@mail.gmail.com> Jim, the GUI behind VisualStudio is wsdl.exe. And that generates the proxy classes. You can do this by hand, if this VisualStudio black magic scares you. :) wsdl.exe Create that in c# and compile it as a class library. Then use it from python like so: clr.AddReference("WhatYouHave") from ws.lists import lists wsClient = lists() # setup network credentials the way you would # setup URL endpoint liket wsClient.Url = "http://foo.com" wsClient.GetListItems(args)... I have not compiled it, but it should work. Hope that helps, Miha. 2008/9/11 O'Leary, Jim > > I'm pasting the vb.NET code. > > --------------------------vb.NET code > BEGINS------------------------------------- > Dim aWebService As New ws.lists.lists' Web service > Dim myCredentials As New System.Net.NetworkCredential > myCredentials = System.Net.CredentialCache.DefaultCredentials > aWebService.Credentials = myCredentials > aXMLnode = aWebService.GetListItems(args) > --------------------------vb.NET code > ENDS-------------------------------------- > > The reason I want to do it in IronPython is to see how it can be done if > you do not use the GUI that Visual Studio provides for connecting a web > service provider and consumer. I think it will work if I can add the > SOAPAction header, but how do I do that? If I write: > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Fri Sep 12 13:52:00 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Fri, 12 Sep 2008 14:52:00 +0300 Subject: [IronPython] unicode problem with vmware api In-Reply-To: <48C9A4D5.7000409@gmail.com> References: <48C99D16.1080003@gmail.com> <350E7D38B6D819428718949920EC2355421B33A20F@NA-EXMSG-C102.redmond.corp.microsoft.com> <48C9A26B.5070009@gmail.com> <48C9A4D5.7000409@gmail.com> Message-ID: <2fd6b9d0809120452x6a7e7b30s2f52c548b7963f34@mail.gmail.com> hi jean-marc, I'm also working with vmware API from ironpython and have written a simple wrapper which makes it easier. you might want to give it a try: http://www.ironpython.info/index.php/VimWrap ronnie On Fri, Sep 12, 2008 at 2:08 AM, jean-marc pouchoulon < jeanmarc.pouchoulon at gmail.com> wrote: > > >> >>>help(diagMgr.BrowseDiagnosticLog) >> > > > print diagMgr.BrowseDiagnosticLog.__doc__ is better > 'DiagnosticManagerLogHeader BrowseDiagnosticLog(self, > ManagedObjectReference host, str key, Nullable[int] start, Nullable[int] > lines)' > > > diagMgrLog = diagMgr.BrowseDiagnosticLog(phy5.MoRef, "hostd", 999999999, > None) > >>>diagMgrLog > > > thanks it works > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinjvinj at gmail.com Sun Sep 14 01:56:04 2008 From: vinjvinj at gmail.com (Vineet Jain (gmail)) Date: Sat, 13 Sep 2008 19:56:04 -0400 Subject: [IronPython] Couple of questions on silverlight on json and calling js from python and back Message-ID: <002a01c915fc$4a686fb0$df394f10$@com> 1. From looking at the flikr Ruby example, it seems that silver light ships with the JSON parser built in. I can't seem to find an example of someone using it from IronPython. Can someone please help me with how I would modify the short script below to handle json data back from the server. def completed(s, e): try: Document.ajaxupdate.innerHTML = e.Result except: Document.ajaxupdate.innerHTML = 'Error' uri = Uri('http://127.0.0.1/function_that_returns_json') web = WebClient() web.DownloadStringCompleted += completed web.DownloadStringAsync(uri) 2. Just want to confirm that we still must use the scriptable from C# to call ironpython function from js in silverlight beta 2 as outlined in the following thread: http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2007-July/005298. htm Thanks, Vineet -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Tue Sep 16 23:53:34 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Tue, 16 Sep 2008 23:53:34 +0200 Subject: [IronPython] Running IronPtyhon as a "codebehind" in ASP.NET Message-ID: <233dfa1d0809161453n739fe17ai10d877fa093156db@mail.gmail.com> Hi guys! Does anyone know what is the status with running IronPython 2.* in ASP.NET? As an alternative to C# in the codebehind, that is. Has this (http://www.asp.net/IronPython/) been updated to work with 2.x? Thanks, Miha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Sep 17 00:44:38 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 16 Sep 2008 15:44:38 -0700 Subject: [IronPython] Running IronPtyhon as a "codebehind" in ASP.NET In-Reply-To: <233dfa1d0809161453n739fe17ai10d877fa093156db@mail.gmail.com> References: <233dfa1d0809161453n739fe17ai10d877fa093156db@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EB32FC1@NA-EXMSG-C116.redmond.corp.microsoft.com> A new release of that is coming; keep an eye on this mailing list and/or http://codeplex.com/aspnet for updates. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miha Valencic Sent: Tuesday, September 16, 2008 2:54 PM To: Discussion of IronPython Subject: [IronPython] Running IronPtyhon as a "codebehind" in ASP.NET Hi guys! Does anyone know what is the status with running IronPython 2.* in ASP.NET? As an alternative to C# in the codebehind, that is. Has this (http://www.asp.net/IronPython/) been updated to work with 2.x? Thanks, Miha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Sep 17 03:59:44 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 16 Sep 2008 18:59:44 -0700 Subject: [IronPython] SVN access to IronPython source... Message-ID: <350E7D38B6D819428718949920EC2355421B42E9D7@NA-EXMSG-C102.redmond.corp.microsoft.com> As of a couple of days ago the CodePlex team enabled SVN access for all projects: http://blogs.msdn.com/codeplex/archive/2008/09/14/codeplex-launches-support-for-tortoisesvn.aspx Which of course includes IronPython. So if you don't have TFS, or you're running on some OS where it's not available, or just love SVN you can access the IronPython repository at https://IronPython.svn.codeplex.com/svn -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Wed Sep 17 05:18:33 2008 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 17 Sep 2008 12:18:33 +0900 Subject: [IronPython] SVN access to IronPython source... In-Reply-To: <350E7D38B6D819428718949920EC2355421B42E9D7@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <350E7D38B6D819428718949920EC2355421B42E9D7@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <5b0248170809162018k5061d348oa63f6b72fd1640e9@mail.gmail.com> 2008/9/17 Dino Viehland : > Which of course includes IronPython. So if you don't have TFS, or you're > running on some OS where it's not available, or just love SVN you can access > the IronPython repository at https://IronPython.svn.codeplex.com/svn This is totally cool. -- Seo Sanghyeon From empirebuilder at gmail.com Wed Sep 17 14:42:50 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Wed, 17 Sep 2008 14:42:50 +0200 Subject: [IronPython] Running IronPtyhon as a "codebehind" in ASP.NET In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489EB32FC1@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <233dfa1d0809161453n739fe17ai10d877fa093156db@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EB32FC1@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <8cd017b80809170542y321eeaacsef6b0583ed1f2b18@mail.gmail.com> I'm looking forward to that day so I won't have to run two different type of IronPython in the same web application ever again :) On Wed, Sep 17, 2008 at 12:44 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > A new release of that is coming; keep an eye on this mailing list and/or > http://codeplex.com/aspnet for updates. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Miha Valencic > *Sent:* Tuesday, September 16, 2008 2:54 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] Running IronPtyhon as a "codebehind" in ASP.NET > > > > Hi guys! > > Does anyone know what is the status with running IronPython 2.* in ASP.NET? > As an alternative to C# in the codebehind, that is. > > Has this (http://www.asp.net/IronPython/) been updated to work with 2.x? > > Thanks, > Miha. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Wed Sep 17 20:00:19 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 17 Sep 2008 13:00:19 -0500 Subject: [IronPython] How can I do this with IronPython b5? Message-ID: <4817b6fc0809171100p4be0f9edlf2c9c258938267b@mail.gmail.com> I'm not a C# expert by any means, I know just enough to be dangerous. Under b3 I had this code that worked: public void AddEventHandler(string e, EventHandler handler) { Python.Ops.GetMember>(Helper, "AddEventHandler")(e, handler); } Helper is an IronPython class instance that I'm wrapping in a C# class. I'm calling the python objects AddEventHandler method. Unfortunately the delegate regressions seem to be causing this code to fail (traceback below) how can I fix this code so that it will work with b5 sources? I'm at something of a loss. Thanks, -Dan System.ArgumentNullException: Value cannot be null. Parameter name: context at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, String paramName) at Microsoft.Scripting.Runtime.BinderOps.GetDelegate(CodeContext context, Object callableObject, Type delegateType) at _stub_$3358##2130(Closure , CallSite , Object ) at System.Scripting.Actions.MatchCaller.Call1[T0,TRet](Func`3 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update1[T,T0,TRet](CallSite site, T0 arg0) at _stub_$3357##2129(Closure , CallSite , CodeContext , Object ) at System.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) at System.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at System.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Microsoft.Scripting.Runtime.DynamicOperations.GetMember[T](Object obj, String name) at Microsoft.Scripting.Hosting.ObjectOperations.GetMember[T](Object obj, String name) at BeskarNET.Python.GetMember[T](Object obj, String name) at BeskarNET.EventGroup.EventHelper.AddEventHandler(String e, EventHandler handler) From miha.valencic at gmail.com Wed Sep 17 22:03:53 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 17 Sep 2008 22:03:53 +0200 Subject: [IronPython] Running IronPtyhon as a "codebehind" in ASP.NET In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489EB32FC1@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <233dfa1d0809161453n739fe17ai10d877fa093156db@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EB32FC1@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <233dfa1d0809171303p53d2dc05k63056a9962e8a888@mail.gmail.com> Will keep an eye in here. Thanks, Miha. 2008/9/17 Jimmy Schementi > A new release of that is coming; keep an eye on this mailing list and/or > http://codeplex.com/aspnet for updates. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Wed Sep 17 23:44:26 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 17 Sep 2008 14:44:26 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Hello IronPython Community, We're pleased to announce the release of IronPython 2.0 Beta 5 which includes a plethora of bug fixes (100+). IronPython 2.0 Beta 5 is our last planned beta release in the 2.0 series - sometime soon we'll be releasing 2.0 Release Candidate 1. As such, you can expect far fewer changes between this release and the next. If you intend on upgrading to IronPython 2.0.0, please try out 2.0 Beta 5 now and report any blocking issues back to us ASAP. This may be your last chance to get them fixed in time for 2.0.0. This release is significant in a few respects. First and foremost, the most visible change is the fact that we've performed a major namespace transformation. We have moved all DLR types that were in the "System" namespace to "Microsoft". The reason behind this is to fix problems a few people had embedding IronPython in C# projects targeting the .NET 3.5 Framework (see http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/thread.html#8036 for background). A consequence of this change is that if you build IronPython from sources you'll notice msbuild emits warning CS1685. This is safe to ignore and it was necessary to allow this so that IronPython can continue to be run under .NET 2.0 SP1. More details on this will be coming soon in the form of a blog post... It's also worth pointing out that the DLR hosting APIs no longer have a default configuration for Python. Instead you should utilize IronPython.Hosting.Python to create script runtimes and script engines. On that note, the DLR hosting specifications document has been updated - please see http://compilerlab.members.winisp.net/dlr-spec-hosting.doc if you're interested. The following CodePlex Work Items have been closed since IronPython 2.0 Beta 4 was released: * 766 brucec CLR methods are visible on some builtin types even if clr module isn't imported * 1506 Explicit interface method implementations should be exposed by simple interface method name * 10905 tscottw_cp [Blocking Tutorial on 2.0] winforms.py example (exercise 2.1, tutorial 2) hangs * 17236 Michael Armes Cannot import from .NET types containing static variables * 17393 harrypierson Move existing site.py code into IronPython.dll * 17425 dinov Too many objects are convertible to IEnumerator * 861 brucec __module__ attribute shows up where it shouldn't * 1490 hweber re module doesn't support (?L) and (?u) in expressions * 2248 Kristof Wagemans Missing debug information for IL offset 0 of generated methods * 3290 beaugunderson Trivial: cPickle.load(s) throws wrong exception on negative cases * 5085 dfugate Implement operator.__not__ and operator.__setitem__ * 6273 dfugate re.sub(..., "...\?...", ...) broken * 7008 jdhardy os.path.isfile incompatible with CPython when path contains a double quote (") * 7828 doubleyewdee IronPython lock type does not support context manager methods * 8018 PeteHufnagel OldClass.HasSetAttr will not let me inherit __setattr__ * 8721 jackeyoo DUPLICATE: About function fdopen() in module "nt", the "ValueError"exception is not thrown as expected if set an invalid filemode as the second argument * 8783 jackeyoo if the argument of nt.read() which is less than zero did not throw exception * 9347 rridge struct.pack() mishandles "x" format * 9710 jackeyoo The exe file compiled using pyc.py is incorrect against IronPython1.1 * 9943 lewisle Search for backslash character using re fails * 10710 Michael Foord os.path.abspath(None) throws unexpected exception * 11141 tscottw_cp The += operator does not work for delegates * 15032 CurtHagenlocher DUPLICATE: Bad error message when calling generic function without specifying type * 16193 srivatsn new.instance() is missing an overload. * 16657 Seo Sanghyeon Regular expression option using (?...) syntax is not applied * 16833 Douglas Blank Improve __repr__ for standard .NET types * 16866 dfugate IP implementation of _sha512.__doc__ looks wrong * 16900 lclj Documentation CHM does not work. * 16979 dfugate Trivial: Output of "ipy.exe -h" and "ipy.exe -?" slightly different * 17040 jdhardy -tt is broken * 17045 sorokerr NEED MORE INFO: Calling an extension function from XSLT * 17047 Eriol BY DESIGN: Raw String throws SyntaxError on trailing slash * 17142 Michael Foord .NET classes that have default indexers don't support enumeration * 17181 ais Implement INotifyPropertyChanged * 17325 Christian Muirhead Can't assign to __doc__ property on instance * 17326 Christian Muirhead BY DESIGN: can't set __name__ in a scope when running a script loaded from a source file * 17351 Eloff Cannot match previously matched named group in regex * 17551 dfugate int.__dict__.copy() omits .NET members * 17569 srivatsn str.rsplit(None) for a string with spaces is incorrect * 17582 pelikhan SaveAssemblies not saving main module * 17652 jdhardy DUPLICATE: .decode('hex') fails * 17683 srivatsn struct.calcsize('xP') is incorrect in x64 machines * 17712 felixpollan ScriptSource.SourceUnit is now Internal ? * 17759 srid DUPLICATE: LINQ: TypeError: Select() takes at least 2147483647 arguments (1 given) * 17896 jdhardy unicode('', 'ascii', 'ignore') fails with LookupError: unknown error handler name 'ignore' * 18346 Eloff Package importing regression * 18349 fuzzyman sys module oddities when installing import hooks * 386 Improve -X:PrivateBinding support * 476 Implement log / log10 for bigint's larger than double * 572 ?iga Seilnacht Binding: Compat: Coercion rules are incorrect for selecting method for binary operators * 797 Simon Dahlbacka output of __slots__ member differes from CPython, and exception message is different as well * 874 Brucec Fix os.stat_result storage * 1089 Brucec re.compile(re.escape(foo)) round trip fails in some cases * 1609 dinov Non csc warning cleanup (unusued fields, etc...) * 2290 Stanislas Pinte 'abc'.encode() requires encoding type * 2476 mziller REJECTED: assert keywork not working? * 2557 Alexey Borzenkov strptime uses %c even if there is more than one format * 3214 ayarrow DUPLICATE: "".encode('idna') causes burp in httplib.py * 3418 Cavingdeep Can't deal with non-ASCII encoding files on non-English WinXP * 3731 Mike McGavin Syntax error location not always determined correctly * 4564 dfugate Some functions in the _codecs module require 2 or more parameters when only 1 is needed * 5633 Eloff os.fdopen modifies binary data written * 6710 dfugate Trivial: FormatException method of PythonEngine does not work with ExceptionDetail engine option * 7451 Sanghyeon Seo missing nt.dup and related socket.makefile issue * 7992 sborde Removing a delegate from an event using a strongly-typed delegate does not work * 8519 heyssion2 a bug about clr.Reference * 11030 tscottw_cp Misleading exception message when using nongeneric method as generic * 11830 dfugate Caught (global-related) exception within one module breaks imports of next modules * 12009 tscottw shutil.copytree always raises shutil.Error after completing * 13401 Ronnie Maor Support __reduce_ex__ / __getnewargs__ on .NET types where it's possible * 13641 Kelie ref parameters with InAttribute should be treated as by-value parameters * 13704 CurtHagenlocher Incorrect error message when constructing datetime.datetime with insufficient arguments * 14005 ktc1 Trivial: Boolean cast from decimal wrong * 14904 dfugate nt.tmpnam() gives bad return value * 15345 dfugate UnicodeTranslateError members created from constructor parameters are None * 15353 dfugate Python 2.5: Remove "struct" module and replace with "_struct" * 15972 Davy Mitchell sys.exit(False) has an incorrect exit code under IronPython * 16002 wilberforce name mangling isn't applied to method parameters * 16003 wilberforce metaclass not called when constructing classes that inherit from another class first * 16004 ben2004uk Queryable.First() gives TypeError: First() takes at least 2147483647 arguments * 16157 kevgu error msg for "continue" inside "finally" not specific enough * 16225 dfugate Objects in sys.meta_path should be capable of disabling the importation of modules * 16241 dfugate isinstance(..., types.BuiltinFunctionType) fails for objects * 16249 dinov STA threads and finalizable objects and Thread.Sleep * 16697 dfugate Only the first object in sys.meta_path is searched * 16808 paulfelix Use of custom C# object with overloaded '/' operator breaks when true division is enabled * 16811 dfugate len(new_style_class.__dict__) is wrong * 16868 dfugate IP does not implement a number of _sha512.sha512's members * 17186 Eloff DUPLICATE: Package import should be case sensitive * 17300 CurtHagenlocher Allow non-integer arguments to nt.stat_result * 17308 jdhardy try ... else with nested try doesn't work * 17457 dfugate Implement rest of exceptions module * 17459 dfugate Implement rest of imp module * 17527 dfugate str(new_style_class.__dict__) is wrong * 17550 jdhardy Thread local storage * 17561 Lawouach Metaclass and argument passing may result in IndexError * 17622 dfugate __import__("somePkg\\someMod") should not work * 17799 Ronnie Maor int64/long incompatibility in hashing * 17859 srivatsn time.struct_time's constructor should be able to take an object Thanks to everyone who reported these bugs! Also, we've closed the following bugs that were reported internally: * 409443 Flag deprecated functions with DeprecationWarning; while we're at it, implement -W cmdline option * 409448 Implement warnings for -Qwarn and -Qwarnall * 409456 Module datetime is incomplete * 409503 Trivial: SNAP blocking: testrationalfunction_20 fails on x64 platforms * 409565 enable compat/sbs_func_args.py * 409571 SNAP blocking: test_exceptions.py fails with a StackOverflow exception on 64-bit platforms * 409590 StackOverflowException when exec "a[0]==7" for Ironpython, but Cpython can work * 409602 TypeError: cannot create weak reference to 'file' object * 409611 isinstance() can't mask an attribute error as a type error * 409612 issubclass(instance,instance) raise a type error when instance.getbases() raise a runtime error * 409617 got a different result against Ironpython and Cpython when get_header function is called * 409628 NotImplementedError: Overriding __getattribute__ of built-in types is not implemented * 409629 lost attribute leads to AttributeError: 'type' object has no attribute 'x' * 409633 SNAP blocking: test_compile.py throws a StackOverflowException under 64-bit OSes * 409635 exec C()//E(), python return 'C.__floordiv__',but Ironpython return 'C.__rfloordiv__' * 409639 test_runpy.py blocking: "TypeError: update() got an unexpected keyword argument '__name__'" * 409674 array.array('b', 'foo') causing overflowError * 409715 try __getattr__ if __getattribute__ raise AttributeError * 409729 old-style base type's __setattr__ is never called * 409738 del statements ignored by IronPython compiler * 409752 negative scenario: bad error message "M() takes at least 2147483647 arguments" * 409777 dir(someObj.someMethod) does not show "__call__" * 409821 tracking: C# implicit enum conversion allows 0 for any enum type; IronPython does not. make a decision * 438773 IP throws an unreachable assertion when trying to open files in "U+" modes * 449685 tf changeset 461435 broke complex forms tests * 467757 IronPython: incorrect error message for invalid tuple assignment You can download IronPython 2.0 Beta 5 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15625. The IronPython Team IMPORTANT NOTE If you choose to install IronPython by running IronPython.msi, please note that this will remove the previous installation of IronPython 2.0 Beta 4! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Harry.Pierson at microsoft.com Thu Sep 18 01:47:17 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Wed, 17 Sep 2008 16:47:17 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Note, the "More details on this will be coming soon in the form of a blog post..." is now up on my blog at http://devhawk.net/2008/09/17/DLR+Namespace+Change+Fire+Drill.aspx. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate Sent: Wednesday, September 17, 2008 2:44 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython 2.0 Beta 5 Hello IronPython Community, We're pleased to announce the release of IronPython 2.0 Beta 5 which includes a plethora of bug fixes (100+). IronPython 2.0 Beta 5 is our last planned beta release in the 2.0 series - sometime soon we'll be releasing 2.0 Release Candidate 1. As such, you can expect far fewer changes between this release and the next. If you intend on upgrading to IronPython 2.0.0, please try out 2.0 Beta 5 now and report any blocking issues back to us ASAP. This may be your last chance to get them fixed in time for 2.0.0. This release is significant in a few respects. First and foremost, the most visible change is the fact that we've performed a major namespace transformation. We have moved all DLR types that were in the "System" namespace to "Microsoft". The reason behind this is to fix problems a few people had embedding IronPython in C# projects targeting the .NET 3.5 Framework (see http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/thread.html#8036 for background). A consequence of this change is that if you build IronPython from sources you'll notice msbuild emits warning CS1685. This is safe to ignore and it was necessary to allow this so that IronPython can continue to be run under .NET 2.0 SP1. More details on this will be coming soon in the form of a blog post... It's also worth pointing out that the DLR hosting APIs no longer have a default configuration for Python. Instead you should utilize IronPython.Hosting.Python to create script runtimes and script engines. On that note, the DLR hosting specifications document has been updated - please see http://compilerlab.members.winisp.net/dlr-spec-hosting.doc if you're interested. The following CodePlex Work Items have been closed since IronPython 2.0 Beta 4 was released: * 766 brucec CLR methods are visible on some builtin types even if clr module isn't imported * 1506 Explicit interface method implementations should be exposed by simple interface method name * 10905 tscottw_cp [Blocking Tutorial on 2.0] winforms.py example (exercise 2.1, tutorial 2) hangs * 17236 Michael Armes Cannot import from .NET types containing static variables * 17393 harrypierson Move existing site.py code into IronPython.dll * 17425 dinov Too many objects are convertible to IEnumerator * 861 brucec __module__ attribute shows up where it shouldn't * 1490 hweber re module doesn't support (?L) and (?u) in expressions * 2248 Kristof Wagemans Missing debug information for IL offset 0 of generated methods * 3290 beaugunderson Trivial: cPickle.load(s) throws wrong exception on negative cases * 5085 dfugate Implement operator.__not__ and operator.__setitem__ * 6273 dfugate re.sub(..., "...\?...", ...) broken * 7008 jdhardy os.path.isfile incompatible with CPython when path contains a double quote (") * 7828 doubleyewdee IronPython lock type does not support context manager methods * 8018 PeteHufnagel OldClass.HasSetAttr will not let me inherit __setattr__ * 8721 jackeyoo DUPLICATE: About function fdopen() in module "nt", the "ValueError"exception is not thrown as expected if set an invalid filemode as the second argument * 8783 jackeyoo if the argument of nt.read() which is less than zero did not throw exception * 9347 rridge struct.pack() mishandles "x" format * 9710 jackeyoo The exe file compiled using pyc.py is incorrect against IronPython1.1 * 9943 lewisle Search for backslash character using re fails * 10710 Michael Foord os.path.abspath(None) throws unexpected exception * 11141 tscottw_cp The += operator does not work for delegates * 15032 CurtHagenlocher DUPLICATE: Bad error message when calling generic function without specifying type * 16193 srivatsn new.instance() is missing an overload. * 16657 Seo Sanghyeon Regular expression option using (?...) syntax is not applied * 16833 Douglas Blank Improve __repr__ for standard .NET types * 16866 dfugate IP implementation of _sha512.__doc__ looks wrong * 16900 lclj Documentation CHM does not work. * 16979 dfugate Trivial: Output of "ipy.exe -h" and "ipy.exe -?" slightly different * 17040 jdhardy -tt is broken * 17045 sorokerr NEED MORE INFO: Calling an extension function from XSLT * 17047 Eriol BY DESIGN: Raw String throws SyntaxError on trailing slash * 17142 Michael Foord .NET classes that have default indexers don't support enumeration * 17181 ais Implement INotifyPropertyChanged * 17325 Christian Muirhead Can't assign to __doc__ property on instance * 17326 Christian Muirhead BY DESIGN: can't set __name__ in a scope when running a script loaded from a source file * 17351 Eloff Cannot match previously matched named group in regex * 17551 dfugate int.__dict__.copy() omits .NET members * 17569 srivatsn str.rsplit(None) for a string with spaces is incorrect * 17582 pelikhan SaveAssemblies not saving main module * 17652 jdhardy DUPLICATE: .decode('hex') fails * 17683 srivatsn struct.calcsize('xP') is incorrect in x64 machines * 17712 felixpollan ScriptSource.SourceUnit is now Internal ? * 17759 srid DUPLICATE: LINQ: TypeError: Select() takes at least 2147483647 arguments (1 given) * 17896 jdhardy unicode('', 'ascii', 'ignore') fails with LookupError: unknown error handler name 'ignore' * 18346 Eloff Package importing regression * 18349 fuzzyman sys module oddities when installing import hooks * 386 Improve -X:PrivateBinding support * 476 Implement log / log10 for bigint's larger than double * 572 ?iga Seilnacht Binding: Compat: Coercion rules are incorrect for selecting method for binary operators * 797 Simon Dahlbacka output of __slots__ member differes from CPython, and exception message is different as well * 874 Brucec Fix os.stat_result storage * 1089 Brucec re.compile(re.escape(foo)) round trip fails in some cases * 1609 dinov Non csc warning cleanup (unusued fields, etc...) * 2290 Stanislas Pinte 'abc'.encode() requires encoding type * 2476 mziller REJECTED: assert keywork not working? * 2557 Alexey Borzenkov strptime uses %c even if there is more than one format * 3214 ayarrow DUPLICATE: "".encode('idna') causes burp in httplib.py * 3418 Cavingdeep Can't deal with non-ASCII encoding files on non-English WinXP * 3731 Mike McGavin Syntax error location not always determined correctly * 4564 dfugate Some functions in the _codecs module require 2 or more parameters when only 1 is needed * 5633 Eloff os.fdopen modifies binary data written * 6710 dfugate Trivial: FormatException method of PythonEngine does not work with ExceptionDetail engine option * 7451 Sanghyeon Seo missing nt.dup and related socket.makefile issue * 7992 sborde Removing a delegate from an event using a strongly-typed delegate does not work * 8519 heyssion2 a bug about clr.Reference * 11030 tscottw_cp Misleading exception message when using nongeneric method as generic * 11830 dfugate Caught (global-related) exception within one module breaks imports of next modules * 12009 tscottw shutil.copytree always raises shutil.Error after completing * 13401 Ronnie Maor Support __reduce_ex__ / __getnewargs__ on .NET types where it's possible * 13641 Kelie ref parameters with InAttribute should be treated as by-value parameters * 13704 CurtHagenlocher Incorrect error message when constructing datetime.datetime with insufficient arguments * 14005 ktc1 Trivial: Boolean cast from decimal wrong * 14904 dfugate nt.tmpnam() gives bad return value * 15345 dfugate UnicodeTranslateError members created from constructor parameters are None * 15353 dfugate Python 2.5: Remove "struct" module and replace with "_struct" * 15972 Davy Mitchell sys.exit(False) has an incorrect exit code under IronPython * 16002 wilberforce name mangling isn't applied to method parameters * 16003 wilberforce metaclass not called when constructing classes that inherit from another class first * 16004 ben2004uk Queryable.First() gives TypeError: First() takes at least 2147483647 arguments * 16157 kevgu error msg for "continue" inside "finally" not specific enough * 16225 dfugate Objects in sys.meta_path should be capable of disabling the importation of modules * 16241 dfugate isinstance(..., types.BuiltinFunctionType) fails for objects * 16249 dinov STA threads and finalizable objects and Thread.Sleep * 16697 dfugate Only the first object in sys.meta_path is searched * 16808 paulfelix Use of custom C# object with overloaded '/' operator breaks when true division is enabled * 16811 dfugate len(new_style_class.__dict__) is wrong * 16868 dfugate IP does not implement a number of _sha512.sha512's members * 17186 Eloff DUPLICATE: Package import should be case sensitive * 17300 CurtHagenlocher Allow non-integer arguments to nt.stat_result * 17308 jdhardy try ... else with nested try doesn't work * 17457 dfugate Implement rest of exceptions module * 17459 dfugate Implement rest of imp module * 17527 dfugate str(new_style_class.__dict__) is wrong * 17550 jdhardy Thread local storage * 17561 Lawouach Metaclass and argument passing may result in IndexError * 17622 dfugate __import__("somePkg\\someMod") should not work * 17799 Ronnie Maor int64/long incompatibility in hashing * 17859 srivatsn time.struct_time's constructor should be able to take an object Thanks to everyone who reported these bugs! Also, we've closed the following bugs that were reported internally: * 409443 Flag deprecated functions with DeprecationWarning; while we're at it, implement -W cmdline option * 409448 Implement warnings for -Qwarn and -Qwarnall * 409456 Module datetime is incomplete * 409503 Trivial: SNAP blocking: testrationalfunction_20 fails on x64 platforms * 409565 enable compat/sbs_func_args.py * 409571 SNAP blocking: test_exceptions.py fails with a StackOverflow exception on 64-bit platforms * 409590 StackOverflowException when exec "a[0]==7" for Ironpython, but Cpython can work * 409602 TypeError: cannot create weak reference to 'file' object * 409611 isinstance() can't mask an attribute error as a type error * 409612 issubclass(instance,instance) raise a type error when instance.getbases() raise a runtime error * 409617 got a different result against Ironpython and Cpython when get_header function is called * 409628 NotImplementedError: Overriding __getattribute__ of built-in types is not implemented * 409629 lost attribute leads to AttributeError: 'type' object has no attribute 'x' * 409633 SNAP blocking: test_compile.py throws a StackOverflowException under 64-bit OSes * 409635 exec C()//E(), python return 'C.__floordiv__',but Ironpython return 'C.__rfloordiv__' * 409639 test_runpy.py blocking: "TypeError: update() got an unexpected keyword argument '__name__'" * 409674 array.array('b', 'foo') causing overflowError * 409715 try __getattr__ if __getattribute__ raise AttributeError * 409729 old-style base type's __setattr__ is never called * 409738 del statements ignored by IronPython compiler * 409752 negative scenario: bad error message "M() takes at least 2147483647 arguments" * 409777 dir(someObj.someMethod) does not show "__call__" * 409821 tracking: C# implicit enum conversion allows 0 for any enum type; IronPython does not. make a decision * 438773 IP throws an unreachable assertion when trying to open files in "U+" modes * 449685 tf changeset 461435 broke complex forms tests * 467757 IronPython: incorrect error message for invalid tuple assignment You can download IronPython 2.0 Beta 5 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15625. The IronPython Team IMPORTANT NOTE If you choose to install IronPython by running IronPython.msi, please note that this will remove the previous installation of IronPython 2.0 Beta 4! -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Thu Sep 18 03:45:50 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 17 Sep 2008 18:45:50 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Re the CS1685 errors - you could always #pragma them out... From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate Sent: Wednesday, September 17, 2008 2:44 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython 2.0 Beta 5 Hello IronPython Community, We're pleased to announce the release of IronPython 2.0 Beta 5 which includes a plethora of bug fixes (100+). IronPython 2.0 Beta 5 is our last planned beta release in the 2.0 series - sometime soon we'll be releasing 2.0 Release Candidate 1. As such, you can expect far fewer changes between this release and the next. If you intend on upgrading to IronPython 2.0.0, please try out 2.0 Beta 5 now and report any blocking issues back to us ASAP. This may be your last chance to get them fixed in time for 2.0.0. This release is significant in a few respects. First and foremost, the most visible change is the fact that we've performed a major namespace transformation. We have moved all DLR types that were in the "System" namespace to "Microsoft". The reason behind this is to fix problems a few people had embedding IronPython in C# projects targeting the .NET 3.5 Framework (see http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/thread.html#8036 for background). A consequence of this change is that if you build IronPython from sources you'll notice msbuild emits warning CS1685. This is safe to ignore and it was necessary to allow this so that IronPython can continue to be run under .NET 2.0 SP1. More details on this will be coming soon in the form of a blog post... It's also worth pointing out that the DLR hosting APIs no longer have a default configuration for Python. Instead you should utilize IronPython.Hosting.Python to create script runtimes and script engines. On that note, the DLR hosting specifications document has been updated - please see http://compilerlab.members.winisp.net/dlr-spec-hosting.doc if you're interested. The following CodePlex Work Items have been closed since IronPython 2.0 Beta 4 was released: * 766 brucec CLR methods are visible on some builtin types even if clr module isn't imported * 1506 Explicit interface method implementations should be exposed by simple interface method name * 10905 tscottw_cp [Blocking Tutorial on 2.0] winforms.py example (exercise 2.1, tutorial 2) hangs * 17236 Michael Armes Cannot import from .NET types containing static variables * 17393 harrypierson Move existing site.py code into IronPython.dll * 17425 dinov Too many objects are convertible to IEnumerator * 861 brucec __module__ attribute shows up where it shouldn't * 1490 hweber re module doesn't support (?L) and (?u) in expressions * 2248 Kristof Wagemans Missing debug information for IL offset 0 of generated methods * 3290 beaugunderson Trivial: cPickle.load(s) throws wrong exception on negative cases * 5085 dfugate Implement operator.__not__ and operator.__setitem__ * 6273 dfugate re.sub(..., "...\?...", ...) broken * 7008 jdhardy os.path.isfile incompatible with CPython when path contains a double quote (") * 7828 doubleyewdee IronPython lock type does not support context manager methods * 8018 PeteHufnagel OldClass.HasSetAttr will not let me inherit __setattr__ * 8721 jackeyoo DUPLICATE: About function fdopen() in module "nt", the "ValueError"exception is not thrown as expected if set an invalid filemode as the second argument * 8783 jackeyoo if the argument of nt.read() which is less than zero did not throw exception * 9347 rridge struct.pack() mishandles "x" format * 9710 jackeyoo The exe file compiled using pyc.py is incorrect against IronPython1.1 * 9943 lewisle Search for backslash character using re fails * 10710 Michael Foord os.path.abspath(None) throws unexpected exception * 11141 tscottw_cp The += operator does not work for delegates * 15032 CurtHagenlocher DUPLICATE: Bad error message when calling generic function without specifying type * 16193 srivatsn new.instance() is missing an overload. * 16657 Seo Sanghyeon Regular expression option using (?...) syntax is not applied * 16833 Douglas Blank Improve __repr__ for standard .NET types * 16866 dfugate IP implementation of _sha512.__doc__ looks wrong * 16900 lclj Documentation CHM does not work. * 16979 dfugate Trivial: Output of "ipy.exe -h" and "ipy.exe -?" slightly different * 17040 jdhardy -tt is broken * 17045 sorokerr NEED MORE INFO: Calling an extension function from XSLT * 17047 Eriol BY DESIGN: Raw String throws SyntaxError on trailing slash * 17142 Michael Foord .NET classes that have default indexers don't support enumeration * 17181 ais Implement INotifyPropertyChanged * 17325 Christian Muirhead Can't assign to __doc__ property on instance * 17326 Christian Muirhead BY DESIGN: can't set __name__ in a scope when running a script loaded from a source file * 17351 Eloff Cannot match previously matched named group in regex * 17551 dfugate int.__dict__.copy() omits .NET members * 17569 srivatsn str.rsplit(None) for a string with spaces is incorrect * 17582 pelikhan SaveAssemblies not saving main module * 17652 jdhardy DUPLICATE: .decode('hex') fails * 17683 srivatsn struct.calcsize('xP') is incorrect in x64 machines * 17712 felixpollan ScriptSource.SourceUnit is now Internal ? * 17759 srid DUPLICATE: LINQ: TypeError: Select() takes at least 2147483647 arguments (1 given) * 17896 jdhardy unicode('', 'ascii', 'ignore') fails with LookupError: unknown error handler name 'ignore' * 18346 Eloff Package importing regression * 18349 fuzzyman sys module oddities when installing import hooks * 386 Improve -X:PrivateBinding support * 476 Implement log / log10 for bigint's larger than double * 572 ?iga Seilnacht Binding: Compat: Coercion rules are incorrect for selecting method for binary operators * 797 Simon Dahlbacka output of __slots__ member differes from CPython, and exception message is different as well * 874 Brucec Fix os.stat_result storage * 1089 Brucec re.compile(re.escape(foo)) round trip fails in some cases * 1609 dinov Non csc warning cleanup (unusued fields, etc...) * 2290 Stanislas Pinte 'abc'.encode() requires encoding type * 2476 mziller REJECTED: assert keywork not working? * 2557 Alexey Borzenkov strptime uses %c even if there is more than one format * 3214 ayarrow DUPLICATE: "".encode('idna') causes burp in httplib.py * 3418 Cavingdeep Can't deal with non-ASCII encoding files on non-English WinXP * 3731 Mike McGavin Syntax error location not always determined correctly * 4564 dfugate Some functions in the _codecs module require 2 or more parameters when only 1 is needed * 5633 Eloff os.fdopen modifies binary data written * 6710 dfugate Trivial: FormatException method of PythonEngine does not work with ExceptionDetail engine option * 7451 Sanghyeon Seo missing nt.dup and related socket.makefile issue * 7992 sborde Removing a delegate from an event using a strongly-typed delegate does not work * 8519 heyssion2 a bug about clr.Reference * 11030 tscottw_cp Misleading exception message when using nongeneric method as generic * 11830 dfugate Caught (global-related) exception within one module breaks imports of next modules * 12009 tscottw shutil.copytree always raises shutil.Error after completing * 13401 Ronnie Maor Support __reduce_ex__ / __getnewargs__ on .NET types where it's possible * 13641 Kelie ref parameters with InAttribute should be treated as by-value parameters * 13704 CurtHagenlocher Incorrect error message when constructing datetime.datetime with insufficient arguments * 14005 ktc1 Trivial: Boolean cast from decimal wrong * 14904 dfugate nt.tmpnam() gives bad return value * 15345 dfugate UnicodeTranslateError members created from constructor parameters are None * 15353 dfugate Python 2.5: Remove "struct" module and replace with "_struct" * 15972 Davy Mitchell sys.exit(False) has an incorrect exit code under IronPython * 16002 wilberforce name mangling isn't applied to method parameters * 16003 wilberforce metaclass not called when constructing classes that inherit from another class first * 16004 ben2004uk Queryable.First() gives TypeError: First() takes at least 2147483647 arguments * 16157 kevgu error msg for "continue" inside "finally" not specific enough * 16225 dfugate Objects in sys.meta_path should be capable of disabling the importation of modules * 16241 dfugate isinstance(..., types.BuiltinFunctionType) fails for objects * 16249 dinov STA threads and finalizable objects and Thread.Sleep * 16697 dfugate Only the first object in sys.meta_path is searched * 16808 paulfelix Use of custom C# object with overloaded '/' operator breaks when true division is enabled * 16811 dfugate len(new_style_class.__dict__) is wrong * 16868 dfugate IP does not implement a number of _sha512.sha512's members * 17186 Eloff DUPLICATE: Package import should be case sensitive * 17300 CurtHagenlocher Allow non-integer arguments to nt.stat_result * 17308 jdhardy try ... else with nested try doesn't work * 17457 dfugate Implement rest of exceptions module * 17459 dfugate Implement rest of imp module * 17527 dfugate str(new_style_class.__dict__) is wrong * 17550 jdhardy Thread local storage * 17561 Lawouach Metaclass and argument passing may result in IndexError * 17622 dfugate __import__("somePkg\\someMod") should not work * 17799 Ronnie Maor int64/long incompatibility in hashing * 17859 srivatsn time.struct_time's constructor should be able to take an object Thanks to everyone who reported these bugs! Also, we've closed the following bugs that were reported internally: * 409443 Flag deprecated functions with DeprecationWarning; while we're at it, implement -W cmdline option * 409448 Implement warnings for -Qwarn and -Qwarnall * 409456 Module datetime is incomplete * 409503 Trivial: SNAP blocking: testrationalfunction_20 fails on x64 platforms * 409565 enable compat/sbs_func_args.py * 409571 SNAP blocking: test_exceptions.py fails with a StackOverflow exception on 64-bit platforms * 409590 StackOverflowException when exec "a[0]==7" for Ironpython, but Cpython can work * 409602 TypeError: cannot create weak reference to 'file' object * 409611 isinstance() can't mask an attribute error as a type error * 409612 issubclass(instance,instance) raise a type error when instance.getbases() raise a runtime error * 409617 got a different result against Ironpython and Cpython when get_header function is called * 409628 NotImplementedError: Overriding __getattribute__ of built-in types is not implemented * 409629 lost attribute leads to AttributeError: 'type' object has no attribute 'x' * 409633 SNAP blocking: test_compile.py throws a StackOverflowException under 64-bit OSes * 409635 exec C()//E(), python return 'C.__floordiv__',but Ironpython return 'C.__rfloordiv__' * 409639 test_runpy.py blocking: "TypeError: update() got an unexpected keyword argument '__name__'" * 409674 array.array('b', 'foo') causing overflowError * 409715 try __getattr__ if __getattribute__ raise AttributeError * 409729 old-style base type's __setattr__ is never called * 409738 del statements ignored by IronPython compiler * 409752 negative scenario: bad error message "M() takes at least 2147483647 arguments" * 409777 dir(someObj.someMethod) does not show "__call__" * 409821 tracking: C# implicit enum conversion allows 0 for any enum type; IronPython does not. make a decision * 438773 IP throws an unreachable assertion when trying to open files in "U+" modes * 449685 tf changeset 461435 broke complex forms tests * 467757 IronPython: incorrect error message for invalid tuple assignment You can download IronPython 2.0 Beta 5 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15625 . The IronPython Team IMPORTANT NOTE If you choose to install IronPython by running IronPython.msi, please note that this will remove the previous installation of IronPython 2.0 Beta 4! -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Thu Sep 18 03:54:30 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 17 Sep 2008 18:54:30 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Specifically: http://msdn.microsoft.com/en-us/library/441722ys.aspx #pragma warning disable 1685 // internal ExtensionAttribute declaration #pragma warning restore 1685 Not having the source here, I can't test it, but I would hazard a guess it really is that simple. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, September 17, 2008 6:46 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.0 Beta 5 Re the CS1685 errors - you could always #pragma them out... From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate Sent: Wednesday, September 17, 2008 2:44 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython 2.0 Beta 5 Hello IronPython Community, We're pleased to announce the release of IronPython 2.0 Beta 5 which includes a plethora of bug fixes (100+). IronPython 2.0 Beta 5 is our last planned beta release in the 2.0 series - sometime soon we'll be releasing 2.0 Release Candidate 1. As such, you can expect far fewer changes between this release and the next. If you intend on upgrading to IronPython 2.0.0, please try out 2.0 Beta 5 now and report any blocking issues back to us ASAP. This may be your last chance to get them fixed in time for 2.0.0. This release is significant in a few respects. First and foremost, the most visible change is the fact that we've performed a major namespace transformation. We have moved all DLR types that were in the "System" namespace to "Microsoft". The reason behind this is to fix problems a few people had embedding IronPython in C# projects targeting the .NET 3.5 Framework (see http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/thread.html#8036 for background). A consequence of this change is that if you build IronPython from sources you'll notice msbuild emits warning CS1685. This is safe to ignore and it was necessary to allow this so that IronPython can continue to be run under .NET 2.0 SP1. More details on this will be coming soon in the form of a blog post... It's also worth pointing out that the DLR hosting APIs no longer have a default configuration for Python. Instead you should utilize IronPython.Hosting.Python to create script runtimes and script engines. On that note, the DLR hosting specifications document has been updated - please see http://compilerlab.members.winisp.net/dlr-spec-hosting.doc if you're interested. The following CodePlex Work Items have been closed since IronPython 2.0 Beta 4 was released: * 766 brucec CLR methods are visible on some builtin types even if clr module isn't imported * 1506 Explicit interface method implementations should be exposed by simple interface method name * 10905 tscottw_cp [Blocking Tutorial on 2.0] winforms.py example (exercise 2.1, tutorial 2) hangs * 17236 Michael Armes Cannot import from .NET types containing static variables * 17393 harrypierson Move existing site.py code into IronPython.dll * 17425 dinov Too many objects are convertible to IEnumerator * 861 brucec __module__ attribute shows up where it shouldn't * 1490 hweber re module doesn't support (?L) and (?u) in expressions * 2248 Kristof Wagemans Missing debug information for IL offset 0 of generated methods * 3290 beaugunderson Trivial: cPickle.load(s) throws wrong exception on negative cases * 5085 dfugate Implement operator.__not__ and operator.__setitem__ * 6273 dfugate re.sub(..., "...\?...", ...) broken * 7008 jdhardy os.path.isfile incompatible with CPython when path contains a double quote (") * 7828 doubleyewdee IronPython lock type does not support context manager methods * 8018 PeteHufnagel OldClass.HasSetAttr will not let me inherit __setattr__ * 8721 jackeyoo DUPLICATE: About function fdopen() in module "nt", the "ValueError"exception is not thrown as expected if set an invalid filemode as the second argument * 8783 jackeyoo if the argument of nt.read() which is less than zero did not throw exception * 9347 rridge struct.pack() mishandles "x" format * 9710 jackeyoo The exe file compiled using pyc.py is incorrect against IronPython1.1 * 9943 lewisle Search for backslash character using re fails * 10710 Michael Foord os.path.abspath(None) throws unexpected exception * 11141 tscottw_cp The += operator does not work for delegates * 15032 CurtHagenlocher DUPLICATE: Bad error message when calling generic function without specifying type * 16193 srivatsn new.instance() is missing an overload. * 16657 Seo Sanghyeon Regular expression option using (?...) syntax is not applied * 16833 Douglas Blank Improve __repr__ for standard .NET types * 16866 dfugate IP implementation of _sha512.__doc__ looks wrong * 16900 lclj Documentation CHM does not work. * 16979 dfugate Trivial: Output of "ipy.exe -h" and "ipy.exe -?" slightly different * 17040 jdhardy -tt is broken * 17045 sorokerr NEED MORE INFO: Calling an extension function from XSLT * 17047 Eriol BY DESIGN: Raw String throws SyntaxError on trailing slash * 17142 Michael Foord .NET classes that have default indexers don't support enumeration * 17181 ais Implement INotifyPropertyChanged * 17325 Christian Muirhead Can't assign to __doc__ property on instance * 17326 Christian Muirhead BY DESIGN: can't set __name__ in a scope when running a script loaded from a source file * 17351 Eloff Cannot match previously matched named group in regex * 17551 dfugate int.__dict__.copy() omits .NET members * 17569 srivatsn str.rsplit(None) for a string with spaces is incorrect * 17582 pelikhan SaveAssemblies not saving main module * 17652 jdhardy DUPLICATE: .decode('hex') fails * 17683 srivatsn struct.calcsize('xP') is incorrect in x64 machines * 17712 felixpollan ScriptSource.SourceUnit is now Internal ? * 17759 srid DUPLICATE: LINQ: TypeError: Select() takes at least 2147483647 arguments (1 given) * 17896 jdhardy unicode('', 'ascii', 'ignore') fails with LookupError: unknown error handler name 'ignore' * 18346 Eloff Package importing regression * 18349 fuzzyman sys module oddities when installing import hooks * 386 Improve -X:PrivateBinding support * 476 Implement log / log10 for bigint's larger than double * 572 ?iga Seilnacht Binding: Compat: Coercion rules are incorrect for selecting method for binary operators * 797 Simon Dahlbacka output of __slots__ member differes from CPython, and exception message is different as well * 874 Brucec Fix os.stat_result storage * 1089 Brucec re.compile(re.escape(foo)) round trip fails in some cases * 1609 dinov Non csc warning cleanup (unusued fields, etc...) * 2290 Stanislas Pinte 'abc'.encode() requires encoding type * 2476 mziller REJECTED: assert keywork not working? * 2557 Alexey Borzenkov strptime uses %c even if there is more than one format * 3214 ayarrow DUPLICATE: "".encode('idna') causes burp in httplib.py * 3418 Cavingdeep Can't deal with non-ASCII encoding files on non-English WinXP * 3731 Mike McGavin Syntax error location not always determined correctly * 4564 dfugate Some functions in the _codecs module require 2 or more parameters when only 1 is needed * 5633 Eloff os.fdopen modifies binary data written * 6710 dfugate Trivial: FormatException method of PythonEngine does not work with ExceptionDetail engine option * 7451 Sanghyeon Seo missing nt.dup and related socket.makefile issue * 7992 sborde Removing a delegate from an event using a strongly-typed delegate does not work * 8519 heyssion2 a bug about clr.Reference * 11030 tscottw_cp Misleading exception message when using nongeneric method as generic * 11830 dfugate Caught (global-related) exception within one module breaks imports of next modules * 12009 tscottw shutil.copytree always raises shutil.Error after completing * 13401 Ronnie Maor Support __reduce_ex__ / __getnewargs__ on .NET types where it's possible * 13641 Kelie ref parameters with InAttribute should be treated as by-value parameters * 13704 CurtHagenlocher Incorrect error message when constructing datetime.datetime with insufficient arguments * 14005 ktc1 Trivial: Boolean cast from decimal wrong * 14904 dfugate nt.tmpnam() gives bad return value * 15345 dfugate UnicodeTranslateError members created from constructor parameters are None * 15353 dfugate Python 2.5: Remove "struct" module and replace with "_struct" * 15972 Davy Mitchell sys.exit(False) has an incorrect exit code under IronPython * 16002 wilberforce name mangling isn't applied to method parameters * 16003 wilberforce metaclass not called when constructing classes that inherit from another class first * 16004 ben2004uk Queryable.First() gives TypeError: First() takes at least 2147483647 arguments * 16157 kevgu error msg for "continue" inside "finally" not specific enough * 16225 dfugate Objects in sys.meta_path should be capable of disabling the importation of modules * 16241 dfugate isinstance(..., types.BuiltinFunctionType) fails for objects * 16249 dinov STA threads and finalizable objects and Thread.Sleep * 16697 dfugate Only the first object in sys.meta_path is searched * 16808 paulfelix Use of custom C# object with overloaded '/' operator breaks when true division is enabled * 16811 dfugate len(new_style_class.__dict__) is wrong * 16868 dfugate IP does not implement a number of _sha512.sha512's members * 17186 Eloff DUPLICATE: Package import should be case sensitive * 17300 CurtHagenlocher Allow non-integer arguments to nt.stat_result * 17308 jdhardy try ... else with nested try doesn't work * 17457 dfugate Implement rest of exceptions module * 17459 dfugate Implement rest of imp module * 17527 dfugate str(new_style_class.__dict__) is wrong * 17550 jdhardy Thread local storage * 17561 Lawouach Metaclass and argument passing may result in IndexError * 17622 dfugate __import__("somePkg\\someMod") should not work * 17799 Ronnie Maor int64/long incompatibility in hashing * 17859 srivatsn time.struct_time's constructor should be able to take an object Thanks to everyone who reported these bugs! Also, we've closed the following bugs that were reported internally: * 409443 Flag deprecated functions with DeprecationWarning; while we're at it, implement -W cmdline option * 409448 Implement warnings for -Qwarn and -Qwarnall * 409456 Module datetime is incomplete * 409503 Trivial: SNAP blocking: testrationalfunction_20 fails on x64 platforms * 409565 enable compat/sbs_func_args.py * 409571 SNAP blocking: test_exceptions.py fails with a StackOverflow exception on 64-bit platforms * 409590 StackOverflowException when exec "a[0]==7" for Ironpython, but Cpython can work * 409602 TypeError: cannot create weak reference to 'file' object * 409611 isinstance() can't mask an attribute error as a type error * 409612 issubclass(instance,instance) raise a type error when instance.getbases() raise a runtime error * 409617 got a different result against Ironpython and Cpython when get_header function is called * 409628 NotImplementedError: Overriding __getattribute__ of built-in types is not implemented * 409629 lost attribute leads to AttributeError: 'type' object has no attribute 'x' * 409633 SNAP blocking: test_compile.py throws a StackOverflowException under 64-bit OSes * 409635 exec C()//E(), python return 'C.__floordiv__',but Ironpython return 'C.__rfloordiv__' * 409639 test_runpy.py blocking: "TypeError: update() got an unexpected keyword argument '__name__'" * 409674 array.array('b', 'foo') causing overflowError * 409715 try __getattr__ if __getattribute__ raise AttributeError * 409729 old-style base type's __setattr__ is never called * 409738 del statements ignored by IronPython compiler * 409752 negative scenario: bad error message "M() takes at least 2147483647 arguments" * 409777 dir(someObj.someMethod) does not show "__call__" * 409821 tracking: C# implicit enum conversion allows 0 for any enum type; IronPython does not. make a decision * 438773 IP throws an unreachable assertion when trying to open files in "U+" modes * 449685 tf changeset 461435 broke complex forms tests * 467757 IronPython: incorrect error message for invalid tuple assignment You can download IronPython 2.0 Beta 5 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15625 . The IronPython Team IMPORTANT NOTE If you choose to install IronPython by running IronPython.msi, please note that this will remove the previous installation of IronPython 2.0 Beta 4! -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Sep 18 05:12:18 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 17 Sep 2008 20:12:18 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: 2008/9/17 Keith J. Farmer : > Re the CS1685 errors ? you could always #pragma them out? They're actually generated from the csproj file, so they can't be pragma'd out in the cs source. We could disable them in the csproj, but that would affect all instances of that warning. -- Curt Hagenlocher curt at hagenlocher.org From kfarmer at thuban.org Thu Sep 18 11:14:35 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 18 Sep 2008 02:14:35 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: Vexing. Time to chat to the compiler folks? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, September 17, 2008 8:12 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.0 Beta 5 2008/9/17 Keith J. Farmer : > Re the CS1685 errors - you could always #pragma them out... They're actually generated from the csproj file, so they can't be pragma'd out in the cs source. We could disable them in the csproj, but that would affect all instances of that warning. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From empirebuilder at gmail.com Thu Sep 18 11:52:25 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Thu, 18 Sep 2008 11:52:25 +0200 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com> <710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <8cd017b80809180252m1b0bb32bhd9a3cf4a8abf15c8@mail.gmail.com> This is great guys. Thank you so much. > > > This release is significant in a few respects. First and foremost, the > most visible change is the fact that we've performed a major namespace > transformation. We have moved all DLR types that were in the "System" > namespace to "Microsoft". The reason behind this is to fix problems a few > people had embedding IronPython in C# projects targeting the .NET 3.5 > Framework (see > http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/thread.html#8036for background). A consequence of this change is that if you build > IronPython from sources you'll notice msbuild emits warning CS1685. This is > safe to ignore and it was necessary to allow this so that IronPython can > continue to be run under .NET 2.0 SP1. More details on this will be coming > soon in the form of a blog post? > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Sep 18 14:25:33 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Sep 2008 13:25:33 +0100 Subject: [IronPython] Pyc and subpackages Message-ID: <48D248BD.6060109@voidspace.org.uk> Hello all, I'm experimenting with the Pyc sample and compiling packages into a single assembly. It works fine for packages (great!) - but not for their *contained* subpackages. When I look at the generated assembly with Reflector, the 'DLRCachedCode' does contain the subpackage 'files' (including the '__init__.py') - but importing from the subpackage fails. Is this expected or a bug? The command line I use is: ipy pyc.py /out:modules /target:dll package\__init__.py package\module1.py package\module2.py package\subpackage\__init__.py package\subpackage\module1.py The '__init__.py' are all empty and the modules each contain a single print statement plus a single value. My top level file (left as pure Python) is: import clr clr.AddReference('modules') import package.module1 import package.module2 import package.subpackage.module1 print package.module1.value print package.module2.value print package.subpackage.module1.value It fails on the subpackage import: Imported package module 1 Imported package module 2 Traceback (most recent call last): File "C:\Dev\Pyc\test.py", line 6, in C:\Dev\Pyc\test.py ImportError: cannot import subpackage from package *Should* this work? It would be nice if it did - because otherwise we are restricted to one assembly per package, and have to add a reference to all these assemblies. The way I've been doing this is with 'Assembly.LoadFile' in the '__init__.py' - which works but is a little 'inelegant'. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From fuzzyman at voidspace.org.uk Thu Sep 18 18:27:02 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Sep 2008 17:27:02 +0100 Subject: [IronPython] Cyclic Imports in Compiled Modules - Blocker Message-ID: <48D28156.9050505@voidspace.org.uk> Hello guys, I've been attempting to create a binary distribution of Resolver One using clr.CompileModules with IronPython 2.0 Beta 5. The framework basically works - modulo the fact that subpackages in compiled assemblies don't work. However cyclic imports inside compiled modules don't work. We have some cyclic imports inside one of our packages. The code works under IronPython 2. I haven't yet attempted a minimal repro, *but* with prints inside the modules I can verify that the cyclic imports re-executes the prints in a cycle... never to escape. I'll attempt a minimal repro and repost here. This is going to block us on moving to IronPython 2 unfortunately. All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From srivatsn at microsoft.com Thu Sep 18 19:04:09 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Thu, 18 Sep 2008 10:04:09 -0700 Subject: [IronPython] Pyc and subpackages In-Reply-To: <48D248BD.6060109@voidspace.org.uk> References: <48D248BD.6060109@voidspace.org.uk> Message-ID: <3478893A-36CD-4CA5-93C4-87EA5149551E@microsoft.com> This is a known bug. It's filed in the internal bug db. I'll open a bug in codeplex once I get back to office so that it gets higher priority. On Sep 18, 2008, at 5:25 AM, "Michael Foord" wrote: > Hello all, > > I'm experimenting with the Pyc sample and compiling packages into a > single assembly. > > It works fine for packages (great!) - but not for their *contained* > subpackages. > > When I look at the generated assembly with Reflector, the > 'DLRCachedCode' does contain the subpackage 'files' (including the > '__init__.py') - but importing from the subpackage fails. > > Is this expected or a bug? > > The command line I use is: > > ipy pyc.py /out:modules /target:dll package\__init__.py > package\module1.py package\module2.py package\subpackage\__init__.py > package\subpackage\module1.py > > The '__init__.py' are all empty and the modules each contain a single > print statement plus a single value. My top level file (left as pure > Python) is: > > import clr > clr.AddReference('modules') > > import package.module1 > import package.module2 > import package.subpackage.module1 > > print package.module1.value > print package.module2.value > print package.subpackage.module1.value > > It fails on the subpackage import: > > Imported package module 1 > Imported package module 2 > Traceback (most recent call last): > File "C:\Dev\Pyc\test.py", line 6, in C:\Dev\Pyc\test.py > ImportError: cannot import subpackage from package > > *Should* this work? It would be nice if it did - because otherwise we > are restricted to one assembly per package, and have to add a > reference > to all these assemblies. > > The way I've been doing this is with 'Assembly.LoadFile' in the > '__init__.py' - which works but is a little 'inelegant'. > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From miha.valencic at gmail.com Thu Sep 18 22:22:55 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Thu, 18 Sep 2008 22:22:55 +0200 Subject: [IronPython] IronPython and Silverlight SDK Message-ID: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> Hi! I downladed the lastest SL SDK from codeplex and wanted to use ScriptRuntime and ruby & python engines with it. I found out, that the API is quite different between IP 2.0b4 and the version included in the SL-SDK. Is the SL-SDK version intended for "hosting" scenarios at all? Or is it Silverlight only? I noticed that the Microsoft.Scripting.dll is a version 2.0, whereas the one with IronPython b4 (and b5) is 1.0 While on the subject, how can I use the DLR in the "hosting scenario" and use either IronPython or IronRuby as a languages on top of it in the same ScriptRuntime? Thanks, Miha ps: The hosting-spec documents is ok to see the "overview" of what it is it supposed to do, but I am missing specifically some "guidance" on how to initialize the ScriptRuntime *from configuration*. What is expected there? -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Thu Sep 18 22:38:26 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Thu, 18 Sep 2008 22:38:26 +0200 Subject: [IronPython] MerlinWeb Message-ID: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> Guys, :) can anyone clarify what exactly is MerlinWeb, which is referenced in hosting spec? :) At first, I thought it is some "virtual" web server that is used to represent some user cases... now I'm not sure anymore. ? Miha ps: from the spec: MerlinWeb apps support an App_Script directory containing script files that any code can reference. This is the logical equivalent of ASP.NET's App_Code directory, but for dynamic script files. -------------- next part -------------- An HTML attachment was scrubbed... URL: From seshapv at microsoft.com Thu Sep 18 22:43:03 2008 From: seshapv at microsoft.com (Seshadri Pillailokam Vijayaraghavan) Date: Thu, 18 Sep 2008 13:43:03 -0700 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> Message-ID: <4F06AAB8EC03C349A5D6D0A797C4881C65A081E264@NA-EXMSG-C112.redmond.corp.microsoft.com> I can address the non-silverlight, DLR hosting part of your query - The following posts should help you get started with hosting the desktop DLR in your app (with and w/o using config files) http://blogs.msdn.com/seshadripv/archive/2008/09/07/dlr-hosting-api-latest-version-of-the-spec-is-available-online-includes-changes-to-runtime-initialization.aspx http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx http://blogs.msdn.com/seshadripv/archive/2008/09/14/dlr-hosting-api-how-to-create-a-scriptruntime-object-without-using-app-config-files-using-language-specific-hosting-api.aspx The second link contains a self contained sample console app that hosts the latest (IP V2 B5) desktop DLR. Hope this helps Sesh From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miha Valencic Sent: Thursday, September 18, 2008 1:23 PM To: Discussion of IronPython Subject: [IronPython] IronPython and Silverlight SDK Hi! I downladed the lastest SL SDK from codeplex and wanted to use ScriptRuntime and ruby & python engines with it. I found out, that the API is quite different between IP 2.0b4 and the version included in the SL-SDK. Is the SL-SDK version intended for "hosting" scenarios at all? Or is it Silverlight only? I noticed that the Microsoft.Scripting.dll is a version 2.0, whereas the one with IronPython b4 (and b5) is 1.0 While on the subject, how can I use the DLR in the "hosting scenario" and use either IronPython or IronRuby as a languages on top of it in the same ScriptRuntime? Thanks, Miha ps: The hosting-spec documents is ok to see the "overview" of what it is it supposed to do, but I am missing specifically some "guidance" on how to initialize the ScriptRuntime from configuration. What is expected there? -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Thu Sep 18 23:07:46 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Thu, 18 Sep 2008 23:07:46 +0200 Subject: [IronPython] MerlinWeb In-Reply-To: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> Message-ID: <8cd017b80809181407w18e13f77m2323107dacc6e98f@mail.gmail.com> It's IronPython for ASP.Net On Thu, Sep 18, 2008 at 10:38 PM, Miha Valencic wrote: > Guys, :) > > can anyone clarify what exactly is MerlinWeb, which is referenced in > hosting spec? :) At first, I thought it is some "virtual" web server that is > used to represent some user cases... now I'm not sure anymore. > > ? > > Miha > > ps: from the spec: > > MerlinWeb apps support an App_Script directory containing script files that > any code can reference. This is the logical equivalent of ASP.NET's > App_Code directory, but for dynamic script files. > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Sep 18 23:08:04 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 18 Sep 2008 14:08:04 -0700 Subject: [IronPython] MerlinWeb In-Reply-To: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> Message-ID: <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> It's the name of the integration of ASP.NET and DLR languages. It's currently on http://asp.net/ironpython, so you can see what it does, but that's more than a year old. An new version will be avaliable on http://codeplex.com/aspnet shortly. ~Jimmy Sent from my phone On Sep 18, 2008, at 1:38 PM, "Miha Valencic" > wrote: Guys, :) can anyone clarify what exactly is MerlinWeb, which is referenced in hosting spec? :) At first, I thought it is some "virtual" web server that is used to represent some user cases... now I'm not sure anymore. ? Miha ps: from the spec: MerlinWeb apps support an App_Script directory containing script files that any code can reference. This is the logical equivalent of ASP.NET's App_Code directory, but for dynamic script files. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Thu Sep 18 23:12:29 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Thu, 18 Sep 2008 23:12:29 +0200 Subject: [IronPython] MerlinWeb In-Reply-To: <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> Message-ID: <8cd017b80809181412v5a8ebe40t7956a97506a9d480@mail.gmail.com> Is it going to be open sourced like MVC as well? On Thu, Sep 18, 2008 at 11:08 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > It's the name of the integration of ASP.NET and DLR languages. It's > currently on http://asp.net/ironpython, so you can see what it does, but > that's more than a year old. An new version will be avaliable on > http://codeplex.com/aspnet shortly. > > ~JimmySent from my phone > > On Sep 18, 2008, at 1:38 PM, "Miha Valencic" > wrote: > > Guys, :) > > can anyone clarify what exactly is MerlinWeb, which is referenced in > hosting spec? :) At first, I thought it is some "virtual" web server that is > used to represent some user cases... now I'm not sure anymore. > > ? > > Miha > > ps: from the spec: > > MerlinWeb apps support an App_Script directory containing script files that > any code can reference. This is the logical equivalent of ASP.NET's > App_Code directory, but for dynamic script files. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Sep 18 23:10:11 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Sep 2008 22:10:11 +0100 Subject: [IronPython] MerlinWeb In-Reply-To: <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> Message-ID: <48D2C3B3.2080502@voidspace.org.uk> Jimmy Schementi wrote: > It's the name of the integration of ASP.NET and DLR languages. It's > currently on http://asp.net/ironpython, so you can see what it does, > but that's more than a year old. An new version will be avaliable on > http://codeplex.com/aspnet shortly. Will the new version be for ASP.NET MVC only - or will IronPython for ASP.NET 'classic' be further developed? Michael > > ~Jimmy > Sent from my phone > > On Sep 18, 2008, at 1:38 PM, "Miha Valencic" > wrote: > >> Guys, :) >> >> can anyone clarify what exactly is MerlinWeb, which is referenced in >> hosting spec? :) At first, I thought it is some "virtual" web server >> that is used to represent some user cases... now I'm not sure anymore. >> >> ? >> >> Miha >> >> ps: from the spec: >> >> MerlinWeb apps support an App_Script directory containing script >> files that any code can reference. This is the logical equivalent of >> ASP.NET 's App_Code directory, but for dynamic script >> files. >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Thu Sep 18 23:38:00 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 18 Sep 2008 14:38:00 -0700 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> Message-ID: Miha, Not sure why the versions are different. Also, right now the actual binary versions aren't synced, but if you want I can update sdlsdk to the same version of ipyb5. Sdlsdk is only intended for silverlight, since the binaries only work in sl, and the sources only compile "out-of-the-box" for sl. It's pretty clear that it's only for silverlight from the codeplex homepage. ~Jimmy Sent from my phone On Sep 18, 2008, at 1:23 PM, "Miha Valencic" > wrote: Hi! I downladed the lastest SL SDK from codeplex and wanted to use ScriptRuntime and ruby & python engines with it. I found out, that the API is quite different between IP 2.0b4 and the version included in the SL-SDK. Is the SL-SDK version intended for "hosting" scenarios at all? Or is it Silverlight only? I noticed that the Microsoft.Scripting.dll is a version 2.0, whereas the one with IronPython b4 (and b5) is 1.0 While on the subject, how can I use the DLR in the "hosting scenario" and use either IronPython or IronRuby as a languages on top of it in the same ScriptRuntime? Thanks, Miha ps: The hosting-spec documents is ok to see the "overview" of what it is it supposed to do, but I am missing specifically some "guidance" on how to initialize the ScriptRuntime from configuration. What is expected there? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Sep 18 23:55:21 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 18 Sep 2008 14:55:21 -0700 Subject: [IronPython] MerlinWeb In-Reply-To: <8cd017b80809181412v5a8ebe40t7956a97506a9d480@mail.gmail.com> References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> <8cd017b80809181412v5a8ebe40t7956a97506a9d480@mail.gmail.com> Message-ID: <365D57ED-3F0A-40A3-9AFC-346C18E102B9@microsoft.com> The mvc part will be, but it's to be determined for the asp.net integration. It wasn't in 2007, and it's up to the asp.net team, but I'm pushing for it. ~Jimmy Sent from my phone On Sep 18, 2008, at 2:12 PM, "Dody Gunawinata" > wrote: Is it going to be open sourced like MVC as well? On Thu, Sep 18, 2008 at 11:08 PM, Jimmy Schementi <Jimmy.Schementi at microsoft.com> wrote: It's the name of the integration of ASP.NET and DLR languages. It's currently on http://asp.net/ironpython, so you can see what it does, but that's more than a year old. An new version will be avaliable on http://codeplex.com/aspnet shortly. ~Jimmy Sent from my phone On Sep 18, 2008, at 1:38 PM, "Miha Valencic" <miha.valencic at gmail.com> wrote: Guys, :) can anyone clarify what exactly is MerlinWeb, which is referenced in hosting spec? :) At first, I thought it is some "virtual" web server that is used to represent some user cases... now I'm not sure anymore. ? Miha ps: from the spec: MerlinWeb apps support an App_Script directory containing script files that any code can reference. This is the logical equivalent of ASP.NET's App_Code directory, but for dynamic script files. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Sep 18 23:59:55 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Sep 2008 22:59:55 +0100 Subject: [IronPython] Pyc Sample for IP 2 B 5 Message-ID: <48D2CF5B.1060406@voidspace.org.uk> Hello guys, Is it possible to add the Pyc sample (from IP 2 B 4) to the download page for IronPython 2 Beta 5? Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Fri Sep 19 00:03:42 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 18 Sep 2008 15:03:42 -0700 Subject: [IronPython] MerlinWeb In-Reply-To: <48D2C3B3.2080502@voidspace.org.uk> References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> <48D2C3B3.2080502@voidspace.org.uk> Message-ID: On Sep 18, 2008, at 2:22 PM, "Michael Foord" wrote: > Jimmy Schementi wrote: >> It's the name of the integration of ASP.NET and DLR languages. It's >> currently on http://asp.net/ironpython, so you can see what it does, >> but that's more than a year old. An new version will be avaliable on >> http://codeplex.com/aspnet shortly. > > Will the new version be for ASP.NET MVC only - or will IronPython for > ASP.NET 'classic' be further developed? > > Michael Both :) initially it'll just be the webforms support, with a prototype of ironruby and mvc updated for the new bits. However, the aspnet team will be working to get all the languages working in both asp.net and mvc. I'll update you all with any new news, but right not it's just about getting those old bits updated to the new dlr bits. > > >> >> ~Jimmy >> Sent from my phone >> >> On Sep 18, 2008, at 1:38 PM, "Miha Valencic" > > wrote: >> >>> Guys, :) >>> >>> can anyone clarify what exactly is MerlinWeb, which is referenced in >>> hosting spec? :) At first, I thought it is some "virtual" web server >>> that is used to represent some user cases... now I'm not sure >>> anymore. >>> >>> ? >>> >>> Miha >>> >>> ps: from the spec: >>> >>> MerlinWeb apps support an App_Script directory containing script >>> files that any code can reference. This is the logical equivalent >>> of >>> ASP.NET 's App_Code directory, but for dynamic >>> script >>> files. >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> --- >> --------------------------------------------------------------------- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Fri Sep 19 00:07:36 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Sep 2008 23:07:36 +0100 Subject: [IronPython] MerlinWeb In-Reply-To: References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> <48D2C3B3.2080502@voidspace.org.uk> Message-ID: <48D2D128.8080601@voidspace.org.uk> Jimmy Schementi wrote: > On Sep 18, 2008, at 2:22 PM, "Michael Foord" > wrote: > > >> Jimmy Schementi wrote: >> >>> It's the name of the integration of ASP.NET and DLR languages. It's >>> currently on http://asp.net/ironpython, so you can see what it does, >>> but that's more than a year old. An new version will be avaliable on >>> http://codeplex.com/aspnet shortly. >>> >> Will the new version be for ASP.NET MVC only - or will IronPython for >> ASP.NET 'classic' be further developed? >> >> Michael >> > > Both :) initially it'll just be the webforms support, with a prototype > of ironruby and mvc updated for the new bits. However, the aspnet team > will be working to get all the languages working in both asp.net and > mvc. > > I'll update you all with any new news, but right not it's just about > getting those old bits updated to the new dlr bits. > Cool - thanks. Michael > >> >>> ~Jimmy >>> Sent from my phone >>> >>> On Sep 18, 2008, at 1:38 PM, "Miha Valencic" >> > wrote: >>> >>> >>>> Guys, :) >>>> >>>> can anyone clarify what exactly is MerlinWeb, which is referenced in >>>> hosting spec? :) At first, I thought it is some "virtual" web server >>>> that is used to represent some user cases... now I'm not sure >>>> anymore. >>>> >>>> ? >>>> >>>> Miha >>>> >>>> ps: from the spec: >>>> >>>> MerlinWeb apps support an App_Script directory containing script >>>> files that any code can reference. This is the logical equivalent >>>> of >>>> ASP.NET 's App_Code directory, but for dynamic >>>> script >>>> files. >>>> >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>> --- >>> --------------------------------------------------------------------- >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From miha.valencic at gmail.com Fri Sep 19 07:52:18 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Fri, 19 Sep 2008 07:52:18 +0200 Subject: [IronPython] MerlinWeb In-Reply-To: References: <233dfa1d0809181338kb8f8098j41a6bff74dc0ac0d@mail.gmail.com> <9D91DEC8-8EFF-4175-B1E4-D4A87D6D2303@microsoft.com> <48D2C3B3.2080502@voidspace.org.uk> Message-ID: <233dfa1d0809182252h17fac479ve8f6bf270a938b34@mail.gmail.com> Thanks for the updates. We need more of those, imho. THanks, Miha. 2008/9/19 Jimmy Schementi > > > I'll update you all with any new news, but right not it's just about > getting those old bits updated to the new dlr bits. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Fri Sep 19 08:23:32 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Fri, 19 Sep 2008 08:23:32 +0200 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> Message-ID: <233dfa1d0809182323s242626f0g6b179c5ce3c3de0d@mail.gmail.com> Jimmy, that's OK. I would like to test different languages in the same DLR though. Are IronPythoon and IronRuby on the same DLR version? 2008/9/18 Jimmy Schementi > Miha, > > Not sure why the versions are different. Also, right now the actual binary > versions aren't synced, but if you want I can update sdlsdk to the same > version of ipyb5. > > Sdlsdk is only intended for silverlight, since the binaries only work in > sl, and the sources only compile "out-of-the-box" for sl. It's pretty clear > that it's only for silverlight from the codeplex homepage. > > ~JimmySent from my phone > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Fri Sep 19 13:30:23 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 19 Sep 2008 12:30:23 +0100 Subject: [IronPython] Cyclic Imports in Compiled Modules - Blocker In-Reply-To: <48D28156.9050505@voidspace.org.uk> References: <48D28156.9050505@voidspace.org.uk> Message-ID: <48D38D4F.6060704@voidspace.org.uk> Ok - minimal repro attached. Inside the zip folder are two folders - "compiled" and "uncompiled". Both have a 'test.py' script with an accompanying package. 'test.py' merely does 'import package.module1'. The package contains 'module1.py' and 'module2.py' which print when they are first imported, and they import each other. When you execute 'test.py' in the "uncompiled" folder with IronPython 2.0 B5 it outputs: Imported package module 1 Imported package module 2 Done Done If you do the same in the "compiled" folder it cycles the 'Imported ...' lines forever... In order to get compiled packages working I added the following to the '__init__.py': import clr from System.Reflection import Assembly from System.IO import Path this_dir = Path.GetDirectoryName(__file__) ass = Assembly.LoadFile(Path.Combine(this_dir, 'modules.dll')) clr.AddReference(ass) As far as I can tell you need to do something like this in order to be able to import compiled modules from a package. Michael Foord Michael Foord wrote: > Hello guys, > > I've been attempting to create a binary distribution of Resolver One > using clr.CompileModules with IronPython 2.0 Beta 5. > > The framework basically works - modulo the fact that subpackages in > compiled assemblies don't work. However cyclic imports inside compiled > modules don't work. > > We have some cyclic imports inside one of our packages. The code works > under IronPython 2. I haven't yet attempted a minimal repro, *but* > with prints inside the modules I can verify that the cyclic imports > re-executes the prints in a cycle... never to escape. > > I'll attempt a minimal repro and repost here. This is going to block > us on moving to IronPython 2 unfortunately. > > All the best, > > Michael > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ -------------- next part -------------- A non-text attachment was scrubbed... Name: cyclic-imports.zip Type: application/octet-stream Size: 3964 bytes Desc: not available URL: From fuzzyman at voidspace.org.uk Fri Sep 19 14:26:54 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 19 Sep 2008 13:26:54 +0100 Subject: [IronPython] Named Tuple and IronPython 2 Message-ID: <48D39A8E.4030200@voidspace.org.uk> Hello all, At PyCon UK Raymond Hettinger showed off the Named Tuple; a very useful recipe for creating tuples with named fields. It is becoming part of the standard library in Python 2.6. http://code.activestate.com/recipes/500261/ >>> from namedtuple import namedtuple >>> thing = namedtuple('thing', ('whizz', 'pop')) >>> thing >>> i = thing(1, 2) >>> i.whizz 1 >>> i.pop 2 >>> w, p = i >>> w, p (1, 2) >>> i thing(whizz=1, pop=2) >>> I've attached a modified version that works with IronPython 2 B5 (it doesn't work with 2B4 due to a very odd bug that is now fixed). The only change needed was to comment out the use of 'sys._getframe' which is there for pickle support. It is only conditionally used, because Jython didn't support this either - but on Jython _getframe wasn't defined at all so the conditional check fails on IronPython: # Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): result.__module__ = _sys._getframe(1).f_globals['__name__'] I'll suggest a modification to the recipe that works with IronPython. A better solution would be to implement '_getframe' of course... :-) Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: namedtuple.py URL: From fuzzyman at voidspace.org.uk Fri Sep 19 14:33:37 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 19 Sep 2008 13:33:37 +0100 Subject: [IronPython] Django and IronPython Message-ID: <48D39C21.8030303@voidspace.org.uk> Hello all, I had a very good conversation with Jacob Kaplan-Moss at PyCon UK. He is keen to see Django running on IronPython and *very* willing to accept patches / bug reports. If there are fundamental difficulties (like the unicode / str) issue then he will even look at how Django can change to work with IronPython. If you do try running Django with IronPython then either report any issues directly to the Django guys - or report them here and I will make sure they get passed on. All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From miha.valencic at gmail.com Fri Sep 19 15:00:46 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Fri, 19 Sep 2008 15:00:46 +0200 Subject: [IronPython] Django and IronPython In-Reply-To: <48D39C21.8030303@voidspace.org.uk> References: <48D39C21.8030303@voidspace.org.uk> Message-ID: <233dfa1d0809190600u294f9e94vda90c27ae79ab9e3@mail.gmail.com> Michael, that is good news! Miha 2008/9/19 Michael Foord > Hello all, > > I had a very good conversation with Jacob Kaplan-Moss at PyCon UK. He is > keen to see Django running on IronPython and *very* willing to accept > patches / bug reports. If there are fundamental difficulties (like the > unicode / str) issue then he will even look at how Django can change to work > with IronPython. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Sep 19 18:14:11 2008 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 19 Sep 2008 09:14:11 -0700 Subject: [IronPython] Named Tuple and IronPython 2 In-Reply-To: <48D39A8E.4030200@voidspace.org.uk> References: <48D39A8E.4030200@voidspace.org.uk> Message-ID: <350E7D38B6D819428718949920EC2355421B4E8B51@NA-EXMSG-C102.redmond.corp.microsoft.com> Not too long ago I prototyped a frames implementation including making _getframe work - but it doesn't include locals in the frames. I guess in this case it would work just fine. The downside is it results in a 50% perf degrade on Pybench when calling recursive functions. But we're already really fast calling functions so maybe that's acceptable. Anyway it's something we can consider for a post-2.0 release (maybe w/ a command line option to control its presence) but I came up with the prototype too late to go adding it to 2.0. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 19, 2008 5:27 AM To: Discussion of IronPython Subject: [IronPython] Named Tuple and IronPython 2 Hello all, At PyCon UK Raymond Hettinger showed off the Named Tuple; a very useful recipe for creating tuples with named fields. It is becoming part of the standard library in Python 2.6. http://code.activestate.com/recipes/500261/ >>> from namedtuple import namedtuple >>> thing = namedtuple('thing', ('whizz', 'pop')) >>> thing >>> i = thing(1, 2) >>> i.whizz 1 >>> i.pop 2 >>> w, p = i >>> w, p (1, 2) >>> i thing(whizz=1, pop=2) >>> I've attached a modified version that works with IronPython 2 B5 (it doesn't work with 2B4 due to a very odd bug that is now fixed). The only change needed was to comment out the use of 'sys._getframe' which is there for pickle support. It is only conditionally used, because Jython didn't support this either - but on Jython _getframe wasn't defined at all so the conditional check fails on IronPython: # Bypass this step in enviroments where # sys._getframe is not defined (Jython for example). if hasattr(_sys, '_getframe'): result.__module__ = _sys._getframe(1).f_globals['__name__'] I'll suggest a modification to the recipe that works with IronPython. A better solution would be to implement '_getframe' of course... :-) Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From dblank at brynmawr.edu Fri Sep 19 18:34:57 2008 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri, 19 Sep 2008 12:34:57 -0400 Subject: [IronPython] Named Tuple and IronPython 2 In-Reply-To: <350E7D38B6D819428718949920EC2355421B4E8B51@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <48D39A8E.4030200@voidspace.org.uk> <350E7D38B6D819428718949920EC2355421B4E8B51@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48D3D4B1.2030801@brynmawr.edu> Dino Viehland wrote: > Not too long ago I prototyped a frames implementation including > making _getframe work - but it doesn't include locals in the frames. > I guess in this case it would work just fine. > > The downside is it results in a 50% perf degrade on Pybench when > calling recursive functions. But we're already really fast calling > functions so maybe that's acceptable. Anyway it's something we can > consider for a post-2.0 release (maybe w/ a command line option to > control its presence) but I came up with the prototype too late to go > adding it to 2.0. add prototype frames: +1 by default, or with command-line option: +1 Thanks! -Doug From Jimmy.Schementi at microsoft.com Fri Sep 19 19:01:40 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 19 Sep 2008 10:01:40 -0700 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF20B9@NA-EXMSG-C116.redmond.corp.microsoft.com> >>> Not sure why the versions are different. That was a lie ... I do know why the versions are different; everything that works with Silverlight 2 from Microsoft "should" have an assembly version of 2.0, and a file version of 2.0.xxxxx.x, where the x's match the build number of whatever Silverlight release they are associated with. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Thursday, September 18, 2008 2:38 PM To: Discussion of IronPython Cc: Discussion of IronPython Subject: Re: [IronPython] IronPython and Silverlight SDK Miha, Not sure why the versions are different. Also, right now the actual binary versions aren't synced, but if you want I can update sdlsdk to the same version of ipyb5. Sdlsdk is only intended for silverlight, since the binaries only work in sl, and the sources only compile "out-of-the-box" for sl. It's pretty clear that it's only for silverlight from the codeplex homepage. ~Jimmy Sent from my phone On Sep 18, 2008, at 1:23 PM, "Miha Valencic" > wrote: Hi! I downladed the lastest SL SDK from codeplex and wanted to use ScriptRuntime and ruby & python engines with it. I found out, that the API is quite different between IP 2.0b4 and the version included in the SL-SDK. Is the SL-SDK version intended for "hosting" scenarios at all? Or is it Silverlight only? I noticed that the Microsoft.Scripting.dll is a version 2.0, whereas the one with IronPython b4 (and b5) is 1.0 While on the subject, how can I use the DLR in the "hosting scenario" and use either IronPython or IronRuby as a languages on top of it in the same ScriptRuntime? Thanks, Miha ps: The hosting-spec documents is ok to see the "overview" of what it is it supposed to do, but I am missing specifically some "guidance" on how to initialize the ScriptRuntime from configuration. What is expected there? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Fri Sep 19 19:59:30 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Fri, 19 Sep 2008 19:59:30 +0200 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF20B9@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF20B9@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <233dfa1d0809191059y457b92cbxd164ab55caa1202c@mail.gmail.com> LOL ;) Do you have any idea as to why one can't use the DLL's in SL SDK to host IronPython/ruby/jscript? I guess there will be a point in time, where those libraries will be the same no matter which distribution one will take? Miha 2008/9/19 Jimmy Schementi > >>> Not sure why the versions are different. > That was a lie ... I do know why the versions are different; everything > that works with Silverlight 2 from Microsoft "should" have an assembly > version of 2.0, and a file version of 2.0.xxxxx.x, where the x's match the > build number of whatever Silverlight release they are associated with. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Harry.Pierson at microsoft.com Fri Sep 19 20:08:42 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Fri, 19 Sep 2008 11:08:42 -0700 Subject: [IronPython] IronPython 2.0 Beta 5 In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B42EC14@NA-EXMSG-C102.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779219@NA-EXMSG-C104.redmond.corp.microsoft.com><710DF26F214D2B4BB94287123FFE980A22C5779335@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: I sent email to the compiler folks on this since I'm not sure ExtensionAttribute should be considered a predefined system type (VBC doesn't). But they wouldn't be able to make any changes in time for our 2.0 release anyway. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, September 18, 2008 2:15 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.0 Beta 5 Vexing. Time to chat to the compiler folks? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, September 17, 2008 8:12 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.0 Beta 5 2008/9/17 Keith J. Farmer : > Re the CS1685 errors - you could always #pragma them out... They're actually generated from the csproj file, so they can't be pragma'd out in the cs source. We could disable them in the csproj, but that would affect all instances of that warning. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Fri Sep 19 20:23:19 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 19 Sep 2008 11:23:19 -0700 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: <233dfa1d0809191059y457b92cbxd164ab55caa1202c@mail.gmail.com> References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF20B9@NA-EXMSG-C116.redmond.corp.microsoft.com> <233dfa1d0809191059y457b92cbxd164ab55caa1202c@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF219E@NA-EXMSG-C116.redmond.corp.microsoft.com> > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Miha Valencic > Sent: Friday, September 19, 2008 11:00 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython and Silverlight SDK > > LOL ;) > > Do you have any idea as to why one can't use the DLL's in SL SDK to > host IronPython/ruby/jscript? You can ... just not on the desktop, since they are Silverlight builds and are linked against coreclr, mscorlib, and all the other assemblies that are part of Silverlight. Microsoft.Scripting.Silverlight.dll hosts the DLR to run .py, .rb, .js files in the browser. > I guess there will be a point in time, where those libraries will be > the same no matter which distribution one will take? The problem is the version of the DLR is different everywhere we ship it; python, ruby, and sdlsdk. These will definitely unify in the future, when the DLR is more static to us, and especially when it's part of the .NET Framework. We're also trying to get daily builds of all languages out to the public, so getting a set of binaries that all share the same DLR won't be such a pain. If you want today, you can hack up the project files in the sdlsdk, changing all the references to Silverlight assemblies to Desktop assemblies, and then you can produce builds of the DLR, Ruby, and Python for the desktop that all work together. > Miha > > > 2008/9/19 Jimmy Schementi > > > >>> Not sure why the versions are different. > > That was a lie ... I do know why the versions are different; > everything that works with Silverlight 2 from Microsoft "should" have > an assembly version of 2.0, and a file version of 2.0.xxxxx.x, where > the x's match the build number of whatever Silverlight release they > are associated with. > > > From miha.valencic at gmail.com Fri Sep 19 20:49:45 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Fri, 19 Sep 2008 20:49:45 +0200 Subject: [IronPython] IronPython and Silverlight SDK In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF219E@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <233dfa1d0809181322g2b0e13fl87d63be240badd92@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF20B9@NA-EXMSG-C116.redmond.corp.microsoft.com> <233dfa1d0809191059y457b92cbxd164ab55caa1202c@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EBF219E@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <233dfa1d0809191149p55be4f96k601df6da28bf6e1d@mail.gmail.com> That would certainly be helpful. Thanks for the insight and keep up the good work! Thanks, Miha. 2008/9/19 Jimmy Schementi > The problem is the version of the DLR is different everywhere we ship it; > python, ruby, and sdlsdk. These will definitely unify in the future, when > the DLR is more static to us, and especially when it's part of the .NET > Framework. We're also trying to get daily builds of all languages out to the > public, so getting a set of binaries that all share the same DLR won't be > such a pain. > > If you want today, you can hack up the project files in the sdlsdk, > changing all the references to Silverlight assemblies to Desktop assemblies, > and then you can produce builds of the DLR, Ruby, and Python for the desktop > that all work together. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidjensen at usa.net Fri Sep 19 21:20:21 2008 From: davidjensen at usa.net (David Jensen) Date: Fri, 19 Sep 2008 15:20:21 -0400 Subject: [IronPython] web frameworks Message-ID: <921misTTV2306S07.1221852021@cmsweb07.cms.usa.net> The four main newer web frameworks are: django, turbogears, pylons and web2py - see python.org site. Have you looked into the other three? Thanks, David Jensen From srivatsn at microsoft.com Fri Sep 19 22:57:14 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Fri, 19 Sep 2008 13:57:14 -0700 Subject: [IronPython] Cyclic Imports in Compiled Modules - Blocker In-Reply-To: <48D38D4F.6060704@voidspace.org.uk> References: <48D28156.9050505@voidspace.org.uk> <48D38D4F.6060704@voidspace.org.uk> Message-ID: Thanks Michael. I've filed both the issues a high pri bugs in Codeplex: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18575 http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18576 I'll let you know once they are fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 19, 2008 4:30 AM To: Discussion of IronPython Subject: Re: [IronPython] Cyclic Imports in Compiled Modules - Blocker Ok - minimal repro attached. Inside the zip folder are two folders - "compiled" and "uncompiled". Both have a 'test.py' script with an accompanying package. 'test.py' merely does 'import package.module1'. The package contains 'module1.py' and 'module2.py' which print when they are first imported, and they import each other. When you execute 'test.py' in the "uncompiled" folder with IronPython 2.0 B5 it outputs: Imported package module 1 Imported package module 2 Done Done If you do the same in the "compiled" folder it cycles the 'Imported ...' lines forever... In order to get compiled packages working I added the following to the '__init__.py': import clr from System.Reflection import Assembly from System.IO import Path this_dir = Path.GetDirectoryName(__file__) ass = Assembly.LoadFile(Path.Combine(this_dir, 'modules.dll')) clr.AddReference(ass) As far as I can tell you need to do something like this in order to be able to import compiled modules from a package. Michael Foord Michael Foord wrote: > Hello guys, > > I've been attempting to create a binary distribution of Resolver One > using clr.CompileModules with IronPython 2.0 Beta 5. > > The framework basically works - modulo the fact that subpackages in > compiled assemblies don't work. However cyclic imports inside compiled > modules don't work. > > We have some cyclic imports inside one of our packages. The code works > under IronPython 2. I haven't yet attempted a minimal repro, *but* > with prints inside the modules I can verify that the cyclic imports > re-executes the prints in a cycle... never to escape. > > I'll attempt a minimal repro and repost here. This is going to block > us on moving to IronPython 2 unfortunately. > > All the best, > > Michael > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From dan.eloff at gmail.com Sat Sep 20 18:30:14 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 20 Sep 2008 11:30:14 -0500 Subject: [IronPython] Operations.GetMember in b5 Message-ID: <4817b6fc0809200930y1dfcb483r3d85fbb201aa8383@mail.gmail.com> Hi, I'm noticing that GetMember cannot perform the casts it used to even two weeks ago. Is there some other function I should be using or something I should know about this? Tuples and lists of strings cannot be cast to IEnumerable anymore, python functions cannot be cast to Func<...> or Action<...> delegates anymore. I got around the strings case by wrapping the python list in List(), which indicates that internally IronPython has no difficulty converting to IEnumerable since that's what the List constructor takes. Not really sure what to do about the function casts, what's the recommended way to expose Python functions and methods to C#? GetMember> seems to explode in too many ways now with the delegate regressions for instance methods and now this. -Dan From dfugate at microsoft.com Sat Sep 20 19:32:18 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Sat, 20 Sep 2008 10:32:18 -0700 Subject: [IronPython] Pyc Sample for IP 2 B 5 In-Reply-To: <48D2CF5B.1060406@voidspace.org.uk> References: <48D2CF5B.1060406@voidspace.org.uk> Message-ID: I've now added couple of sentences about this to the "IMPORTANT NOTES" section on the 2.0B5 download page along with a link to the 2.0B4 download page. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, September 18, 2008 3:00 PM To: Discussion of IronPython Subject: [IronPython] Pyc Sample for IP 2 B 5 Hello guys, Is it possible to add the Pyc sample (from IP 2 B 4) to the download page for IronPython 2 Beta 5? Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Sep 20 22:49:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 20 Sep 2008 21:49:34 +0100 Subject: [IronPython] Pyc Sample for IP 2 B 5 In-Reply-To: References: <48D2CF5B.1060406@voidspace.org.uk> Message-ID: <48D561DE.3020707@voidspace.org.uk> Dave Fugate wrote: > I've now added couple of sentences about this to the "IMPORTANT NOTES" section on the 2.0B5 download page along with a link to the 2.0B4 download page. > > Cool - thanks. Michael > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, September 18, 2008 3:00 PM > To: Discussion of IronPython > Subject: [IronPython] Pyc Sample for IP 2 B 5 > > Hello guys, > > Is it possible to add the Pyc sample (from IP 2 B 4) to the download > page for IronPython 2 Beta 5? > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From deus.verus at gmail.com Sun Sep 21 07:31:53 2008 From: deus.verus at gmail.com (Serge R) Date: Sun, 21 Sep 2008 15:31:53 +1000 Subject: [IronPython] Importing System in IronPython 2 beta 5 Message-ID: <18c139230809202231h56ad3481p851c4416448f4088@mail.gmail.com> I am migrating from 1.1 and have been unable to import System.Math class. I took a look at what's actually been imported clr.AddReference("System") import System print dir(System) On IP2 I got a small list that didn't contain Math or many other classes. Am I referencing something wrong? IP2 List: ['CodeDom', 'Collections', 'ComponentModel', 'Configuration', 'Diagnostics', 'FileStyleUriParser', 'FtpStyleUriParser', 'GenericUriParser', 'GenericUriParserOptions', 'GopherStyleUriParser', 'HttpStyleUriParser', 'IO', 'LdapStyleUriParser', 'Media', 'Net', 'NetPipeStyleUriParser', 'NetTcpStyleUriParser', 'NewsStyleUriParser', 'Runtime', 'Security', 'Text', 'Threading', 'Timers', 'Uri', 'UriBuilder', 'UriComponents', 'UriFormat', 'UriFormatException', 'UriHostNameType', 'UriIdnScope', 'UriKind', 'UriParser', 'UriPartial', 'UriTypeConverter', 'Web'] IP1 List: ['AccessViolationException', 'Action', 'ActivationContext', 'Activator', 'AppDomain', 'AppDomainInitializer', 'AppDomainManager', 'AppDomainManagerInitializationOptions', 'AppDomainSetup', 'AppDomainUnloadedException', 'ApplicationException', 'ApplicationId', 'ApplicationIdentity', 'ArgIterator', 'ArgumentException', 'ArgumentNullException', 'ArgumentOutOfRangeException', 'ArithmeticException', 'Array', 'ArraySegment', 'ArrayTypeMismatchException', 'AssemblyLoadEventArgs', 'AssemblyLoadEventHandler', 'AsyncCallback', 'Attribute', 'AttributeTargets', 'AttributeUsageAttribute', 'BadImageFormatException', 'Base64FormattingOptions', 'BitConverter', 'Boolean', 'Buffer', 'Byte', 'CLSCompliantAttribute', 'CannotUnloadAppDomainException', 'Char', 'CharEnumerator', 'CodeDom', 'Collections', 'Comparison', 'ComponentModel', 'Configuration', 'Console', 'ConsoleCancelEventArgs', 'ConsoleCancelEventHandler', 'ConsoleColor', 'ConsoleKey', 'ConsoleKeyInfo', 'ConsoleModifiers', 'ConsoleSpecialKey', 'ContextBoundObject', 'ContextMarshalException', 'ContextStaticAttribute', 'Convert', 'Converter', 'CrossAppDomainDelegate', 'DBNull', 'DataMisalignedException', 'DateTime', 'DateTimeKind', 'DateTimeOffset', 'DayOfWeek', 'Decimal', 'Delegate', 'Deployment', 'Diagnostics', 'DivideByZeroException', 'DllNotFoundException', 'Double', 'DuplicateWaitObjectException', 'EntryPointNotFoundException', 'Enum', 'Environment', 'EnvironmentVariableTarget', 'EventArgs', 'EventHandler', 'Exception', 'ExecutionEngineException', 'FieldAccessException', 'FileStyleUriParser', 'FlagsAttribute', 'FormatException', 'FtpStyleUriParser', 'GC', 'GCCollectionMode', 'GenericUriParser', 'GenericUriParserOptions', 'Globalization', 'GopherStyleUriParser', 'Guid', 'HttpStyleUriParser', 'IAppDomainSetup', 'IAsyncResult', 'ICloneable', 'IComparable', 'IConvertible', 'ICustomFormatter', 'IDisposable', 'IEquatable', 'IFormatProvider', 'IFormattable', 'IO', 'IServiceProvider', 'IndexOutOfRangeException', 'InsufficientMemoryException', 'Int16', 'Int32', 'Int64', 'IntPtr', 'InvalidCastException', 'InvalidOperationException', 'InvalidProgramException', 'LdapStyleUriParser', 'LoaderOptimization', 'LoaderOptimizationAttribute', 'LocalDataStoreSlot', 'MTAThreadAttribute', 'MarshalByRefObject', 'Math', 'Media', 'MemberAccessException', 'MethodAccessException', 'MidpointRounding', 'MissingFieldException', 'MissingMemberException', 'MissingMethodException', 'ModuleHandle', 'MulticastDelegate', 'MulticastNotSupportedException', 'Net', 'NetPipeStyleUriParser', 'NetTcpStyleUriParser', 'NewsStyleUriParser', 'NonSerializedAttribute', 'NotFiniteNumberException', 'NotImplementedException', 'NotSupportedException', 'NullReferenceException', 'Nullable', 'Object', 'ObjectDisposedException', 'ObsoleteAttribute', 'OperatingSystem', 'OperationCanceledException', 'OutOfMemoryException', 'OverflowException', 'ParamArrayAttribute', 'PlatformID', 'PlatformNotSupportedException', 'Predicate', 'Random', 'RankException', 'Reflection', 'ResolveEventArgs', 'ResolveEventHandler', 'Resources', 'Runtime', 'RuntimeArgumentHandle', 'RuntimeFieldHandle', 'RuntimeMethodHandle', 'RuntimeTypeHandle', 'SByte', 'STAThreadAttribute', 'Security', 'SerializableAttribute', 'Single', 'StackOverflowException', 'String', 'StringComparer', 'StringComparison', 'StringSplitOptions', 'SystemException', 'Text', 'ThreadStaticAttribute', 'Threading', 'TimeSpan', 'TimeZone', 'TimeoutException', 'Timers', 'Type', 'TypeCode', 'TypeInitializationException', 'TypeLoadException', 'TypeUnloadedException', 'TypedReference', 'UInt16', 'UInt32', 'UInt64', 'UIntPtr', 'UnauthorizedAccessException', 'UnhandledExceptionEventArgs', 'UnhandledExceptionEventHandler', 'Uri', 'UriBuilder', 'UriComponents', 'UriFormat', 'UriFormatException', 'UriHostNameType', 'UriIdnScope', 'UriKind', 'UriParser', 'UriPartial', 'UriTypeConverter', 'ValueType', 'Version', 'Void', 'WeakReference', 'Web', '_AppDomain', '__builtins__', '__dict__', '__name__'] -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Sep 21 12:21:35 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 21 Sep 2008 11:21:35 +0100 Subject: [IronPython] Cyclic Imports in Compiled Modules - Blocker In-Reply-To: References: <48D28156.9050505@voidspace.org.uk> <48D38D4F.6060704@voidspace.org.uk> Message-ID: <48D6202F.2060602@voidspace.org.uk> Srivatsn Narayanan wrote: > Thanks Michael. I've filed both the issues a high pri bugs in Codeplex: > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18575 > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18576 > Cool - thanks Sri. Michael > I'll let you know once they are fixed. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 19, 2008 4:30 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Cyclic Imports in Compiled Modules - Blocker > > Ok - minimal repro attached. > > Inside the zip folder are two folders - "compiled" and "uncompiled". > Both have a 'test.py' script with an accompanying package. > > 'test.py' merely does 'import package.module1'. > > The package contains 'module1.py' and 'module2.py' which print when they are first imported, and they import each other. > > When you execute 'test.py' in the "uncompiled" folder with IronPython 2.0 B5 it outputs: > > Imported package module 1 > Imported package module 2 > Done > Done > > If you do the same in the "compiled" folder it cycles the 'Imported ...' > lines forever... > > In order to get compiled packages working I added the following to the > '__init__.py': > > import clr > from System.Reflection import Assembly > from System.IO import Path > > this_dir = Path.GetDirectoryName(__file__) > ass = Assembly.LoadFile(Path.Combine(this_dir, 'modules.dll')) > clr.AddReference(ass) > > As far as I can tell you need to do something like this in order to be able to import compiled modules from a package. > > Michael Foord > > > > Michael Foord wrote: > >> Hello guys, >> >> I've been attempting to create a binary distribution of Resolver One >> using clr.CompileModules with IronPython 2.0 Beta 5. >> >> The framework basically works - modulo the fact that subpackages in >> compiled assemblies don't work. However cyclic imports inside compiled >> modules don't work. >> >> We have some cyclic imports inside one of our packages. The code works >> under IronPython 2. I haven't yet attempted a minimal repro, *but* >> with prints inside the modules I can verify that the cyclic imports >> re-executes the prints in a cycle... never to escape. >> >> I'll attempt a minimal repro and repost here. This is going to block >> us on moving to IronPython 2 unfortunately. >> >> All the best, >> >> Michael >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From ronnie.maor at gmail.com Sun Sep 21 16:47:44 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Sun, 21 Sep 2008 17:47:44 +0300 Subject: [IronPython] Importing System in IronPython 2 beta 5 In-Reply-To: <18c139230809202231h56ad3481p851c4416448f4088@mail.gmail.com> References: <18c139230809202231h56ad3481p851c4416448f4088@mail.gmail.com> Message-ID: <2fd6b9d0809210747u35edfbf6h892a219268077416@mail.gmail.com> I get the same problem. Another symptom is that "import System" fails if you don't AddReference first. never needed to do that for IPy 1.1 and don't need to either when running ipy 2.0. It fails with my hosting code, and also reproduces with the "hello world" hosting sample: http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx The only changes I made to the sample were 1) delete ruby configuration from App.config and the line of code that builds a ruby engine (I don't have the assemblies for ruby) 2) change the line defining the source code to: ScriptSource source = pyEng.CreateScriptSourceFromString(@"import System", SourceCodeKind.Statements); 3) remove the code that gets the "output" variable from pyEng (since we don't produce it) like I said, this fails with "No module named System". If you add a clr.AddReference("System"), then import works, but dir() seems to only show namespaces and not types, so import System.DateTime will fail. I'm now looking at sources for IronPythonConsole to see what the difference is, but if someone knows what I'm doing wrong, please tell... thanks Ronnie On Sun, Sep 21, 2008 at 8:31 AM, Serge R wrote: > I am migrating from 1.1 and have been unable to import System.Math class. I > took a look at what's actually been imported > > clr.AddReference("System") > import System > print dir(System) > > On IP2 I got a small list that didn't contain Math or many other classes. > Am I referencing something wrong? > > IP2 List: > ['CodeDom', 'Collections', 'ComponentModel', 'Configuration', > 'Diagnostics', 'FileStyleUriParser', 'FtpStyleUriParser', > 'GenericUriParser', 'GenericUriParserOptions', 'GopherStyleUriParser', > 'HttpStyleUriParser', 'IO', 'LdapStyleUriParser', 'Media', 'Net', > 'NetPipeStyleUriParser', 'NetTcpStyleUriParser', 'NewsStyleUriParser', > 'Runtime', 'Security', 'Text', 'Threading', 'Timers', 'Uri', 'UriBuilder', > 'UriComponents', 'UriFormat', 'UriFormatException', 'UriHostNameType', > 'UriIdnScope', 'UriKind', 'UriParser', 'UriPartial', 'UriTypeConverter', > 'Web'] > > IP1 List: > ['AccessViolationException', 'Action', 'ActivationContext', 'Activator', > 'AppDomain', 'AppDomainInitializer', 'AppDomainManager', > 'AppDomainManagerInitializationOptions', 'AppDomainSetup', > 'AppDomainUnloadedException', 'ApplicationException', 'ApplicationId', > 'ApplicationIdentity', 'ArgIterator', 'ArgumentException', > 'ArgumentNullException', 'ArgumentOutOfRangeException', > 'ArithmeticException', 'Array', 'ArraySegment', > 'ArrayTypeMismatchException', 'AssemblyLoadEventArgs', > 'AssemblyLoadEventHandler', 'AsyncCallback', 'Attribute', > 'AttributeTargets', 'AttributeUsageAttribute', 'BadImageFormatException', > 'Base64FormattingOptions', 'BitConverter', 'Boolean', 'Buffer', 'Byte', > 'CLSCompliantAttribute', 'CannotUnloadAppDomainException', 'Char', > 'CharEnumerator', 'CodeDom', 'Collections', 'Comparison', 'ComponentModel', > 'Configuration', 'Console', 'ConsoleCancelEventArgs', > 'ConsoleCancelEventHandler', 'ConsoleColor', 'ConsoleKey', 'ConsoleKeyInfo', > 'ConsoleModifiers', 'ConsoleSpecialKey', 'ContextBoundObject', > 'ContextMarshalException', 'ContextStaticAttribute', 'Convert', 'Converter', > 'CrossAppDomainDelegate', 'DBNull', 'DataMisalignedException', 'DateTime', > 'DateTimeKind', 'DateTimeOffset', 'DayOfWeek', 'Decimal', 'Delegate', > 'Deployment', 'Diagnostics', 'DivideByZeroException', > 'DllNotFoundException', 'Double', 'DuplicateWaitObjectException', > 'EntryPointNotFoundException', 'Enum', 'Environment', > 'EnvironmentVariableTarget', 'EventArgs', 'EventHandler', 'Exception', > 'ExecutionEngineException', 'FieldAccessException', 'FileStyleUriParser', > 'FlagsAttribute', 'FormatException', 'FtpStyleUriParser', 'GC', > 'GCCollectionMode', 'GenericUriParser', 'GenericUriParserOptions', > 'Globalization', 'GopherStyleUriParser', 'Guid', 'HttpStyleUriParser', > 'IAppDomainSetup', 'IAsyncResult', 'ICloneable', 'IComparable', > 'IConvertible', 'ICustomFormatter', 'IDisposable', 'IEquatable', > 'IFormatProvider', 'IFormattable', 'IO', 'IServiceProvider', > 'IndexOutOfRangeException', 'InsufficientMemoryException', 'Int16', 'Int32', > 'Int64', 'IntPtr', 'InvalidCastException', 'InvalidOperationException', > 'InvalidProgramException', 'LdapStyleUriParser', 'LoaderOptimization', > 'LoaderOptimizationAttribute', 'LocalDataStoreSlot', 'MTAThreadAttribute', > 'MarshalByRefObject', 'Math', 'Media', 'MemberAccessException', > 'MethodAccessException', 'MidpointRounding', 'MissingFieldException', > 'MissingMemberException', 'MissingMethodException', 'ModuleHandle', > 'MulticastDelegate', 'MulticastNotSupportedException', 'Net', > 'NetPipeStyleUriParser', 'NetTcpStyleUriParser', 'NewsStyleUriParser', > 'NonSerializedAttribute', 'NotFiniteNumberException', > 'NotImplementedException', 'NotSupportedException', > 'NullReferenceException', 'Nullable', 'Object', 'ObjectDisposedException', > 'ObsoleteAttribute', 'OperatingSystem', 'OperationCanceledException', > 'OutOfMemoryException', 'OverflowException', 'ParamArrayAttribute', > 'PlatformID', 'PlatformNotSupportedException', 'Predicate', 'Random', > 'RankException', 'Reflection', 'ResolveEventArgs', 'ResolveEventHandler', > 'Resources', 'Runtime', 'RuntimeArgumentHandle', 'RuntimeFieldHandle', > 'RuntimeMethodHandle', 'RuntimeTypeHandle', 'SByte', 'STAThreadAttribute', > 'Security', 'SerializableAttribute', 'Single', 'StackOverflowException', > 'String', 'StringComparer', 'StringComparison', 'StringSplitOptions', > 'SystemException', 'Text', 'ThreadStaticAttribute', 'Threading', 'TimeSpan', > 'TimeZone', 'TimeoutException', 'Timers', 'Type', 'TypeCode', > 'TypeInitializationException', 'TypeLoadException', 'TypeUnloadedException', > 'TypedReference', 'UInt16', 'UInt32', 'UInt64', 'UIntPtr', > 'UnauthorizedAccessException', 'UnhandledExceptionEventArgs', > 'UnhandledExceptionEventHandler', 'Uri', 'UriBuilder', 'UriComponents', > 'UriFormat', 'UriFormatException', 'UriHostNameType', 'UriIdnScope', > 'UriKind', 'UriParser', 'UriPartial', 'UriTypeConverter', 'ValueType', > 'Version', 'Void', 'WeakReference', 'Web', '_AppDomain', '__builtins__', > '__dict__', '__name__'] > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Sep 21 16:59:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 21 Sep 2008 15:59:34 +0100 Subject: [IronPython] Importing System in IronPython 2 beta 5 In-Reply-To: <2fd6b9d0809210747u35edfbf6h892a219268077416@mail.gmail.com> References: <18c139230809202231h56ad3481p851c4416448f4088@mail.gmail.com> <2fd6b9d0809210747u35edfbf6h892a219268077416@mail.gmail.com> Message-ID: <48D66156.6020002@voidspace.org.uk> Ronnie Maor wrote: > I get the same problem. > > Another symptom is that "import System" fails if you don't > AddReference first. never needed to do that for IPy 1.1 and don't need > to either when running ipy 2.0. > When embedding IronPython you need to add references to both 'System.dll' and 'mscorlib.dll'. This is done for you in the console, but not when embedding IronPython. You can do this using the 'LoadAssembly' method of the ScriptRuntime: _runtime.LoadAssembly(typeof(String).Assembly); _runtime.LoadAssembly(typeof(Uri).Assembly); Michael > It fails with my hosting code, and also reproduces with the "hello > world" hosting sample: > http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx > > The only changes I made to the sample were > 1) delete ruby configuration from App.config and the line of code that > builds a ruby engine (I don't have the assemblies for ruby) > 2) change the line defining the source code to: > ScriptSource source = > pyEng.CreateScriptSourceFromString(@"import System", > SourceCodeKind.Statements); > 3) remove the code that gets the "output" variable from pyEng (since > we don't produce it) > > like I said, this fails with "No module named System". > If you add a clr.AddReference("System"), then import works, but dir() > seems to only show namespaces and not types, so import System.DateTime > will fail. > > I'm now looking at sources for IronPythonConsole to see what the > difference is, but if someone knows what I'm doing wrong, please tell... > > thanks > Ronnie > > On Sun, Sep 21, 2008 at 8:31 AM, Serge R > wrote: > > I am migrating from 1.1 and have been unable to import System.Math > class. I took a look at what's actually been imported > > clr.AddReference("System") > import System > print dir(System) > > On IP2 I got a small list that didn't contain Math or many other > classes. Am I referencing something wrong? > > IP2 List: > ['CodeDom', 'Collections', 'ComponentModel', 'Configuration', > 'Diagnostics', 'FileStyleUriParser', 'FtpStyleUriParser', > 'GenericUriParser', 'GenericUriParserOptions', > 'GopherStyleUriParser', 'HttpStyleUriParser', 'IO', > 'LdapStyleUriParser', 'Media', 'Net', 'NetPipeStyleUriParser', > 'NetTcpStyleUriParser', 'NewsStyleUriParser', 'Runtime', > 'Security', 'Text', 'Threading', 'Timers', 'Uri', 'UriBuilder', > 'UriComponents', 'UriFormat', 'UriFormatException', > 'UriHostNameType', 'UriIdnScope', 'UriKind', 'UriParser', > 'UriPartial', 'UriTypeConverter', 'Web'] > > IP1 List: > ['AccessViolationException', 'Action', 'ActivationContext', > 'Activator', 'AppDomain', 'AppDomainInitializer', > 'AppDomainManager', 'AppDomainManagerInitializationOptions', > 'AppDomainSetup', 'AppDomainUnloadedException', > 'ApplicationException', 'ApplicationId', 'ApplicationIdentity', > 'ArgIterator', 'ArgumentException', 'ArgumentNullException', > 'ArgumentOutOfRangeException', 'ArithmeticException', 'Array', > 'ArraySegment', 'ArrayTypeMismatchException', > 'AssemblyLoadEventArgs', 'AssemblyLoadEventHandler', > 'AsyncCallback', 'Attribute', 'AttributeTargets', > 'AttributeUsageAttribute', 'BadImageFormatException', > 'Base64FormattingOptions', 'BitConverter', 'Boolean', 'Buffer', > 'Byte', 'CLSCompliantAttribute', 'CannotUnloadAppDomainException', > 'Char', 'CharEnumerator', 'CodeDom', 'Collections', 'Comparison', > 'ComponentModel', 'Configuration', 'Console', > 'ConsoleCancelEventArgs', 'ConsoleCancelEventHandler', > 'ConsoleColor', 'ConsoleKey', 'ConsoleKeyInfo', > 'ConsoleModifiers', 'ConsoleSpecialKey', 'ContextBoundObject', > 'ContextMarshalException', 'ContextStaticAttribute', 'Convert', > 'Converter', 'CrossAppDomainDelegate', 'DBNull', > 'DataMisalignedException', 'DateTime', 'DateTimeKind', > 'DateTimeOffset', 'DayOfWeek', 'Decimal', 'Delegate', > 'Deployment', 'Diagnostics', 'DivideByZeroException', > 'DllNotFoundException', 'Double', 'DuplicateWaitObjectException', > 'EntryPointNotFoundException', 'Enum', 'Environment', > 'EnvironmentVariableTarget', 'EventArgs', 'EventHandler', > 'Exception', 'ExecutionEngineException', 'FieldAccessException', > 'FileStyleUriParser', 'FlagsAttribute', 'FormatException', > 'FtpStyleUriParser', 'GC', 'GCCollectionMode', 'GenericUriParser', > 'GenericUriParserOptions', 'Globalization', > 'GopherStyleUriParser', 'Guid', 'HttpStyleUriParser', > 'IAppDomainSetup', 'IAsyncResult', 'ICloneable', 'IComparable', > 'IConvertible', 'ICustomFormatter', 'IDisposable', 'IEquatable', > 'IFormatProvider', 'IFormattable', 'IO', 'IServiceProvider', > 'IndexOutOfRangeException', 'InsufficientMemoryException', > 'Int16', 'Int32', 'Int64', 'IntPtr', 'InvalidCastException', > 'InvalidOperationException', 'InvalidProgramException', > 'LdapStyleUriParser', 'LoaderOptimization', > 'LoaderOptimizationAttribute', 'LocalDataStoreSlot', > 'MTAThreadAttribute', 'MarshalByRefObject', 'Math', 'Media', > 'MemberAccessException', 'MethodAccessException', > 'MidpointRounding', 'MissingFieldException', > 'MissingMemberException', 'MissingMethodException', > 'ModuleHandle', 'MulticastDelegate', > 'MulticastNotSupportedException', 'Net', 'NetPipeStyleUriParser', > 'NetTcpStyleUriParser', 'NewsStyleUriParser', > 'NonSerializedAttribute', 'NotFiniteNumberException', > 'NotImplementedException', 'NotSupportedException', > 'NullReferenceException', 'Nullable', 'Object', > 'ObjectDisposedException', 'ObsoleteAttribute', 'OperatingSystem', > 'OperationCanceledException', 'OutOfMemoryException', > 'OverflowException', 'ParamArrayAttribute', 'PlatformID', > 'PlatformNotSupportedException', 'Predicate', 'Random', > 'RankException', 'Reflection', 'ResolveEventArgs', > 'ResolveEventHandler', 'Resources', 'Runtime', > 'RuntimeArgumentHandle', 'RuntimeFieldHandle', > 'RuntimeMethodHandle', 'RuntimeTypeHandle', 'SByte', > 'STAThreadAttribute', 'Security', 'SerializableAttribute', > 'Single', 'StackOverflowException', 'String', 'StringComparer', > 'StringComparison', 'StringSplitOptions', 'SystemException', > 'Text', 'ThreadStaticAttribute', 'Threading', 'TimeSpan', > 'TimeZone', 'TimeoutException', 'Timers', 'Type', 'TypeCode', > 'TypeInitializationException', 'TypeLoadException', > 'TypeUnloadedException', 'TypedReference', 'UInt16', 'UInt32', > 'UInt64', 'UIntPtr', 'UnauthorizedAccessException', > 'UnhandledExceptionEventArgs', 'UnhandledExceptionEventHandler', > 'Uri', 'UriBuilder', 'UriComponents', 'UriFormat', > 'UriFormatException', 'UriHostNameType', 'UriIdnScope', 'UriKind', > 'UriParser', 'UriPartial', 'UriTypeConverter', 'ValueType', > 'Version', 'Void', 'WeakReference', 'Web', '_AppDomain', > '__builtins__', '__dict__', '__name__'] > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From deus.verus at gmail.com Sun Sep 21 17:23:47 2008 From: deus.verus at gmail.com (Serge R) Date: Mon, 22 Sep 2008 01:23:47 +1000 Subject: [IronPython] Importing System in IronPython 2 beta 5 In-Reply-To: <48D66156.6020002@voidspace.org.uk> References: <18c139230809202231h56ad3481p851c4416448f4088@mail.gmail.com> <2fd6b9d0809210747u35edfbf6h892a219268077416@mail.gmail.com> <48D66156.6020002@voidspace.org.uk> Message-ID: <18c139230809210823x93e9c2ds9697032d19ab0929@mail.gmail.com> Works like a charm, thank you. On 9/22/08, Michael Foord wrote: > > Ronnie Maor wrote: > >> I get the same problem. >> >> Another symptom is that "import System" fails if you don't AddReference >> first. never needed to do that for IPy 1.1 and don't need to either when >> running ipy 2.0. >> >> > When embedding IronPython you need to add references to both 'System.dll' > and 'mscorlib.dll'. This is done for you in the console, but not when > embedding IronPython. > > You can do this using the 'LoadAssembly' method of the ScriptRuntime: > > _runtime.LoadAssembly(typeof(String).Assembly); > _runtime.LoadAssembly(typeof(Uri).Assembly); > > Michael > > It fails with my hosting code, and also reproduces with the "hello world" >> hosting sample: >> >> http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx >> >> The only changes I made to the sample were >> 1) delete ruby configuration from App.config and the line of code that >> builds a ruby engine (I don't have the assemblies for ruby) >> 2) change the line defining the source code to: >> ScriptSource source = >> pyEng.CreateScriptSourceFromString(@"import System", >> SourceCodeKind.Statements); >> 3) remove the code that gets the "output" variable from pyEng (since we >> don't produce it) >> >> like I said, this fails with "No module named System". >> If you add a clr.AddReference("System"), then import works, but dir() >> seems to only show namespaces and not types, so import System.DateTime will >> fail. >> >> I'm now looking at sources for IronPythonConsole to see what the >> difference is, but if someone knows what I'm doing wrong, please tell... >> >> thanks >> Ronnie >> >> On Sun, Sep 21, 2008 at 8:31 AM, Serge R > deus.verus at gmail.com>> wrote: >> >> I am migrating from 1.1 and have been unable to import System.Math >> class. I took a look at what's actually been imported >> >> clr.AddReference("System") >> import System >> print dir(System) >> >> On IP2 I got a small list that didn't contain Math or many other >> classes. Am I referencing something wrong? >> >> IP2 List: >> ['CodeDom', 'Collections', 'ComponentModel', 'Configuration', >> 'Diagnostics', 'FileStyleUriParser', 'FtpStyleUriParser', >> 'GenericUriParser', 'GenericUriParserOptions', >> 'GopherStyleUriParser', 'HttpStyleUriParser', 'IO', >> 'LdapStyleUriParser', 'Media', 'Net', 'NetPipeStyleUriParser', >> 'NetTcpStyleUriParser', 'NewsStyleUriParser', 'Runtime', >> 'Security', 'Text', 'Threading', 'Timers', 'Uri', 'UriBuilder', >> 'UriComponents', 'UriFormat', 'UriFormatException', >> 'UriHostNameType', 'UriIdnScope', 'UriKind', 'UriParser', >> 'UriPartial', 'UriTypeConverter', 'Web'] >> >> IP1 List: >> ['AccessViolationException', 'Action', 'ActivationContext', >> 'Activator', 'AppDomain', 'AppDomainInitializer', >> 'AppDomainManager', 'AppDomainManagerInitializationOptions', >> 'AppDomainSetup', 'AppDomainUnloadedException', >> 'ApplicationException', 'ApplicationId', 'ApplicationIdentity', >> 'ArgIterator', 'ArgumentException', 'ArgumentNullException', >> 'ArgumentOutOfRangeException', 'ArithmeticException', 'Array', >> 'ArraySegment', 'ArrayTypeMismatchException', >> 'AssemblyLoadEventArgs', 'AssemblyLoadEventHandler', >> 'AsyncCallback', 'Attribute', 'AttributeTargets', >> 'AttributeUsageAttribute', 'BadImageFormatException', >> 'Base64FormattingOptions', 'BitConverter', 'Boolean', 'Buffer', >> 'Byte', 'CLSCompliantAttribute', 'CannotUnloadAppDomainException', >> 'Char', 'CharEnumerator', 'CodeDom', 'Collections', 'Comparison', >> 'ComponentModel', 'Configuration', 'Console', >> 'ConsoleCancelEventArgs', 'ConsoleCancelEventHandler', >> 'ConsoleColor', 'ConsoleKey', 'ConsoleKeyInfo', >> 'ConsoleModifiers', 'ConsoleSpecialKey', 'ContextBoundObject', >> 'ContextMarshalException', 'ContextStaticAttribute', 'Convert', >> 'Converter', 'CrossAppDomainDelegate', 'DBNull', >> 'DataMisalignedException', 'DateTime', 'DateTimeKind', >> 'DateTimeOffset', 'DayOfWeek', 'Decimal', 'Delegate', >> 'Deployment', 'Diagnostics', 'DivideByZeroException', >> 'DllNotFoundException', 'Double', 'DuplicateWaitObjectException', >> 'EntryPointNotFoundException', 'Enum', 'Environment', >> 'EnvironmentVariableTarget', 'EventArgs', 'EventHandler', >> 'Exception', 'ExecutionEngineException', 'FieldAccessException', >> 'FileStyleUriParser', 'FlagsAttribute', 'FormatException', >> 'FtpStyleUriParser', 'GC', 'GCCollectionMode', 'GenericUriParser', >> 'GenericUriParserOptions', 'Globalization', >> 'GopherStyleUriParser', 'Guid', 'HttpStyleUriParser', >> 'IAppDomainSetup', 'IAsyncResult', 'ICloneable', 'IComparable', >> 'IConvertible', 'ICustomFormatter', 'IDisposable', 'IEquatable', >> 'IFormatProvider', 'IFormattable', 'IO', 'IServiceProvider', >> 'IndexOutOfRangeException', 'InsufficientMemoryException', >> 'Int16', 'Int32', 'Int64', 'IntPtr', 'InvalidCastException', >> 'InvalidOperationException', 'InvalidProgramException', >> 'LdapStyleUriParser', 'LoaderOptimization', >> 'LoaderOptimizationAttribute', 'LocalDataStoreSlot', >> 'MTAThreadAttribute', 'MarshalByRefObject', 'Math', 'Media', >> 'MemberAccessException', 'MethodAccessException', >> 'MidpointRounding', 'MissingFieldException', >> 'MissingMemberException', 'MissingMethodException', >> 'ModuleHandle', 'MulticastDelegate', >> 'MulticastNotSupportedException', 'Net', 'NetPipeStyleUriParser', >> 'NetTcpStyleUriParser', 'NewsStyleUriParser', >> 'NonSerializedAttribute', 'NotFiniteNumberException', >> 'NotImplementedException', 'NotSupportedException', >> 'NullReferenceException', 'Nullable', 'Object', >> 'ObjectDisposedException', 'ObsoleteAttribute', 'OperatingSystem', >> 'OperationCanceledException', 'OutOfMemoryException', >> 'OverflowException', 'ParamArrayAttribute', 'PlatformID', >> 'PlatformNotSupportedException', 'Predicate', 'Random', >> 'RankException', 'Reflection', 'ResolveEventArgs', >> 'ResolveEventHandler', 'Resources', 'Runtime', >> 'RuntimeArgumentHandle', 'RuntimeFieldHandle', >> 'RuntimeMethodHandle', 'RuntimeTypeHandle', 'SByte', >> 'STAThreadAttribute', 'Security', 'SerializableAttribute', >> 'Single', 'StackOverflowException', 'String', 'StringComparer', >> 'StringComparison', 'StringSplitOptions', 'SystemException', >> 'Text', 'ThreadStaticAttribute', 'Threading', 'TimeSpan', >> 'TimeZone', 'TimeoutException', 'Timers', 'Type', 'TypeCode', >> 'TypeInitializationException', 'TypeLoadException', >> 'TypeUnloadedException', 'TypedReference', 'UInt16', 'UInt32', >> 'UInt64', 'UIntPtr', 'UnauthorizedAccessException', >> 'UnhandledExceptionEventArgs', 'UnhandledExceptionEventHandler', >> 'Uri', 'UriBuilder', 'UriComponents', 'UriFormat', >> 'UriFormatException', 'UriHostNameType', 'UriIdnScope', 'UriKind', >> 'UriParser', 'UriPartial', 'UriTypeConverter', 'ValueType', >> 'Version', 'Void', 'WeakReference', 'Web', '_AppDomain', >> '__builtins__', '__dict__', '__name__'] >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Sun Sep 21 17:54:36 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Sun, 21 Sep 2008 18:54:36 +0300 Subject: [IronPython] Importing System in IronPython 2 beta 5 In-Reply-To: <18c139230809210823x93e9c2ds9697032d19ab0929@mail.gmail.com> References: <18c139230809202231h56ad3481p851c4416448f4088@mail.gmail.com> <2fd6b9d0809210747u35edfbf6h892a219268077416@mail.gmail.com> <48D66156.6020002@voidspace.org.uk> <18c139230809210823x93e9c2ds9697032d19ab0929@mail.gmail.com> Message-ID: <2fd6b9d0809210854o6094919fw18c4a8988d611350@mail.gmail.com> thanks! On Sun, Sep 21, 2008 at 6:23 PM, Serge R wrote: > Works like a charm, thank you. > > > On 9/22/08, Michael Foord wrote: >> >> Ronnie Maor wrote: >> >>> I get the same problem. >>> >>> Another symptom is that "import System" fails if you don't AddReference >>> first. never needed to do that for IPy 1.1 and don't need to either when >>> running ipy 2.0. >>> >>> >> When embedding IronPython you need to add references to both 'System.dll' >> and 'mscorlib.dll'. This is done for you in the console, but not when >> embedding IronPython. >> >> You can do this using the 'LoadAssembly' method of the ScriptRuntime: >> >> _runtime.LoadAssembly(typeof(String).Assembly); >> _runtime.LoadAssembly(typeof(Uri).Assembly); >> >> Michael >> >> It fails with my hosting code, and also reproduces with the "hello world" >>> hosting sample: >>> >>> http://blogs.msdn.com/seshadripv/archive/2008/09/11/dlr-hosting-sample-simple-dlr-host-using-the-new-app-config-based-scriptruntime-creation.aspx >>> >>> The only changes I made to the sample were >>> 1) delete ruby configuration from App.config and the line of code that >>> builds a ruby engine (I don't have the assemblies for ruby) >>> 2) change the line defining the source code to: >>> ScriptSource source = >>> pyEng.CreateScriptSourceFromString(@"import System", >>> SourceCodeKind.Statements); >>> 3) remove the code that gets the "output" variable from pyEng (since we >>> don't produce it) >>> >>> like I said, this fails with "No module named System". >>> If you add a clr.AddReference("System"), then import works, but dir() >>> seems to only show namespaces and not types, so import System.DateTime will >>> fail. >>> >>> I'm now looking at sources for IronPythonConsole to see what the >>> difference is, but if someone knows what I'm doing wrong, please tell... >>> >>> thanks >>> Ronnie >>> >>> On Sun, Sep 21, 2008 at 8:31 AM, Serge R >> deus.verus at gmail.com>> wrote: >>> >>> I am migrating from 1.1 and have been unable to import System.Math >>> class. I took a look at what's actually been imported >>> >>> clr.AddReference("System") >>> import System >>> print dir(System) >>> >>> On IP2 I got a small list that didn't contain Math or many other >>> classes. Am I referencing something wrong? >>> >>> IP2 List: >>> ['CodeDom', 'Collections', 'ComponentModel', 'Configuration', >>> 'Diagnostics', 'FileStyleUriParser', 'FtpStyleUriParser', >>> 'GenericUriParser', 'GenericUriParserOptions', >>> 'GopherStyleUriParser', 'HttpStyleUriParser', 'IO', >>> 'LdapStyleUriParser', 'Media', 'Net', 'NetPipeStyleUriParser', >>> 'NetTcpStyleUriParser', 'NewsStyleUriParser', 'Runtime', >>> 'Security', 'Text', 'Threading', 'Timers', 'Uri', 'UriBuilder', >>> 'UriComponents', 'UriFormat', 'UriFormatException', >>> 'UriHostNameType', 'UriIdnScope', 'UriKind', 'UriParser', >>> 'UriPartial', 'UriTypeConverter', 'Web'] >>> >>> IP1 List: >>> ['AccessViolationException', 'Action', 'ActivationContext', >>> 'Activator', 'AppDomain', 'AppDomainInitializer', >>> 'AppDomainManager', 'AppDomainManagerInitializationOptions', >>> 'AppDomainSetup', 'AppDomainUnloadedException', >>> 'ApplicationException', 'ApplicationId', 'ApplicationIdentity', >>> 'ArgIterator', 'ArgumentException', 'ArgumentNullException', >>> 'ArgumentOutOfRangeException', 'ArithmeticException', 'Array', >>> 'ArraySegment', 'ArrayTypeMismatchException', >>> 'AssemblyLoadEventArgs', 'AssemblyLoadEventHandler', >>> 'AsyncCallback', 'Attribute', 'AttributeTargets', >>> 'AttributeUsageAttribute', 'BadImageFormatException', >>> 'Base64FormattingOptions', 'BitConverter', 'Boolean', 'Buffer', >>> 'Byte', 'CLSCompliantAttribute', 'CannotUnloadAppDomainException', >>> 'Char', 'CharEnumerator', 'CodeDom', 'Collections', 'Comparison', >>> 'ComponentModel', 'Configuration', 'Console', >>> 'ConsoleCancelEventArgs', 'ConsoleCancelEventHandler', >>> 'ConsoleColor', 'ConsoleKey', 'ConsoleKeyInfo', >>> 'ConsoleModifiers', 'ConsoleSpecialKey', 'ContextBoundObject', >>> 'ContextMarshalException', 'ContextStaticAttribute', 'Convert', >>> 'Converter', 'CrossAppDomainDelegate', 'DBNull', >>> 'DataMisalignedException', 'DateTime', 'DateTimeKind', >>> 'DateTimeOffset', 'DayOfWeek', 'Decimal', 'Delegate', >>> 'Deployment', 'Diagnostics', 'DivideByZeroException', >>> 'DllNotFoundException', 'Double', 'DuplicateWaitObjectException', >>> 'EntryPointNotFoundException', 'Enum', 'Environment', >>> 'EnvironmentVariableTarget', 'EventArgs', 'EventHandler', >>> 'Exception', 'ExecutionEngineException', 'FieldAccessException', >>> 'FileStyleUriParser', 'FlagsAttribute', 'FormatException', >>> 'FtpStyleUriParser', 'GC', 'GCCollectionMode', 'GenericUriParser', >>> 'GenericUriParserOptions', 'Globalization', >>> 'GopherStyleUriParser', 'Guid', 'HttpStyleUriParser', >>> 'IAppDomainSetup', 'IAsyncResult', 'ICloneable', 'IComparable', >>> 'IConvertible', 'ICustomFormatter', 'IDisposable', 'IEquatable', >>> 'IFormatProvider', 'IFormattable', 'IO', 'IServiceProvider', >>> 'IndexOutOfRangeException', 'InsufficientMemoryException', >>> 'Int16', 'Int32', 'Int64', 'IntPtr', 'InvalidCastException', >>> 'InvalidOperationException', 'InvalidProgramException', >>> 'LdapStyleUriParser', 'LoaderOptimization', >>> 'LoaderOptimizationAttribute', 'LocalDataStoreSlot', >>> 'MTAThreadAttribute', 'MarshalByRefObject', 'Math', 'Media', >>> 'MemberAccessException', 'MethodAccessException', >>> 'MidpointRounding', 'MissingFieldException', >>> 'MissingMemberException', 'MissingMethodException', >>> 'ModuleHandle', 'MulticastDelegate', >>> 'MulticastNotSupportedException', 'Net', 'NetPipeStyleUriParser', >>> 'NetTcpStyleUriParser', 'NewsStyleUriParser', >>> 'NonSerializedAttribute', 'NotFiniteNumberException', >>> 'NotImplementedException', 'NotSupportedException', >>> 'NullReferenceException', 'Nullable', 'Object', >>> 'ObjectDisposedException', 'ObsoleteAttribute', 'OperatingSystem', >>> 'OperationCanceledException', 'OutOfMemoryException', >>> 'OverflowException', 'ParamArrayAttribute', 'PlatformID', >>> 'PlatformNotSupportedException', 'Predicate', 'Random', >>> 'RankException', 'Reflection', 'ResolveEventArgs', >>> 'ResolveEventHandler', 'Resources', 'Runtime', >>> 'RuntimeArgumentHandle', 'RuntimeFieldHandle', >>> 'RuntimeMethodHandle', 'RuntimeTypeHandle', 'SByte', >>> 'STAThreadAttribute', 'Security', 'SerializableAttribute', >>> 'Single', 'StackOverflowException', 'String', 'StringComparer', >>> 'StringComparison', 'StringSplitOptions', 'SystemException', >>> 'Text', 'ThreadStaticAttribute', 'Threading', 'TimeSpan', >>> 'TimeZone', 'TimeoutException', 'Timers', 'Type', 'TypeCode', >>> 'TypeInitializationException', 'TypeLoadException', >>> 'TypeUnloadedException', 'TypedReference', 'UInt16', 'UInt32', >>> 'UInt64', 'UIntPtr', 'UnauthorizedAccessException', >>> 'UnhandledExceptionEventArgs', 'UnhandledExceptionEventHandler', >>> 'Uri', 'UriBuilder', 'UriComponents', 'UriFormat', >>> 'UriFormatException', 'UriHostNameType', 'UriIdnScope', 'UriKind', >>> 'UriParser', 'UriPartial', 'UriTypeConverter', 'ValueType', >>> 'Version', 'Void', 'WeakReference', 'Web', '_AppDomain', >>> '__builtins__', '__dict__', '__name__'] >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Sep 21 22:02:49 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 21 Sep 2008 21:02:49 +0100 Subject: [IronPython] Named Tuple and IronPython 2 In-Reply-To: <350E7D38B6D819428718949920EC2355421B4E8B51@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <48D39A8E.4030200@voidspace.org.uk> <350E7D38B6D819428718949920EC2355421B4E8B51@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48D6A869.3040207@voidspace.org.uk> Dino Viehland wrote: > Not too long ago I prototyped a frames implementation including making _getframe work - but it doesn't include locals in the frames. I guess in this case it would work just fine. > > The downside is it results in a 50% perf degrade on Pybench when calling recursive functions. But we're already really fast calling functions so maybe that's acceptable. Anyway it's something we can consider for a post-2.0 release (maybe w/ a command line option to control its presence) but I came up with the prototype too late to go adding it to 2.0. > A frames implementation with a per engine switch would be fantastic! I'm sure you can work on performance. :-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 19, 2008 5:27 AM > To: Discussion of IronPython > Subject: [IronPython] Named Tuple and IronPython 2 > > Hello all, > > At PyCon UK Raymond Hettinger showed off the Named Tuple; a very useful recipe for creating tuples with named fields. It is becoming part of the standard library in Python 2.6. > > http://code.activestate.com/recipes/500261/ > > >>> from namedtuple import namedtuple > >>> thing = namedtuple('thing', ('whizz', 'pop')) >>> thing >>> i = thing(1, 2) >>> i.whizz > 1 > >>> i.pop > 2 > >>> w, p = i > >>> w, p > (1, 2) > >>> i > thing(whizz=1, pop=2) > >>> > > I've attached a modified version that works with IronPython 2 B5 (it doesn't work with 2B4 due to a very odd bug that is now fixed). > > The only change needed was to comment out the use of 'sys._getframe' > which is there for pickle support. > > It is only conditionally used, because Jython didn't support this either > - but on Jython _getframe wasn't defined at all so the conditional check fails on IronPython: > > # Bypass this step in enviroments where > # sys._getframe is not defined (Jython for example). > if hasattr(_sys, '_getframe'): > result.__module__ = _sys._getframe(1).f_globals['__name__'] > > I'll suggest a modification to the recipe that works with IronPython. A better solution would be to implement '_getframe' of course... :-) > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at microsoft.com Sun Sep 21 23:18:21 2008 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 21 Sep 2008 14:18:21 -0700 Subject: [IronPython] Operations.GetMember in b5 In-Reply-To: <4817b6fc0809200930y1dfcb483r3d85fbb201aa8383@mail.gmail.com> References: <4817b6fc0809200930y1dfcb483r3d85fbb201aa8383@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B4E8F04@NA-EXMSG-C102.redmond.corp.microsoft.com> Thanks for reporting this - it's definitely a big regression. We switched ObjectOperations from using IOldDynamicObject to IDynamicObject and it looks like we missed a spot that needed to be changed (we need to manually insert the conversions ourselves now). For the time being you can just call the object version of GetMember and then call ConvertTo on that. I've opened a bug on CodePlex - http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18595 I've got a fix for the other regression as well so hopefully that one will be in a source update this week. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Saturday, September 20, 2008 9:30 AM To: Discussion of IronPython Subject: [IronPython] Operations.GetMember in b5 Hi, I'm noticing that GetMember cannot perform the casts it used to even two weeks ago. Is there some other function I should be using or something I should know about this? Tuples and lists of strings cannot be cast to IEnumerable anymore, python functions cannot be cast to Func<...> or Action<...> delegates anymore. I got around the strings case by wrapping the python list in List(), which indicates that internally IronPython has no difficulty converting to IEnumerable since that's what the List constructor takes. Not really sure what to do about the function casts, what's the recommended way to expose Python functions and methods to C#? GetMember> seems to explode in too many ways now with the delegate regressions for instance methods and now this. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ronnie.maor at gmail.com Mon Sep 22 15:29:57 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 22 Sep 2008 15:29:57 +0200 Subject: [IronPython] IP2b5 - error in calling bound method from C#? Message-ID: <2fd6b9d0809220629j4f78d8adlf5a826e5555e32e1@mail.gmail.com> I think this is a bug and not some silly mistake on my part... not sure exactly which flows this effects, but here is a small repro: import System.Threading def cb(state): print "CB CALLED" class Timer(object): def __init__(self,delay,interval): def _inner_cb(state): print "INNER CALLED" self._callback(None) f = self._callback # this is the problematic variant #f = cb #f = _inner_cb self.timer = System.Threading.Timer(f,None,delay,interval) def _callback(self,state): # state parameter is required as part of TimerCallback signature. ignore it. print "CALLBACK CALLED" t = Timer(1000,0) print "Sleeping..." System.Threading.Thread.CurrentThread.Join(2000) print "Woke up" ------------------ (end code) C:\IronPython\2.0\IronPython-2.0B5>ipy \data\trunk\src\Itst.Backend\tmp.py Traceback (most recent call last): File "\data\trunk\src\Itst.Backend\tmp.py", line 20, in \data\trunk\src\Itst.Backend\tmp.py File "\data\trunk\src\Itst.Backend\tmp.py", line 15, in __init__ TypeError: Value cannot be null. Parameter name: context The code works when you change f to one of the other variants (cb or _inner_cb). For now I'm going to use _inner_cb variant as a workaround so I can continue porting my code and map other issues. one note if/when comparing with IPy 1.1. The overload resolution was not as good there, so you need to change the call to Timer to: Timer_ctor = System.Threading.Timer.__new__.Overloads[(System.Threading.TimerCallback,object,int,int)] self.timer = Timer_ctor(System.Threading.Timer,f,None,delay,interval) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Mon Sep 22 15:39:03 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 22 Sep 2008 15:39:03 +0200 Subject: [IronPython] IP2b5 - error in calling bound method from C#? In-Reply-To: <2fd6b9d0809220629j4f78d8adlf5a826e5555e32e1@mail.gmail.com> References: <2fd6b9d0809220629j4f78d8adlf5a826e5555e32e1@mail.gmail.com> Message-ID: <2fd6b9d0809220639j40be0945m41df42c67941f3ca@mail.gmail.com> 2nd attempt at defining the problem: "problem assigning bound method to delegate?" that's my last try. now someone who actually has a clue needs to look at it :-) On Mon, Sep 22, 2008 at 3:29 PM, Ronnie Maor wrote: > I think this is a bug and not some silly mistake on my part... > not sure exactly which flows this effects, but here is a small repro: > > import System.Threading > > def cb(state): > print "CB CALLED" > > class Timer(object): > def __init__(self,delay,interval): > def _inner_cb(state): > print "INNER CALLED" > self._callback(None) > f = self._callback # this is the problematic variant > #f = cb > #f = _inner_cb > > self.timer = System.Threading.Timer(f,None,delay,interval) > > def _callback(self,state): # state parameter is required as part of > TimerCallback signature. ignore it. > print "CALLBACK CALLED" > > t = Timer(1000,0) > print "Sleeping..." > System.Threading.Thread.CurrentThread.Join(2000) > print "Woke up" > > ------------------ (end code) > > C:\IronPython\2.0\IronPython-2.0B5>ipy \data\trunk\src\Itst.Backend\tmp.py > Traceback (most recent call last): > File "\data\trunk\src\Itst.Backend\tmp.py", line 20, in > \data\trunk\src\Itst.Backend\tmp.py > File "\data\trunk\src\Itst.Backend\tmp.py", line 15, in __init__ > TypeError: Value cannot be null. > Parameter name: context > > The code works when you change f to one of the other variants (cb or > _inner_cb). > For now I'm going to use _inner_cb variant as a workaround so I can > continue porting my code and map other issues. > > one note if/when comparing with IPy 1.1. The overload resolution was not as > good there, so you need to change the call to Timer to: > Timer_ctor = > System.Threading.Timer.__new__.Overloads[(System.Threading.TimerCallback,object,int,int)] > self.timer = > Timer_ctor(System.Threading.Timer,f,None,delay,interval) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Mon Sep 22 16:56:59 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 22 Sep 2008 16:56:59 +0200 Subject: [IronPython] IPy2b5 - different types with same name are considered equal Message-ID: <2fd6b9d0809220756h7212a91fv1271afaaa89289a0@mail.gmail.com> class A(object): def foo(self): print "original A" orig = A() class A(object): def foo(self): print "new A" new = A() if type(orig) == type(new): print "types are equal" else: print "types are not equal" orig.foo() new.foo() -------- on CPython and IPy 1.1 the output is: types are not equal original A new A on IPy 2.0 b5: types are equal original A new A I actually run into this case when testing code that upgrades persistent pickles to newer version of the class. -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Sep 22 17:50:43 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 22 Sep 2008 08:50:43 -0700 Subject: [IronPython] IPy2b5 - different types with same name are considered equal In-Reply-To: <2fd6b9d0809220756h7212a91fv1271afaaa89289a0@mail.gmail.com> References: <2fd6b9d0809220756h7212a91fv1271afaaa89289a0@mail.gmail.com> Message-ID: A shorter repro of the same problem: class A(object): pass X = A class A(object): pass X == A If you need a temporary workaround for this, you can compare id(type(x)) instead of the type(x). On Mon, Sep 22, 2008 at 7:56 AM, Ronnie Maor wrote: > class A(object): > def foo(self): print "original A" > orig = A() > > class A(object): > def foo(self): print "new A" > new = A() > > if type(orig) == type(new): > print "types are equal" > else: > print "types are not equal" > > orig.foo() > new.foo() > > -------- > > on CPython and IPy 1.1 the output is: > types are not equal > original A > new A > > on IPy 2.0 b5: > types are equal > original A > new A > > I actually run into this case when testing code that upgrades persistent > pickles to newer version of the class. > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Sep 22 18:50:06 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 22 Sep 2008 09:50:06 -0700 Subject: [IronPython] IP2b5 - error in calling bound method from C#? In-Reply-To: <2fd6b9d0809220639j40be0945m41df42c67941f3ca@mail.gmail.com> References: <2fd6b9d0809220629j4f78d8adlf5a826e5555e32e1@mail.gmail.com> <2fd6b9d0809220639j40be0945m41df42c67941f3ca@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC2355421B4E90D1@NA-EXMSG-C102.redmond.corp.microsoft.com> FYI this is the same as bug #18345 - http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18345 We'll fix this for the RC. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor Sent: Monday, September 22, 2008 6:39 AM To: Discussion of IronPython Subject: Re: [IronPython] IP2b5 - error in calling bound method from C#? 2nd attempt at defining the problem: "problem assigning bound method to delegate?" that's my last try. now someone who actually has a clue needs to look at it :-) On Mon, Sep 22, 2008 at 3:29 PM, Ronnie Maor > wrote: I think this is a bug and not some silly mistake on my part... not sure exactly which flows this effects, but here is a small repro: import System.Threading def cb(state): print "CB CALLED" class Timer(object): def __init__(self,delay,interval): def _inner_cb(state): print "INNER CALLED" self._callback(None) f = self._callback # this is the problematic variant #f = cb #f = _inner_cb self.timer = System.Threading.Timer(f,None,delay,interval) def _callback(self,state): # state parameter is required as part of TimerCallback signature. ignore it. print "CALLBACK CALLED" t = Timer(1000,0) print "Sleeping..." System.Threading.Thread.CurrentThread.Join(2000) print "Woke up" ------------------ (end code) C:\IronPython\2.0\IronPython-2.0B5>ipy \data\trunk\src\Itst.Backend\tmp.py Traceback (most recent call last): File "\data\trunk\src\Itst.Backend\tmp.py", line 20, in \data\trunk\src\Itst.Backend\tmp.py File "\data\trunk\src\Itst.Backend\tmp.py", line 15, in __init__ TypeError: Value cannot be null. Parameter name: context The code works when you change f to one of the other variants (cb or _inner_cb). For now I'm going to use _inner_cb variant as a workaround so I can continue porting my code and map other issues. one note if/when comparing with IPy 1.1. The overload resolution was not as good there, so you need to change the call to Timer to: Timer_ctor = System.Threading.Timer.__new__.Overloads[(System.Threading.TimerCallback,object,int,int)] self.timer = Timer_ctor(System.Threading.Timer,f,None,delay,interval) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Mon Sep 22 19:27:43 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 22 Sep 2008 19:27:43 +0200 Subject: [IronPython] IPy2b5 - different types with same name are considered equal In-Reply-To: References: <2fd6b9d0809220756h7212a91fv1271afaaa89289a0@mail.gmail.com> Message-ID: <2fd6b9d0809221027x2d82b13anfbb46a84a4e38354@mail.gmail.com> sure. this issue isn't a big problem for me, so workaround should be fine until you fix it. On Mon, Sep 22, 2008 at 5:50 PM, Curt Hagenlocher wrote: > A shorter repro of the same problem: > > class A(object): pass > X = A > class A(object): pass > X == A > > If you need a temporary workaround for this, you can compare id(type(x)) > instead of the type(x). > > On Mon, Sep 22, 2008 at 7:56 AM, Ronnie Maor wrote: > >> class A(object): >> def foo(self): print "original A" >> orig = A() >> >> class A(object): >> def foo(self): print "new A" >> new = A() >> >> if type(orig) == type(new): >> print "types are equal" >> else: >> print "types are not equal" >> >> orig.foo() >> new.foo() >> >> -------- >> >> on CPython and IPy 1.1 the output is: >> types are not equal >> original A >> new A >> >> on IPy 2.0 b5: >> types are equal >> original A >> new A >> >> I actually run into this case when testing code that upgrades persistent >> pickles to newer version of the class. >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Mon Sep 22 19:38:37 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 22 Sep 2008 19:38:37 +0200 Subject: [IronPython] IP2b5 - error in calling bound method from C#? In-Reply-To: <350E7D38B6D819428718949920EC2355421B4E90D1@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <2fd6b9d0809220629j4f78d8adlf5a826e5555e32e1@mail.gmail.com> <2fd6b9d0809220639j40be0945m41df42c67941f3ca@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B4E90D1@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <2fd6b9d0809221038u17e179b2jc705533ee8f56c53@mail.gmail.com> On Mon, Sep 22, 2008 at 6:50 PM, Dino Viehland wrote: > FYI this is the same as bug #18345 - > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18345 > > ok. I'll go over active tickets so I have a better picture of what to expect We'll fix this for the RC. > great. > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Ronnie Maor > *Sent:* Monday, September 22, 2008 6:39 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IP2b5 - error in calling bound method from C#? > > > > 2nd attempt at defining the problem: > "problem assigning bound method to delegate?" > that's my last try. now someone who actually has a clue needs to look at it > :-) > > On Mon, Sep 22, 2008 at 3:29 PM, Ronnie Maor > wrote: > > I think this is a bug and not some silly mistake on my part... > not sure exactly which flows this effects, but here is a small repro: > > import System.Threading > > def cb(state): > print "CB CALLED" > > class Timer(object): > def __init__(self,delay,interval): > def _inner_cb(state): > print "INNER CALLED" > self._callback(None) > f = self._callback # this is the problematic variant > #f = cb > #f = _inner_cb > > self.timer = System.Threading.Timer(f,None,delay,interval) > > def _callback(self,state): # state parameter is required as part of > TimerCallback signature. ignore it. > print "CALLBACK CALLED" > > t = Timer(1000,0) > print "Sleeping..." > System.Threading.Thread.CurrentThread.Join(2000) > print "Woke up" > > ------------------ (end code) > > C:\IronPython\2.0\IronPython-2.0B5>ipy \data\trunk\src\Itst.Backend\tmp.py > Traceback (most recent call last): > File "\data\trunk\src\Itst.Backend\tmp.py", line 20, in > \data\trunk\src\Itst.Backend\tmp.py > File "\data\trunk\src\Itst.Backend\tmp.py", line 15, in __init__ > TypeError: Value cannot be null. > Parameter name: context > > The code works when you change f to one of the other variants (cb or > _inner_cb). > For now I'm going to use _inner_cb variant as a workaround so I can > continue porting my code and map other issues. > > one note if/when comparing with IPy 1.1. The overload resolution was not as > good there, so you need to change the call to Timer to: > Timer_ctor = > System.Threading.Timer.__new__.Overloads[(System.Threading.TimerCallback,object,int,int)] > self.timer = > Timer_ctor(System.Threading.Timer,f,None,delay,interval) > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Mon Sep 22 20:05:08 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 22 Sep 2008 13:05:08 -0500 Subject: [IronPython] Operations.GetMember in b5 In-Reply-To: <350E7D38B6D819428718949920EC2355421B4E8F04@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809200930y1dfcb483r3d85fbb201aa8383@mail.gmail.com> <350E7D38B6D819428718949920EC2355421B4E8F04@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809221105i672aeaebr6a6201ec12523199@mail.gmail.com> On Sun, Sep 21, 2008 at 4:18 PM, Dino Viehland wrote: > Thanks for reporting this - it's definitely a big regression. We switched ObjectOperations from using IOldDynamicObject to IDynamicObject and it looks like we missed a spot that needed to be changed (we need to manually insert the conversions ourselves now). For the time being you can just call the object version of GetMember and then call ConvertTo on that. Thanks, I'll do that. > > I've opened a bug on CodePlex - http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18595 > > I've got a fix for the other regression as well so hopefully that one will be in a source update this week. > Fantastic! I'll be picking up the first source drop after 18595 and 18345 have been closed. Cheers, -Dan From hernan.martinez at ecc.es Tue Sep 23 11:02:32 2008 From: hernan.martinez at ecc.es (=?iso-8859-1?Q?Hern=E1n_Mart=EDnez_Foffani?=) Date: Tue, 23 Sep 2008 11:02:32 +0200 Subject: [IronPython] Fresh IronPython installation not working. Message-ID: After a clean installation of IronPython 2.0 Beta 5, it gives the following exception just by calling the interpreter. The odd thing is that it only happens in one new PC (Spanish XP SP3, .NET Frameworks 1.0.3705, 1.1.4322, 2.0.50727, 3.0). We've been using IronPython in other similar computers without any problems. I guess it has to do with a bad configuration in that PC but I'm clueless. Any hint? Regards, -Hern?n. C:\Prueba>ipy.exe Unhandled exception: Excepci?n no controlada: System.MissingMethodException: M?todo no encontrado: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'. en Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes) en Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(String name, Type returnType, Type[] parameterTypes) en Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompil er(CompilerScope scope, String methodName, Type returnType, IList`1 paramTypes, IList`1 paramNames, Boolean closure, Boolean emitDebugSymbols, Boolean forceDynamic) en Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpre ssion lambda, Type delegateType, Boolean emitDebugSymbols, Boolean forceDynamic, MethodInfo& method) en Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T] (LambdaExpression lambda, Boolean forceDynamic, MethodInfo& method) en Microsoft.Scripting.Actions.SmallRuleSet`1.MakeTarget() en Microsoft.Scripting.Actions.SmallRuleSet`1.GetTarget() en Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) en Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet] (CallSite site, T0 arg0, T1 arg1) en IronPython.Runtime.PythonContext.InvokeOperatorWorker(CodeContext context, UnaryOperators oper, Object target, Object& result) en IronPython.Runtime.PythonContext.InvokeUnaryOperator(CodeContext context, UnaryOperators oper, Object target) en IronPython.Runtime.Operations.PythonOps.ToString(CodeContext context, Object o) en IronPython.Runtime.PythonContext.FormatPythonException(Object pythonException) en IronPython.Runtime.PythonContext.FormatException(Exception exception) en Microsoft.Scripting.Hosting.ExceptionOperations.FormatException(Exception exception) en Microsoft.Scripting.Hosting.Shell.ConsoleHost.UnhandledException(ScriptEngin e engine, Exception e) en Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() en Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() en Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute() en Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) en PythonConsoleHost.Main(String[] args) C:\Prueba> From curt at hagenlocher.org Tue Sep 23 13:21:14 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 23 Sep 2008 04:21:14 -0700 Subject: [IronPython] Fresh IronPython installation not working. In-Reply-To: References: Message-ID: This looks like you need to install .NET 2.0 Service Pack 1. On Tue, Sep 23, 2008 at 2:02 AM, Hern?n Mart?nez Foffani < hernan.martinez at ecc.es> wrote: > After a clean installation of IronPython 2.0 Beta 5, it gives the > following exception just by calling the interpreter. > The odd thing is that it only happens in one new PC (Spanish XP > SP3, .NET Frameworks 1.0.3705, 1.1.4322, 2.0.50727, 3.0). We've been > using IronPython in other similar computers without any problems. I > guess it has to do with a bad configuration in that PC but I'm clueless. > Any hint? > > Regards, > -Hern?n. > > C:\Prueba>ipy.exe > Unhandled exception: > > Excepci?n no controlada: System.MissingMethodException: M?todo no > encontrado: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, > System.Type, System.Type[], Boolean)'. > en Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(String name, Type > returnType, Type[] parameterTypes) > en Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(String > name, Type returnType, Type[] parameterTypes) > en > > Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompil > er(CompilerScope scope, String methodName, Type returnType, IList`1 > paramTypes, IList`1 paramNames, Boolean closure, Boolean emitDebugSymbols, > Boolean forceDynamic) > en > > Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpre > ssion lambda, Type delegateType, Boolean emitDebugSymbols, Boolean > forceDynamic, MethodInfo& method) > en Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T] > (LambdaExpression lambda, Boolean forceDynamic, MethodInfo& method) > en Microsoft.Scripting.Actions.SmallRuleSet`1.MakeTarget() > en Microsoft.Scripting.Actions.SmallRuleSet`1.GetTarget() > en Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > en Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet] > (CallSite site, T0 arg0, T1 arg1) > en IronPython.Runtime.PythonContext.InvokeOperatorWorker(CodeContext > context, UnaryOperators oper, Object target, Object& result) > en IronPython.Runtime.PythonContext.InvokeUnaryOperator(CodeContext > context, UnaryOperators oper, Object target) > en IronPython.Runtime.Operations.PythonOps.ToString(CodeContext context, > Object o) > en IronPython.Runtime.PythonContext.FormatPythonException(Object > pythonException) > en IronPython.Runtime.PythonContext.FormatException(Exception exception) > en > Microsoft.Scripting.Hosting.ExceptionOperations.FormatException(Exception > exception) > en > > Microsoft.Scripting.Hosting.Shell.ConsoleHost.UnhandledException(ScriptEngin > e engine, Exception e) > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute() > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) > en PythonConsoleHost.Main(String[] args) > > C:\Prueba> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vizcaynot at gmail.com Tue Sep 23 15:52:03 2008 From: vizcaynot at gmail.com (Vizcayno) Date: Tue, 23 Sep 2008 06:52:03 -0700 (PDT) Subject: [IronPython] How to convert a unicode variable to string? Message-ID: Hello: Is there a workaround to solve the next problem? .ipy IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.3053 Type "help", "copyright", "credits" or "license" for more information. >>> a="Pit?n" >>> print str(a) Traceback (most recent call last): File "", line 1, in File "mscorlib", line unknown, in GetString File "mscorlib", line unknown, in GetChars File "mscorlib", line unknown, in Fallback File "mscorlib", line unknown, in Throw UnicodeDecodeError: ('unknown', u'\xf3', 3, 4, '') >>> I python 2.5 I get: >>> a = "Pit?n" >>> print str(a) Pit?n >>> May be you will ask: why to do that? well, what I want is to convert any value a variable receives (float, unicode, int, string, etc) to a string variable. Many thanks for your time and help. Vizcayno. From hernan.martinez at ecc.es Tue Sep 23 16:24:22 2008 From: hernan.martinez at ecc.es (=?iso-8859-1?Q?Hern=E1n_Mart=EDnez_Foffani?=) Date: Tue, 23 Sep 2008 16:24:22 +0200 Subject: [IronPython] Fresh IronPython installation not working. In-Reply-To: Message-ID: > This looks like you need to install .NET 2.0 Service Pack 1. That was it. Thanks! > On Tue, Sep 23, 2008 at 2:02 AM, Hern?n Mart?nez Foffani > wrote: > > After a clean installation of IronPython 2.0 Beta 5, it gives the > following exception just by calling the interpreter. > The odd thing is that it only happens in one new PC (Spanish XP > SP3, .NET Frameworks 1.0.3705, 1.1.4322, 2.0.50727, 3.0). We've been > using IronPython in other similar computers without any problems. I > guess it has to do with a bad configuration in that PC but I'm > clueless. > Any hint? > > Regards, > -Hern?n. > > C:\Prueba>ipy.exe > Unhandled exception: > > Excepci?n no controlada: System.MissingMethodException: M?todo no > encontrado: 'Void > System.Reflection.Emit.DynamicMethod..ctor(System.String, > System.Type, System.Type[], Boolean)'. en > Microsoft.Scripting.Utils.Helpers.CreateDynamicMethod(String name, > Type > returnType, Type[] parameterTypes) > en > Microsoft.Linq.Expressions.Compiler.Snippets.CreateDynamicMethod(String > name, Type returnType, Type[] parameterTypes) > en > Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CreateDynamicLambdaCompil > er(CompilerScope scope, String methodName, Type returnType, IList`1 > paramTypes, IList`1 paramNames, Boolean closure, Boolean > emitDebugSymbols, > Boolean forceDynamic) > en > Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda(LambdaExpre > ssion lambda, Type delegateType, Boolean emitDebugSymbols, Boolean > forceDynamic, MethodInfo& method) > en > Microsoft.Linq.Expressions.Compiler.LambdaCompiler.CompileLambda[T] > (LambdaExpression lambda, Boolean forceDynamic, MethodInfo& method) > en Microsoft.Scripting.Actions.SmallRuleSet`1.MakeTarget() en > Microsoft.Scripting.Actions.SmallRuleSet`1.GetTarget() en > Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) en > Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet] > (CallSite site, T0 arg0, T1 arg1) en > IronPython.Runtime.PythonContext.InvokeOperatorWorker(CodeContext > context, UnaryOperators oper, Object target, Object& result) > en IronPython.Runtime.PythonContext.InvokeUnaryOperator(CodeContext > context, UnaryOperators oper, Object target) > en IronPython.Runtime.Operations.PythonOps.ToString(CodeContext > context, > Object o) > en IronPython.Runtime.PythonContext.FormatPythonException(Object > pythonException) > en IronPython.Runtime.PythonContext.FormatException(Exception > exception) en > Microsoft.Scripting.Hosting.ExceptionOperations.FormatException(Exception > exception) > en > Microsoft.Scripting.Hosting.Shell.ConsoleHost.UnhandledException(ScriptEngin > e engine, Exception e) > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute() > en Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) > en PythonConsoleHost.Main(String[] args) > > C:\Prueba> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Tue Sep 23 17:15:41 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 23 Sep 2008 08:15:41 -0700 Subject: [IronPython] How to convert a unicode variable to string? In-Reply-To: References: Message-ID: IronPython wants to treat this string as Unicode because it's got a character with the high bit set. You can actually get an equivalent result from CPython when you tell it to use Unicode: >>> a="Pit?n" >>> str(a) 'Pit\xa2n' >>> a=u"Pit?n" >>> str(a) Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 3: ordinal not in range(128) >>> (Though I can't help but notice that we may be raising the wrong type of error.) You'll probably need to special-case unicode strings and keep them as unicode instead of trying to convert them with "str" to a single-byte string. On Tue, Sep 23, 2008 at 6:52 AM, Vizcayno wrote: > Hello: > Is there a workaround to solve the next problem? > > .ipy > IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.3053 > Type "help", "copyright", "credits" or "license" for more information. > >>> a="Pit?n" > >>> print str(a) > Traceback (most recent call last): > File "", line 1, in > File "mscorlib", line unknown, in GetString > File "mscorlib", line unknown, in GetChars > File "mscorlib", line unknown, in Fallback > File "mscorlib", line unknown, in Throw > UnicodeDecodeError: ('unknown', u'\xf3', 3, 4, '') > >>> > > > I python 2.5 I get: > >>> a = "Pit?n" > >>> print str(a) > Pit?n > >>> > > May be you will ask: why to do that? well, what I want is to convert > any value a variable receives (float, unicode, int, string, etc) to a > string variable. > Many thanks for your time and help. > Vizcayno. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Tue Sep 23 17:30:53 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Tue, 23 Sep 2008 17:30:53 +0200 Subject: [IronPython] problem compiling extension methods on IPy2b5 Message-ID: <2fd6b9d0809230830x552cf058h22e65a9eb23cda41@mail.gmail.com> I have an issue with compiling extension methods. I've read the blog on this, but can't get it to work. The symptom is that when I have an extension method in my project, I get the following error: Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' If it isn't a trivial mistake with an obvious solution, then let me know what other information I should give to help diagnose this some things that might be relevant: my project targets .NET 3.5 my references from proj file: 3.5 thanks Ronnie -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Tue Sep 23 18:04:02 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 23 Sep 2008 09:04:02 -0700 Subject: [IronPython] problem compiling extension methods on IPy2b5 In-Reply-To: <2fd6b9d0809230830x552cf058h22e65a9eb23cda41@mail.gmail.com> References: <2fd6b9d0809230830x552cf058h22e65a9eb23cda41@mail.gmail.com> Message-ID: Ouch. For now, you can work around this problem by adding an ExtensionAttribute class to your own source. The code would look like this: using System; namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] sealed class ExtensionAttribute : Attribute { } } On Tue, Sep 23, 2008 at 8:30 AM, Ronnie Maor wrote: > I have an issue with compiling extension methods. I've read the blog > on > this, but can't get it to work. > > The symptom is that when I have an extension method in my project, I get > the following error: > Missing compiler required member > 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' > > If it isn't a trivial mistake with an obvious solution, then let me know > what other information I should give to help diagnose this > some things that might be relevant: > > my project targets .NET 3.5 > > my references from proj file: > > > > > > > > 3.5 > > > thanks > Ronnie > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vizcaynot at gmail.com Tue Sep 23 18:59:27 2008 From: vizcaynot at gmail.com (Vizcayno) Date: Tue, 23 Sep 2008 09:59:27 -0700 (PDT) Subject: [IronPython] How to convert a unicode variable to string? In-Reply-To: References: Message-ID: Curt: Thanks for your answer and guidelines. As I do not know what value will my variable receive from cells of an excel file (int, double, strings with accute spanish characters, etc.) I will use the try ... except. My very best regards. Vizcayno. On 23 sep, 11:15, "Curt Hagenlocher" wrote: > IronPython wants to treat this string as Unicode because it's got a > character with the high bit set. ?You can actually get an equivalent result > from CPython when you tell it to use Unicode: > > >>> a="Pit?n" > >>> str(a) > 'Pit\xa2n' > >>> a=u"Pit?n" > >>> str(a) > > Traceback (most recent call last): > ? File "", line 1, in > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position > 3: ordinal not in range(128) > > > > (Though I can't help but notice that we may be raising the wrong type of > error.) > > You'll probably need to special-case unicode strings and keep them as > unicode instead of trying to convert them with "str" to a single-byte > string. > > > > On Tue, Sep 23, 2008 at 6:52 AM, Vizcayno wrote: > > Hello: > > Is there a workaround to solve the next problem? > > > .ipy > > IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.3053 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> a="Pit?n" > > >>> print str(a) > > Traceback (most recent call last): > > ?File "", line 1, in > > ?File "mscorlib", line unknown, in GetString > > ?File "mscorlib", line unknown, in GetChars > > ?File "mscorlib", line unknown, in Fallback > > ?File "mscorlib", line unknown, in Throw > > UnicodeDecodeError: ('unknown', u'\xf3', 3, 4, '') > > > I python 2.5 I get: > > >>> a = "Pit?n" > > >>> print str(a) > > Pit?n > > > May be you will ask: why to do that? well, ?what I want is to convert > > any value a variable receives (float, unicode, int, string, etc) to a > > string variable. > > Many thanks for your time and help. > > Vizcayno. > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- Ocultar texto de la cita - > > - Mostrar texto de la cita - From curt at hagenlocher.org Tue Sep 23 19:03:00 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 23 Sep 2008 10:03:00 -0700 Subject: [IronPython] How to convert a unicode variable to string? In-Reply-To: References: Message-ID: You can check for the unicode type by saying "if type(a) == type(u'')". This will work under both CPython and IronPython. On Tue, Sep 23, 2008 at 9:59 AM, Vizcayno wrote: > Curt: > Thanks for your answer and guidelines. As I do not know what value > will my variable receive from cells of an excel file (int, double, > strings with accute spanish characters, etc.) I will use the try ... > except. > My very best regards. > Vizcayno. > > > > > On 23 sep, 11:15, "Curt Hagenlocher" wrote: > > IronPython wants to treat this string as Unicode because it's got a > > character with the high bit set. You can actually get an equivalent > result > > from CPython when you tell it to use Unicode: > > > > >>> a="Pit?n" > > >>> str(a) > > 'Pit\xa2n' > > >>> a=u"Pit?n" > > >>> str(a) > > > > Traceback (most recent call last): > > File "", line 1, in > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in > position > > 3: ordinal not in range(128) > > > > > > > > (Though I can't help but notice that we may be raising the wrong type of > > error.) > > > > You'll probably need to special-case unicode strings and keep them as > > unicode instead of trying to convert them with "str" to a single-byte > > string. > > > > > > > > On Tue, Sep 23, 2008 at 6:52 AM, Vizcayno wrote: > > > Hello: > > > Is there a workaround to solve the next problem? > > > > > .ipy > > > IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.3053 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>> a="Pit?n" > > > >>> print str(a) > > > Traceback (most recent call last): > > > File "", line 1, in > > > File "mscorlib", line unknown, in GetString > > > File "mscorlib", line unknown, in GetChars > > > File "mscorlib", line unknown, in Fallback > > > File "mscorlib", line unknown, in Throw > > > UnicodeDecodeError: ('unknown', u'\xf3', 3, 4, '') > > > > > I python 2.5 I get: > > > >>> a = "Pit?n" > > > >>> print str(a) > > > Pit?n > > > > > May be you will ask: why to do that? well, what I want is to convert > > > any value a variable receives (float, unicode, int, string, etc) to a > > > string variable. > > > Many thanks for your time and help. > > > Vizcayno. > > > _______________________________________________ > > > Users mailing list > > > Us... at lists.ironpython.com > > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.comhttp:// > lists.ironpython.com/listinfo.cgi/users-ironpython.com- Ocultar texto de > la cita - > > > > - Mostrar texto de la cita - > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dealy663 at hotmail.com Tue Sep 23 21:07:01 2008 From: dealy663 at hotmail.com (Derek Ealy) Date: Tue, 23 Sep 2008 12:07:01 -0700 Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! Message-ID: Hi I'm pretty new to this whole IronPython thing and have a problem that's been hanging me up for a couple of days now. I have a fairly large C# application, and we've recently added IronPython to the mix so we can support dynamic scripting at runtime. Users are able to create Python scripts which can manipulate the C# objects in our main application. The problem that I'm having is when I try to pass a C# object to a method on another C# object from within the Python script. It is throwing an ArgumentTypeException: expected Entry got Entry. This is especially confusing, because it sure looks like the exception is saying that an Entry object was expected, and that indeed an Entry object is what it got. Here is an example of what I'm trying to do: // C# code PythonEngine py = new PythonEngine(); string init = "import clr\n" + "clr.AddReference(\"TritonConfiguration.dll\")\n" + "import TritonConfiguration.ValidationReport as ValidationReport\n" + "import TritonConfiguration.Entry as Entry"; py.Execute(init); Entry entry = new Entry(); entry.PrimaryKey.SetValue("Fred"); Rule rule = new Rule(); rule.Name = "testRule"; py.Globals[?entry?] = entry; py.Globals["rule"] = rule; string pyLogic = "if entry.PrimaryKey.Value != 'Barney':\n" + " failure = ValidationReport.RuleFailure('PK is not Barney')\n" + " failure.ruleName = rule.Name\n" + " failure.failedEntry = entry\n"; py.Execute(pyLogic); It is the last line in the pyLogic string that causes the ArgumentTypeException. The failedEntry property of the RuleFailure object is of type Entry. I'm not sure if there is a problem with the way I'm importing things from TritonConfiguration.dll, or the assigning and usage of global variables in Python, or if there's some other thing wrong that I'm completely unaware of. Any suggestions would be greatly appreciated. ------------------------- Derek Blogging at: http://derekealy.com/WordPress _________________________________________________________________ See how Windows Mobile brings your life together?at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ From dinov at microsoft.com Tue Sep 23 21:26:55 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 23 Sep 2008 12:26:55 -0700 Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! In-Reply-To: References: Message-ID: <350E7D38B6D819428718949920EC2355421B5A07E4@NA-EXMSG-C102.redmond.corp.microsoft.com> This is probably due to a loader context issue. Effectively what's happening is your clr.AddReference() from your Python script is probably ultimately doing a LoadFile (putting the assembly into a special context) and otherwise your assembly is getting loaded normally - so you end up w/ two copies of the same assembly loaded but w/ different contexts. This is much easier to do from 2.0 where you can just call ScriptRuntime.LoadAssembly and pass it in your assembly object (e.g. typeof(Entry).Assembly). It looks like you're using 1.0 though... What might be easiest these is to right a small piece of Python code which does: import clr clr.AddReference(myAssembly) where myAssembly is a global that points to typeof(Entry).Assembly. Alternately if your assembly has a strong name (maybe it needs to be in the GAC as well?) you could do clr.AddReference() with the fully qualified strong name. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Derek Ealy Sent: Tuesday, September 23, 2008 12:07 PM To: users at lists.ironpython.com Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! Hi I'm pretty new to this whole IronPython thing and have a problem that's been hanging me up for a couple of days now. I have a fairly large C# application, and we've recently added IronPython to the mix so we can support dynamic scripting at runtime. Users are able to create Python scripts which can manipulate the C# objects in our main application. The problem that I'm having is when I try to pass a C# object to a method on another C# object from within the Python script. It is throwing an ArgumentTypeException: expected Entry got Entry. This is especially confusing, because it sure looks like the exception is saying that an Entry object was expected, and that indeed an Entry object is what it got. Here is an example of what I'm trying to do: // C# code PythonEngine py = new PythonEngine(); string init = "import clr\n" + "clr.AddReference(\"TritonConfiguration.dll\")\n" + "import TritonConfiguration.ValidationReport as ValidationReport\n" + "import TritonConfiguration.Entry as Entry"; py.Execute(init); Entry entry = new Entry(); entry.PrimaryKey.SetValue("Fred"); Rule rule = new Rule(); rule.Name = "testRule"; py.Globals["entry"] = entry; py.Globals["rule"] = rule; string pyLogic = "if entry.PrimaryKey.Value != 'Barney':\n" + " failure = ValidationReport.RuleFailure('PK is not Barney')\n" + " failure.ruleName = rule.Name\n" + " failure.failedEntry = entry\n"; py.Execute(pyLogic); It is the last line in the pyLogic string that causes the ArgumentTypeException. The failedEntry property of the RuleFailure object is of type Entry. I'm not sure if there is a problem with the way I'm importing things from TritonConfiguration.dll, or the assigning and usage of global variables in Python, or if there's some other thing wrong that I'm completely unaware of. Any suggestions would be greatly appreciated. ------------------------- Derek Blogging at: http://derekealy.com/WordPress _________________________________________________________________ See how Windows Mobile brings your life together-at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dealy663 at hotmail.com Tue Sep 23 22:30:04 2008 From: dealy663 at hotmail.com (Derek Ealy) Date: Tue, 23 Sep 2008 13:30:04 -0700 Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! In-Reply-To: <350E7D38B6D819428718949920EC2355421B5A07E4@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <350E7D38B6D819428718949920EC2355421B5A07E4@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: Man, that worked! I've been really bummed about not figuring this out for the past day or so. Thanks a lot for the tip!!!!!! Derek -------------------------Derek Blogging at: ---------------------------------------- > From: dinov at microsoft.com > To: users at lists.ironpython.com > Date: Tue, 23 Sep 2008 12:26:55 -0700 > Subject: Re: [IronPython] ArgumentTypeException when accessing C# objects, need help! > > This is probably due to a loader context issue. Effectively what's happening is your clr.AddReference() from your Python script is probably ultimately doing a LoadFile (putting the assembly into a special context) and otherwise your assembly is getting loaded normally - so you end up w/ two copies of the same assembly loaded but w/ different contexts. > > This is much easier to do from 2.0 where you can just call ScriptRuntime.LoadAssembly and pass it in your assembly object (e.g. typeof(Entry).Assembly). It looks like you're using 1.0 though... What might be easiest these is to right a small piece of Python code which does: > > import clr > clr.AddReference(myAssembly) > > where myAssembly is a global that points to typeof(Entry).Assembly. > > Alternately if your assembly has a strong name (maybe it needs to be in the GAC as well?) you could do clr.AddReference() with the fully qualified strong name. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Derek Ealy > Sent: Tuesday, September 23, 2008 12:07 PM > To: users at lists.ironpython.com > Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! > > > Hi > > I'm pretty new to this whole IronPython thing and have a problem that's been hanging me up for a couple of days now. I have a fairly large C# application, and we've recently added IronPython to the mix so we can support dynamic scripting at runtime. > > Users are able to create Python scripts which can manipulate the C# objects in our main application. The problem that I'm having is when I try to pass a C# object to a method on another C# object from within the Python script. It is throwing an ArgumentTypeException: expected Entry got Entry. This is especially confusing, because it sure looks like the exception is saying that an Entry object was expected, and that indeed an Entry object is what it got. > > Here is an example of what I'm trying to do: > > // C# code > > PythonEngine py = new PythonEngine(); > > string init = "import clr\n" + > "clr.AddReference(\"TritonConfiguration.dll\")\n" + > "import TritonConfiguration.ValidationReport as ValidationReport\n" + > "import TritonConfiguration.Entry as Entry"; > > py.Execute(init); > > Entry entry = new Entry(); > entry.PrimaryKey.SetValue("Fred"); > Rule rule = new Rule(); > rule.Name = "testRule"; > py.Globals["entry"] = entry; > py.Globals["rule"] = rule; > > string pyLogic = "if entry.PrimaryKey.Value != 'Barney':\n" + > " failure = ValidationReport.RuleFailure('PK is not Barney')\n" + > " failure.ruleName = rule.Name\n" + > " failure.failedEntry = entry\n"; > > py.Execute(pyLogic); > > > > It is the last line in the pyLogic string that causes the ArgumentTypeException. The failedEntry property of the RuleFailure object is of type Entry. I'm not sure if there is a problem with the way I'm importing things from TritonConfiguration.dll, or the assigning and usage of global variables in Python, or if there's some other thing wrong that I'm completely unaware of. > > Any suggestions would be greatly appreciated. > > > ------------------------- > Derek > > Blogging at: http://derekealy.com/WordPress > > _________________________________________________________________ > See how Windows Mobile brings your life together-at home, work, or on the go. > http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _________________________________________________________________ See how Windows Mobile brings your life together?at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ From dinov at microsoft.com Tue Sep 23 22:35:30 2008 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 23 Sep 2008 13:35:30 -0700 Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! In-Reply-To: References: <350E7D38B6D819428718949920EC2355421B5A07E4@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC2355421B5A086F@NA-EXMSG-C102.redmond.corp.microsoft.com> Yeah, unfortunately with the bad error message it's really one of those things you need to have run into at some point. :( -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Derek Ealy Sent: Tuesday, September 23, 2008 1:30 PM To: Discussion of IronPython Subject: Re: [IronPython] ArgumentTypeException when accessing C# objects, need help! Man, that worked! I've been really bummed about not figuring this out for the past day or so. Thanks a lot for the tip!!!!!! Derek -------------------------Derek Blogging at: ---------------------------------------- > From: dinov at microsoft.com > To: users at lists.ironpython.com > Date: Tue, 23 Sep 2008 12:26:55 -0700 > Subject: Re: [IronPython] ArgumentTypeException when accessing C# objects, need help! > > This is probably due to a loader context issue. Effectively what's happening is your clr.AddReference() from your Python script is probably ultimately doing a LoadFile (putting the assembly into a special context) and otherwise your assembly is getting loaded normally - so you end up w/ two copies of the same assembly loaded but w/ different contexts. > > This is much easier to do from 2.0 where you can just call ScriptRuntime.LoadAssembly and pass it in your assembly object (e.g. typeof(Entry).Assembly). It looks like you're using 1.0 though... What might be easiest these is to right a small piece of Python code which does: > > import clr > clr.AddReference(myAssembly) > > where myAssembly is a global that points to typeof(Entry).Assembly. > > Alternately if your assembly has a strong name (maybe it needs to be in the GAC as well?) you could do clr.AddReference() with the fully qualified strong name. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Derek Ealy > Sent: Tuesday, September 23, 2008 12:07 PM > To: users at lists.ironpython.com > Subject: [IronPython] ArgumentTypeException when accessing C# objects, need help! > > > Hi > > I'm pretty new to this whole IronPython thing and have a problem that's been hanging me up for a couple of days now. I have a fairly large C# application, and we've recently added IronPython to the mix so we can support dynamic scripting at runtime. > > Users are able to create Python scripts which can manipulate the C# objects in our main application. The problem that I'm having is when I try to pass a C# object to a method on another C# object from within the Python script. It is throwing an ArgumentTypeException: expected Entry got Entry. This is especially confusing, because it sure looks like the exception is saying that an Entry object was expected, and that indeed an Entry object is what it got. > > Here is an example of what I'm trying to do: > > // C# code > > PythonEngine py = new PythonEngine(); > > string init = "import clr\n" + > "clr.AddReference(\"TritonConfiguration.dll\")\n" + > "import TritonConfiguration.ValidationReport as ValidationReport\n" + > "import TritonConfiguration.Entry as Entry"; > > py.Execute(init); > > Entry entry = new Entry(); > entry.PrimaryKey.SetValue("Fred"); > Rule rule = new Rule(); > rule.Name = "testRule"; > py.Globals["entry"] = entry; > py.Globals["rule"] = rule; > > string pyLogic = "if entry.PrimaryKey.Value != 'Barney':\n" + > " failure = ValidationReport.RuleFailure('PK is not Barney')\n" + > " failure.ruleName = rule.Name\n" + > " failure.failedEntry = entry\n"; > > py.Execute(pyLogic); > > > > It is the last line in the pyLogic string that causes the ArgumentTypeException. The failedEntry property of the RuleFailure object is of type Entry. I'm not sure if there is a problem with the way I'm importing things from TritonConfiguration.dll, or the assigning and usage of global variables in Python, or if there's some other thing wrong that I'm completely unaware of. > > Any suggestions would be greatly appreciated. > > > ------------------------- > Derek > > Blogging at: http://derekealy.com/WordPress > > _________________________________________________________________ > See how Windows Mobile brings your life together-at home, work, or on the go. > http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _________________________________________________________________ See how Windows Mobile brings your life together-at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ronnie.maor at gmail.com Tue Sep 23 22:58:25 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Tue, 23 Sep 2008 23:58:25 +0300 Subject: [IronPython] problem compiling extension methods on IPy2b5 In-Reply-To: References: <2fd6b9d0809230830x552cf058h22e65a9eb23cda41@mail.gmail.com> Message-ID: <2fd6b9d0809231358t65052bb4xfd568b8d6da453d0@mail.gmail.com> well, workaround seems to work, so I'm happily stumbling along my way again :-) thanks. do you know when/how you're going to fix this? is it possible to provide two different sets of code - one targeting .net 2.0 and one for 3.5? On Tue, Sep 23, 2008 at 7:04 PM, Curt Hagenlocher wrote: > Ouch. > For now, you can work around this problem by adding an ExtensionAttribute > class to your own source. The code would look like this: > > using System; > namespace System.Runtime.CompilerServices { > [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | > AttributeTargets.Assembly)] > sealed class ExtensionAttribute : Attribute { } > } > > On Tue, Sep 23, 2008 at 8:30 AM, Ronnie Maor wrote: > >> I have an issue with compiling extension methods. I've read the blog >> on >> this, but can't get it to work. >> >> The symptom is that when I have an extension method in my project, I get >> the following error: >> Missing compiler required member >> 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' >> >> If it isn't a trivial mistake with an obvious solution, then let me know >> what other information I should give to help diagnose this >> some things that might be relevant: >> >> my project targets .NET 3.5 >> >> my references from proj file: >> >> >> >> >> >> >> >> 3.5 >> >> >> thanks >> Ronnie >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Tue Sep 23 23:03:19 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 23 Sep 2008 14:03:19 -0700 Subject: [IronPython] problem compiling extension methods on IPy2b5 In-Reply-To: <2fd6b9d0809231358t65052bb4xfd568b8d6da453d0@mail.gmail.com> References: <2fd6b9d0809230830x552cf058h22e65a9eb23cda41@mail.gmail.com> <2fd6b9d0809231358t65052bb4xfd568b8d6da453d0@mail.gmail.com> Message-ID: We'd really rather not have two sets of assemblies if we can help it, as it's likely to add confusion. Is there a particular reason you like that solution versus some other potential solution that we haven't invented yet? ;) On Tue, Sep 23, 2008 at 1:58 PM, Ronnie Maor wrote: > well, workaround seems to work, so I'm happily stumbling along my way again > :-) > thanks. > > do you know when/how you're going to fix this? > is it possible to provide two different sets of code - one targeting .net > 2.0 and one for 3.5? > > > On Tue, Sep 23, 2008 at 7:04 PM, Curt Hagenlocher wrote: > >> Ouch. >> For now, you can work around this problem by adding an ExtensionAttribute >> class to your own source. The code would look like this: >> >> using System; >> namespace System.Runtime.CompilerServices { >> [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | >> AttributeTargets.Assembly)] >> sealed class ExtensionAttribute : Attribute { } >> } >> >> On Tue, Sep 23, 2008 at 8:30 AM, Ronnie Maor wrote: >> >>> I have an issue with compiling extension methods. I've read the blog >>> on >>> this, but can't get it to work. >>> >>> The symptom is that when I have an extension method in my project, I get >>> the following error: >>> Missing compiler required member >>> 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' >>> >>> If it isn't a trivial mistake with an obvious solution, then let me know >>> what other information I should give to help diagnose this >>> some things that might be relevant: >>> >>> my project targets .NET 3.5 >>> >>> my references from proj file: >>> >>> >>> >>> >>> >>> >>> >>> 3.5 >>> >>> >>> thanks >>> Ronnie >>> >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Tue Sep 23 23:39:26 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Wed, 24 Sep 2008 00:39:26 +0300 Subject: [IronPython] problem compiling extension methods on IPy2b5 In-Reply-To: References: <2fd6b9d0809230830x552cf058h22e65a9eb23cda41@mail.gmail.com> <2fd6b9d0809231358t65052bb4xfd568b8d6da453d0@mail.gmail.com> Message-ID: <2fd6b9d0809231439x71c380edw4f1096462c1ab745@mail.gmail.com> LOL! On Wed, Sep 24, 2008 at 12:03 AM, Curt Hagenlocher wrote: > We'd really rather not have two sets of assemblies if we can help it, as > it's likely to add confusion. Is there a particular reason you like that > solution versus some other potential solution that we haven't invented yet? > ;) > > > On Tue, Sep 23, 2008 at 1:58 PM, Ronnie Maor wrote: > >> well, workaround seems to work, so I'm happily stumbling along my way >> again :-) >> thanks. >> >> do you know when/how you're going to fix this? >> is it possible to provide two different sets of code - one targeting .net >> 2.0 and one for 3.5? >> >> >> On Tue, Sep 23, 2008 at 7:04 PM, Curt Hagenlocher wrote: >> >>> Ouch. >>> For now, you can work around this problem by adding an ExtensionAttribute >>> class to your own source. The code would look like this: >>> >>> using System; >>> namespace System.Runtime.CompilerServices { >>> [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | >>> AttributeTargets.Assembly)] >>> sealed class ExtensionAttribute : Attribute { } >>> } >>> >>> On Tue, Sep 23, 2008 at 8:30 AM, Ronnie Maor wrote: >>> >>>> I have an issue with compiling extension methods. I've read the blog >>>> on >>>> this, but can't get it to work. >>>> >>>> The symptom is that when I have an extension method in my project, I get >>>> the following error: >>>> Missing compiler required member >>>> 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' >>>> >>>> If it isn't a trivial mistake with an obvious solution, then let me know >>>> what other information I should give to help diagnose this >>>> some things that might be relevant: >>>> >>>> my project targets .NET 3.5 >>>> >>>> my references from proj file: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> 3.5 >>>> >>>> >>>> thanks >>>> Ronnie >>>> >>>> >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Sep 23 23:55:11 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 23 Sep 2008 22:55:11 +0100 Subject: [IronPython] How to convert a unicode variable to string? In-Reply-To: References: Message-ID: <48D965BF.1060800@voidspace.org.uk> Curt Hagenlocher wrote: > You can check for the unicode type by saying "if type(a) == > type(u'')". This will work under both CPython and IronPython. Or for checking for strings in general: isinstance(a, basestring) Michael > > On Tue, Sep 23, 2008 at 9:59 AM, Vizcayno > wrote: > > Curt: > Thanks for your answer and guidelines. As I do not know what value > will my variable receive from cells of an excel file (int, double, > strings with accute spanish characters, etc.) I will use the try ... > except. > My very best regards. > Vizcayno. > > > > > On 23 sep, 11:15, "Curt Hagenlocher" > wrote: > > IronPython wants to treat this string as Unicode because it's got a > > character with the high bit set. You can actually get an > equivalent result > > from CPython when you tell it to use Unicode: > > > > >>> a="Pit?n" > > >>> str(a) > > 'Pit\xa2n' > > >>> a=u"Pit?n" > > >>> str(a) > > > > Traceback (most recent call last): > > File "", line 1, in > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' > in position > > 3: ordinal not in range(128) > > > > > > > > (Though I can't help but notice that we may be raising the wrong > type of > > error.) > > > > You'll probably need to special-case unicode strings and keep > them as > > unicode instead of trying to convert them with "str" to a > single-byte > > string. > > > > > > > > On Tue, Sep 23, 2008 at 6:52 AM, Vizcayno > wrote: > > > Hello: > > > Is there a workaround to solve the next problem? > > > > > .ipy > > > IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.3053 > > > Type "help", "copyright", "credits" or "license" for more > information. > > > >>> a="Pit?n" > > > >>> print str(a) > > > Traceback (most recent call last): > > > File "", line 1, in > > > File "mscorlib", line unknown, in GetString > > > File "mscorlib", line unknown, in GetChars > > > File "mscorlib", line unknown, in Fallback > > > File "mscorlib", line unknown, in Throw > > > UnicodeDecodeError: ('unknown', u'\xf3', 3, 4, '') > > > > > I python 2.5 I get: > > > >>> a = "Pit?n" > > > >>> print str(a) > > > Pit?n > > > > > May be you will ask: why to do that? well, what I want is to > convert > > > any value a variable receives (float, unicode, int, string, > etc) to a > > > string variable. > > > Many thanks for your time and help. > > > Vizcayno. > > > _______________________________________________ > > > Users mailing list > > > Us... at lists.ironpython.com > > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > _______________________________________________ > > Users mailing list > > > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- > > Ocultar texto de la cita - > > > > - Mostrar texto de la cita - > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Wed Sep 24 03:41:56 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 23 Sep 2008 18:41:56 -0700 Subject: [IronPython] ASP.NET Dynamic Language Support Refreshed! Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489ECD4F0E@NA-EXMSG-C116.redmond.corp.microsoft.com> http://blog.jimmy.schementi.com/2008/09/aspnet-dynamic-language-support.html Today, the IronPython and ASP.NET teams released ASP.NET Dynamic Language Support on the ASP.NET Codeplex site! Download it here: http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=17613 The release contains: * ironpython-webforms-sample.zip: running IronPython ASP.NET website. Either dump this in IIS or open with Visual Studio as a website project. * ironpython-mvc-sample.zip: and IronPython ASP.NET MVC website, so you can get a feel for how dynamic languages can integrate into MVC. However, this just shows IronPython working in Views, not Controllers or Models yet. This requires MVC to be installed to open the project in Visual Studio. Open it with Visual Studio, build, and run your shiny IronPython ASP.NET MVC app. * aspnet-dlr-docs.zip: Documentation on how to use all this stuff. Open intro.html and have fun. :) More information from Phil Haack's post: http://haacked.com/archive/2008/09/23/refreshing-asp.net-dynamic-language-support.aspx This build of IronPython is between Beta4 and Beta5; in the future the ASP.NET support will be released in sync with IronPython releases. ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Wed Sep 24 10:47:55 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Wed, 24 Sep 2008 10:47:55 +0200 Subject: [IronPython] ASP.NET Dynamic Language Support Refreshed! In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489ECD4F0E@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A328489ECD4F0E@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <8cd017b80809240147w1720b877qb7c0d2e59c8f7665@mail.gmail.com> What ? No more Microsoft.Scripting.Vestigial.dll ? :) Yay, happy day. This build still has the old System.Linq namespace in Microsoft.Scripting.Core.dll so you can't mix and match your IronPython and C# 3.0 code behind pages yet. Dody G. On Wed, Sep 24, 2008 at 3:41 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > > http://blog.jimmy.schementi.com/2008/09/aspnet-dynamic-language-support.html > > > > Today, the IronPython and ASP.NET teams released ASP.NET Dynamic Language > Supporton the ASP.NET > Codeplex site ! > > > > *Download it here: * > > http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=17613 > > > > *The release contains:* > > ? *ironpython-webforms-sample.zip*: running IronPython ASP.NETwebsite. Either dump this in IIS or open with Visual Studio as a website > project. > > ? *ironpython-mvc-sample.zip*: and IronPython ASP.NET MVC website, > so you can get a feel for how dynamic languages can integrate into MVC. > However, this just shows IronPython working in Views, not Controllers or > Models yet. This requires MVC to be installedto open the project in Visual Studio. Open it with Visual Studio, build, and > run your shiny IronPython ASP.NET MVC app. > > ? *aspnet-dlr-docs.zip*: Documentation on how to use all this > stuff. Open intro.html and have fun. :) > > > > More information from Phil Haack's post: > > > http://haacked.com/archive/2008/09/23/refreshing-asp.net-dynamic-language-support.aspx > > > > This build of IronPython is between Beta4 and Beta5; in the future the > ASP.NET support will be released in sync with IronPython releases. > > > > ~Jimmy > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Sep 24 22:13:41 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 24 Sep 2008 13:13:41 -0700 Subject: [IronPython] ASP.NET Dynamic Language Support Refreshed! In-Reply-To: <8cd017b80809240147w1720b877qb7c0d2e59c8f7665@mail.gmail.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A328489ECD4F0E@NA-EXMSG-C116.redmond.corp.microsoft.com> <8cd017b80809240147w1720b877qb7c0d2e59c8f7665@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EDD6B5E@NA-EXMSG-C116.redmond.corp.microsoft.com> > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata > Sent: Wednesday, September 24, 2008 1:48 AM > To: Discussion of IronPython > Subject: Re: [IronPython] ASP.NET Dynamic Language Support Refreshed! > > What ? No more Microsoft.Scripting.Vestigial.dll ? :) > > Yay, happy day. :-P Wow, I almost forgot about that! > This build still has the old System.Linq namespace in > Microsoft.Scripting.Core.dll so you can't mix and match your > IronPython and C# 3.0 code behind pages yet. Yes it does; as I said this is a build in between Beta4 and Beta5, without the transformations. When the next IronPython release comes out, this will be updated with those same bits. > Dody G. > > > On Wed, Sep 24, 2008 at 3:41 AM, Jimmy Schementi > wrote: > > > > http://blog.jimmy.schementi.com/2008/09/aspnet-dynamic-language- > support. > html > > > > Today, the IronPython and ASP.NET teams released ASP.NET Dynamic > Language Support > S > u > pport&referringTitle=Home> on the ASP.NET Codeplex site > ! > > > > Download it here: > > > http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId= > 1 > 7 > 613 > > > > The release contains: > > * ironpython-webforms-sample.zip: running IronPython > ASP.NET website. Either dump this in IIS or open with Visual Studio as > a website project. > > * ironpython-mvc-sample.zip: and IronPython ASP.NET MVC > website, so you can get a feel for how dynamic languages can integrate > into MVC. However, this just shows IronPython working in Views, not > Controllers or Models yet. This requires MVC to be installed > e > = > Home> to open the project in Visual Studio. Open it with Visual > Studio, > build, and run your shiny IronPython ASP.NET MVC app. > > * aspnet-dlr-docs.zip: Documentation on how to use all > this stuff. Open intro.html and have fun. :) > > > > More information from Phil Haack's post: > > > http://haacked.com/archive/2008/09/23/refreshing-asp.net-dynamic- > languag > e-support.aspx > > > > This build of IronPython is between Beta4 and Beta5; in the future > the ASP.NET support will be released in sync with IronPython releases. > > > > ~Jimmy > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > -- > nomadlife.org > From jdhardy at gmail.com Thu Sep 25 02:17:52 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 24 Sep 2008 18:17:52 -0600 Subject: [IronPython] Getting the full path to a file from a file object Message-ID: Hi all, WSGI has an api for sending a file directly. The api requires passing a file object, but the .NET api for sending files (HttpResponse.TransmitFile) takes the full path to the file to send. On *nix the fileno property is passed to sendfile() to get that effect. Is there any way to get the full path to the file that a file object represents? Unfortunately, there's no way to pass any extra information and still match the APIs. -Jeff From dinov at microsoft.com Thu Sep 25 02:21:47 2008 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 24 Sep 2008 17:21:47 -0700 Subject: [IronPython] Getting the full path to a file from a file object In-Reply-To: References: Message-ID: <350E7D38B6D819428718949920EC2355421B5A0FD8@NA-EXMSG-C102.redmond.corp.microsoft.com> We recently added nt._getfullpathname which could be used as long as the current working directory isn't changing. But other than that I'm not aware of one. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Wednesday, September 24, 2008 5:18 PM To: Discussion of IronPython Subject: [IronPython] Getting the full path to a file from a file object Hi all, WSGI has an api for sending a file directly. The api requires passing a file object, but the .NET api for sending files (HttpResponse.TransmitFile) takes the full path to the file to send. On *nix the fileno property is passed to sendfile() to get that effect. Is there any way to get the full path to the file that a file object represents? Unfortunately, there's no way to pass any extra information and still match the APIs. -Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Thu Sep 25 02:36:16 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 24 Sep 2008 18:36:16 -0600 Subject: [IronPython] Getting the full path to a file from a file object In-Reply-To: <350E7D38B6D819428718949920EC2355421B5A0FD8@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <350E7D38B6D819428718949920EC2355421B5A0FD8@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: Hi Dino, That looks like it will work. Thanks! -Jeff On Wed, Sep 24, 2008 at 6:21 PM, Dino Viehland wrote: > We recently added nt._getfullpathname which could be used as long as the current working directory isn't changing. But other than that I'm not aware of one. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy > Sent: Wednesday, September 24, 2008 5:18 PM > To: Discussion of IronPython > Subject: [IronPython] Getting the full path to a file from a file object > > Hi all, > WSGI has an api for sending a file directly. The api requires passing > a file object, but the .NET api for sending files > (HttpResponse.TransmitFile) takes the full path to the file to send. > On *nix the fileno property is passed to sendfile() to get that > effect. > > Is there any way to get the full path to the file that a file object > represents? Unfortunately, there's no way to pass any extra > information and still match the APIs. > > -Jeff > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fernandoacorreia at gmail.com Fri Sep 26 14:03:04 2008 From: fernandoacorreia at gmail.com (Fernando Correia) Date: Fri, 26 Sep 2008 09:03:04 -0300 Subject: [IronPython] Compiling IronPython for .NET 3.5 Message-ID: <8140eff40809260503y78a3beb6s185926f6cccbc744@mail.gmail.com> Thanks to the team for facing the heavy changes that were required to improve the compatibility of IronPython and DLR with projects that target .NET Framework 3.5. From Harry's account[1], we can see that it took a lot of smarts and guts to do. [1] http://devhawk.net/2008/09/17/DLR+Namespace+Change+Fire+Drill.aspx Since that blog post hints that it should be possible to produce a native 3.5 version of IPy and DLR that wouldn't give that warning1685, I tried to follow the instructions: > If you're willing to compile from source yourself, it's fairly easy > to build a set of binaries for a specific version .NET that doesn't > have the warning. If you're building for v3.5, you need to remove > Extension.cs from the three projects that have a copy of it > (Microsoft.Scripting.Core, Microsoft.Scripting, IronPython) and > add a reference to System.Core.dll. Well, I tried that, and I didn't find it fairly easy. My attempt was like this: 1. Open IronPython.sln 2. Remove projects Chiron, IronPythonConsole, IronPythonTest, IronPythonWindow, Microsoft.Scripting.Silverlight 3. Change all 4 remaining projects to target Framework 3.5. 4. Clean and build the solution in release mode. Get errors like: * The referenced component 'System' could not be found. * The referenced component 'mscorlib' could not be found. * The referenced component 'System.Core' could not be found. 5. Remove all references that were not found and add them again. 6. Delete these files: * IronPython\Extension.cs * Microsoft.Scripting.Core\Utils\Extension.cs * Microsoft.Scripting\Utils\Extension.cs 7. Get errors like: * Error 1 'StrongBox' is an ambiguous reference between 'System.Runtime.CompilerServices.StrongBox' and 'Microsoft.Runtime.CompilerServices.StrongBox' 8. Replace all occurrences of StrongBox with Microsoft.Runtime.CompilerServices.StrongBox. 9. Repeat for IStrongBox. 10. Get errors like: * 'Func' is an ambiguous reference between 'System.Func' and 'Microsoft.Func' 11. Replace all occurrences of Func with Microsoft.Func. 12. Again the same for 'System.Action' and 'Microsoft.Action'. 13. Now all 4 projects compile for framework 3.5. I don't feel like deploying them, though, for fear of some side-efect of all those replacements. If anyone can tell me where I made a mistake, I appreciate. Cheers! -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Sep 26 15:21:43 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 26 Sep 2008 06:21:43 -0700 Subject: [IronPython] Compiling IronPython for .NET 3.5 In-Reply-To: <8140eff40809260503y78a3beb6s185926f6cccbc744@mail.gmail.com> References: <8140eff40809260503y78a3beb6s185926f6cccbc744@mail.gmail.com> Message-ID: No, you haven't done anything wrong. I never tested those instructions when Harry asked me to proof them, and forgot that the namespace hackery that we did for InteropServices would cause a conflict if you were to link against both System.Core and Microsoft.Scripting.Core. We're currently investigating some other alternatives for getting rid of those warnings. On Fri, Sep 26, 2008 at 5:03 AM, Fernando Correia < fernandoacorreia at gmail.com> wrote: > Thanks to the team for facing the heavy changes that were required to > improve the compatibility of IronPython and DLR with projects that target > .NET Framework 3.5. From Harry's account[1], we can see that it took a lot > of smarts and guts to do. > > [1] http://devhawk.net/2008/09/17/DLR+Namespace+Change+Fire+Drill.aspx > > Since that blog post hints that it should be possible to produce a native > 3.5 version of IPy and DLR that wouldn't give that warning1685, I tried to > follow the instructions: > > > If you're willing to compile from source yourself, it's fairly easy > > to build a set of binaries for a specific version .NET that doesn't > > have the warning. If you're building for v3.5, you need to remove > > Extension.cs from the three projects that have a copy of it > > (Microsoft.Scripting.Core, Microsoft.Scripting, IronPython) and > > add a reference to System.Core.dll. > > Well, I tried that, and I didn't find it fairly easy. My attempt was like > this: > > 1. Open IronPython.sln > 2. Remove projects Chiron, IronPythonConsole, IronPythonTest, > IronPythonWindow, Microsoft.Scripting.Silverlight > 3. Change all 4 remaining projects to target Framework 3.5. > 4. Clean and build the solution in release mode. Get errors like: > * The referenced component 'System' could not be found. > * The referenced component 'mscorlib' could not be found. > * The referenced component 'System.Core' could not be found. > 5. Remove all references that were not found and add them again. > 6. Delete these files: > * IronPython\Extension.cs > * Microsoft.Scripting.Core\Utils\Extension.cs > * Microsoft.Scripting\Utils\Extension.cs > 7. Get errors like: > * Error 1 'StrongBox' is an ambiguous reference between > 'System.Runtime.CompilerServices.StrongBox' and > 'Microsoft.Runtime.CompilerServices.StrongBox' > 8. Replace all occurrences of StrongBox with > Microsoft.Runtime.CompilerServices.StrongBox. > 9. Repeat for IStrongBox. > 10. Get errors like: > * 'Func' is an ambiguous reference between > 'System.Func' and > 'Microsoft.Func' > 11. Replace all occurrences of Func with Microsoft.Func. > 12. Again the same for 'System.Action' and 'Microsoft.Action'. > 13. Now all 4 projects compile for framework 3.5. I don't feel like > deploying them, though, for fear of some side-efect of all those > replacements. > > If anyone can tell me where I made a mistake, I appreciate. > > Cheers! > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandoacorreia at gmail.com Fri Sep 26 21:00:39 2008 From: fernandoacorreia at gmail.com (Fernando Correia) Date: Fri, 26 Sep 2008 16:00:39 -0300 Subject: [IronPython] InvalidProgramException exception with NUnit Message-ID: <8140eff40809261200i3740f37dj2bd8dd7146cdb5a6@mail.gmail.com> I'm upgrading IronPython 2 from B4 to B5 and one of my unit tests is aborting with InvalidProgramException exception in Microsoft.Scripting.Actions.MatchCaller.Call6. The problem occurs if in the Python statements I try to import anything, no matter what. No import statement, no error. Also, when executed directly, without a unit test, the same code runs correctly. Is this a bug? Source code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using Microsoft.Scripting.Hosting; using Microsoft.Scripting; namespace HelloDLRWorld { [TestFixture] public class DlrTest { [Test] public void ImportTest() { ScriptRuntimeSetup srs = ScriptRuntimeSetup.ReadConfiguration(); ScriptRuntime runtime = new ScriptRuntime(srs); runtime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); runtime.LoadAssembly(typeof(System.Double).Assembly); ScriptEngine pyEng = runtime.GetEngine("IronPython"); ScriptSource source = pyEng.CreateScriptSourceFromString(@" import System.Diagnostics output='hello world from DLR/IronPython' System.Diagnostics.Debug.WriteLine(output) ", SourceCodeKind.Statements); ScriptScope scope = pyEng.CreateScope(); source.Execute(scope); object outputMsg = scope.GetVariable("output"); Assert.AreEqual("hello world from DLR/IronPython", outputMsg.ToString()); } } } Test result: ------ Test started: Assembly: HelloDLRWorld.exe ------ TestCase 'HelloDLRWorld.DlrTest.ImportTest' failed: System.InvalidProgramException : Common Language Runtime detectou um programa inv?lido. em Microsoft.Scripting.Actions.MatchCaller.Call6[T0,T1,T2,T3,T4,T5,TRet](Func`8 target, CallSite site, Object[] args) em Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) em Microsoft.Scripting.Actions.UpdateDelegates.Update6[T,T0,T1,T2,T3,T4,T5,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) em IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) em IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) em $1##1(Closure , Scope , LanguageContext ) em Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) em Microsoft.Scripting.ScriptCode.Run(Scope scope) em Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) em Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) C:\Temp\HelloDLRWorld\HelloDLRWorld\HelloDLRWorld\DlrTest.cs(28,0): em HelloDLRWorld.DlrTest.ImportTest() 0 passed, 1 failed, 0 skipped, took 6,47 seconds. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jtgalyon at gmail.com Sat Sep 27 17:54:28 2008 From: jtgalyon at gmail.com (sevenseeker) Date: Sat, 27 Sep 2008 08:54:28 -0700 (PDT) Subject: [IronPython] recommended methods for 'installing' assemblies Message-ID: I am completely new to IronPython and .NET so please bare with me. I want to add some libraries/assemblies to the python path so that I can just call clr.addReference('spam') from anywhere. What is the recommended method for achieving this? Should I extend the PYTHONPATH? Can/should I create a setup.py and install them from there? Is there a distutils and/or setuptools for IronPython? Thanks, Jason From fuzzyman at voidspace.org.uk Sat Sep 27 18:01:39 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 27 Sep 2008 17:01:39 +0100 Subject: [IronPython] recommended methods for 'installing' assemblies In-Reply-To: References: Message-ID: <48DE58E3.70202@voidspace.org.uk> sevenseeker wrote: > I am completely new to IronPython and .NET so please bare with me. > > I want to add some libraries/assemblies to the python path so that I > can just call clr.addReference('spam') from anywhere. > > What is the recommended method for achieving this? Should I extend > the PYTHONPATH? Can/should I create a setup.py and install them from > there? Is there a distutils and/or setuptools for IronPython? > The recommended method is entirely dependent on your application deployment scenario. A useful technique is to keep all your assemblies in a single directory and add this to 'sys.path' at runtime. All the best, Michael Foord > Thanks, > Jason > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From jtgalyon at gmail.com Sat Sep 27 18:07:49 2008 From: jtgalyon at gmail.com (sevenseeker) Date: Sat, 27 Sep 2008 09:07:49 -0700 (PDT) Subject: [IronPython] recommended methods for 'installing' assemblies In-Reply-To: <48DE58E3.70202@voidspace.org.uk> References: <48DE58E3.70202@voidspace.org.uk> Message-ID: <619c961f-2364-4f7e-aaf0-52857b5a3428@y38g2000hsy.googlegroups.com> simple indeed, thank you for your input Do you know if there are plans for distutils and setuptools functionality in IronPython? Those really are helpful. Thanks, Jason On Sep 27, 11:01?am, Michael Foord wrote: > sevenseeker wrote: > > I am completely new to IronPython and .NET so please bare with me. > > > I want to add some libraries/assemblies to the python path so that I > > can just call clr.addReference('spam') from anywhere. > > > What is the recommended method for achieving this? ?Should I extend > > the PYTHONPATH? ?Can/should I create a setup.py and install them from > > there? ?Is there a distutils and/or setuptools for IronPython? > > The recommended method is entirely dependent on your application > deployment scenario. > > A useful technique is to keep all your assemblies in a single directory > and add this to 'sys.path' at runtime. > > All the best, > > Michael Foord > > > Thanks, > > Jason > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.theotherdelia.co.uk/http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Sep 27 18:21:50 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 27 Sep 2008 17:21:50 +0100 Subject: [IronPython] recommended methods for 'installing' assemblies In-Reply-To: <619c961f-2364-4f7e-aaf0-52857b5a3428@y38g2000hsy.googlegroups.com> References: <48DE58E3.70202@voidspace.org.uk> <619c961f-2364-4f7e-aaf0-52857b5a3428@y38g2000hsy.googlegroups.com> Message-ID: <48DE5D9E.3070801@voidspace.org.uk> sevenseeker wrote: > simple indeed, thank you for your input > > Do you know if there are plans for distutils and setuptools > functionality in IronPython? Those really are helpful. > Have you tried distutils? If it doesn't work you can file bug reports. Michael > Thanks, > Jason > > On Sep 27, 11:01 am, Michael Foord wrote: > >> sevenseeker wrote: >> >>> I am completely new to IronPython and .NET so please bare with me. >>> >>> I want to add some libraries/assemblies to the python path so that I >>> can just call clr.addReference('spam') from anywhere. >>> >>> What is the recommended method for achieving this? Should I extend >>> the PYTHONPATH? Can/should I create a setup.py and install them from >>> there? Is there a distutils and/or setuptools for IronPython? >>> >> The recommended method is entirely dependent on your application >> deployment scenario. >> >> A useful technique is to keep all your assemblies in a single directory >> and add this to 'sys.path' at runtime. >> >> All the best, >> >> Michael Foord >> >> >>> Thanks, >>> Jason >>> _______________________________________________ >>> Users mailing list >>> Us... at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >> --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.theotherdelia.co.uk/http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From ronnie.maor at gmail.com Sun Sep 28 08:21:55 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Sun, 28 Sep 2008 09:21:55 +0300 Subject: [IronPython] IPyb5 performance Message-ID: <2fd6b9d0809272321u72097557p28b8f70d71724f11@mail.gmail.com> Hi all, I've finally managed to get my code running correctly under IPy2b5 - thanks everyone who helped! I'm now left with a performance problem. My code seems to run roughly 2 times slower: * infra tests regressed from 19 seconds in IPy 1.1.1 to 33 seconds in IPy2b5 * application level tests regressed from 375 seconds in 1.1.1 to 705 seconds in IPy2b5 (these are single measurements, but variance is not too big - about 5%) startup time is also much longer, but I can live with that. before trying to pinpoint the bottlenecks, I wanted to check I'm not missing something stupid, like turning on optimizations in the DLR... below is the hosting code I'm using to run the tests. I tried with and without "Debug" flag, and it doesn't seem to change anything (except debug allows me to understand the stack traces). I can also run the infra tests with ipy directly, which showed that -O and -OO don't help either. Is there something else I should be doing? any tips? thanks! // set up runtime and engine Dictionary runtimeOptions = new Dictionary(); runtimeOptions["Debug"] = true; ScriptRuntime runtime = IronPython.Hosting.Python.CreateRuntime(runtimeOptions); runtime.LoadAssembly(typeof(String).Assembly); // Add reference to System runtime.LoadAssembly(typeof(Uri).Assembly); // Add reference to mscorlib engine = runtime.GetEngine("Python"); .... // run file as __main__ engine.SetSearchPaths(new string[] {".", progdir, backend_dir, stdlib_dir}); List argv = new List(); argv.append(filename); for (int i = 2; i < args.Length; ++i) argv.append(args[i]); engine.GetSysModule().SetVariable("argv", argv); mainScope = engine.CreateScope(); mainScope.SetVariable("__name__", "__main__"); var main_module = Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetScope(mainScope); runtime.Globals.SetVariable("__main__", main_module); mainScope.SetVariable("__file__",filename); ScriptSource source = engine.CreateScriptSourceFromFile(filename, Encoding.Default, SourceCodeKind.Statements); source.Execute(mainScope); -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Sun Sep 28 22:32:23 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sun, 28 Sep 2008 13:32:23 -0700 Subject: [IronPython] IPyb5 performance In-Reply-To: <2fd6b9d0809272321u72097557p28b8f70d71724f11@mail.gmail.com> References: <2fd6b9d0809272321u72097557p28b8f70d71724f11@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489EDD7915@NA-EXMSG-C116.redmond.corp.microsoft.com> Make that last line call compile and see if it helps. When the Silverlight integration was written that gave a 4x speedup when using top-level functions/variables: source.Compile().Execute(mainScope); Not sure if that's the case anymore, but it's worth a try. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor Sent: Saturday, September 27, 2008 11:22 PM To: Discussion of IronPython Subject: [IronPython] IPyb5 performance Hi all, I've finally managed to get my code running correctly under IPy2b5 - thanks everyone who helped! I'm now left with a performance problem. My code seems to run roughly 2 times slower: * infra tests regressed from 19 seconds in IPy 1.1.1 to 33 seconds in IPy2b5 * application level tests regressed from 375 seconds in 1.1.1 to 705 seconds in IPy2b5 (these are single measurements, but variance is not too big - about 5%) startup time is also much longer, but I can live with that. before trying to pinpoint the bottlenecks, I wanted to check I'm not missing something stupid, like turning on optimizations in the DLR... below is the hosting code I'm using to run the tests. I tried with and without "Debug" flag, and it doesn't seem to change anything (except debug allows me to understand the stack traces). I can also run the infra tests with ipy directly, which showed that -O and -OO don't help either. Is there something else I should be doing? any tips? thanks! // set up runtime and engine Dictionary runtimeOptions = new Dictionary(); runtimeOptions["Debug"] = true; ScriptRuntime runtime = IronPython.Hosting.Python.CreateRuntime(runtimeOptions); runtime.LoadAssembly(typeof(String).Assembly); // Add reference to System runtime.LoadAssembly(typeof(Uri).Assembly); // Add reference to mscorlib engine = runtime.GetEngine("Python"); .... // run file as __main__ engine.SetSearchPaths(new string[] {".", progdir, backend_dir, stdlib_dir}); List argv = new List(); argv.append(filename); for (int i = 2; i < args.Length; ++i) argv.append(args[i]); engine.GetSysModule().SetVariable("argv", argv); mainScope = engine.CreateScope(); mainScope.SetVariable("__name__", "__main__"); var main_module = Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetScope(mainScope); runtime.Globals.SetVariable("__main__", main_module); mainScope.SetVariable("__file__",filename); ScriptSource source = engine.CreateScriptSourceFromFile(filename, Encoding.Default, SourceCodeKind.Statements); source.Execute(mainScope); -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Sep 29 01:55:30 2008 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 28 Sep 2008 16:55:30 -0700 Subject: [IronPython] IPyb5 performance In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489EDD7915@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <2fd6b9d0809272321u72097557p28b8f70d71724f11@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EDD7915@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC2355421B66A9EE@NA-EXMSG-C102.redmond.corp.microsoft.com> Also not passing a scope is probably bound to help - especially if the perf critical code is in this file and accesses lots of globals. Do .Compile, get the DefaultScope, update that w/ the vars you want set, and then just do .Execute(). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Sunday, September 28, 2008 1:32 PM To: Discussion of IronPython Subject: Re: [IronPython] IPyb5 performance Make that last line call compile and see if it helps. When the Silverlight integration was written that gave a 4x speedup when using top-level functions/variables: source.Compile().Execute(mainScope); Not sure if that's the case anymore, but it's worth a try. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor Sent: Saturday, September 27, 2008 11:22 PM To: Discussion of IronPython Subject: [IronPython] IPyb5 performance Hi all, I've finally managed to get my code running correctly under IPy2b5 - thanks everyone who helped! I'm now left with a performance problem. My code seems to run roughly 2 times slower: * infra tests regressed from 19 seconds in IPy 1.1.1 to 33 seconds in IPy2b5 * application level tests regressed from 375 seconds in 1.1.1 to 705 seconds in IPy2b5 (these are single measurements, but variance is not too big - about 5%) startup time is also much longer, but I can live with that. before trying to pinpoint the bottlenecks, I wanted to check I'm not missing something stupid, like turning on optimizations in the DLR... below is the hosting code I'm using to run the tests. I tried with and without "Debug" flag, and it doesn't seem to change anything (except debug allows me to understand the stack traces). I can also run the infra tests with ipy directly, which showed that -O and -OO don't help either. Is there something else I should be doing? any tips? thanks! // set up runtime and engine Dictionary runtimeOptions = new Dictionary(); runtimeOptions["Debug"] = true; ScriptRuntime runtime = IronPython.Hosting.Python.CreateRuntime(runtimeOptions); runtime.LoadAssembly(typeof(String).Assembly); // Add reference to System runtime.LoadAssembly(typeof(Uri).Assembly); // Add reference to mscorlib engine = runtime.GetEngine("Python"); .... // run file as __main__ engine.SetSearchPaths(new string[] {".", progdir, backend_dir, stdlib_dir}); List argv = new List(); argv.append(filename); for (int i = 2; i < args.Length; ++i) argv.append(args[i]); engine.GetSysModule().SetVariable("argv", argv); mainScope = engine.CreateScope(); mainScope.SetVariable("__name__", "__main__"); var main_module = Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetScope(mainScope); runtime.Globals.SetVariable("__main__", main_module); mainScope.SetVariable("__file__",filename); ScriptSource source = engine.CreateScriptSourceFromFile(filename, Encoding.Default, SourceCodeKind.Statements); source.Execute(mainScope); -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronnie.maor at gmail.com Mon Sep 29 09:15:46 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 29 Sep 2008 10:15:46 +0300 Subject: [IronPython] IPyb5 performance In-Reply-To: <350E7D38B6D819428718949920EC2355421B66A9EE@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <2fd6b9d0809272321u72097557p28b8f70d71724f11@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EDD7915@NA-EXMSG-C116.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421B66A9EE@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <2fd6b9d0809290015u41af0a65k5ff6cc2849d4ab9b@mail.gmail.com> thanks for the help. I tried both suggestions, but unfortunately it didn't change anything. I now use a benchmark that builds a typical setup and then checks performance of calculations in steady state: Ipy 1.1.1: total time: 80 sec. single "compute actions": 0.23 sec Ipy 2.0b5: total time: 200 sec. single "compute actions": 1.2 sec I believe the changes didn't help because most of the code is python, so the main is just the "tip of the iceberg". The main file is 64 lines and the code it launches is about 15K lines. IIUC what Dino said, the changes you proposed only affect how the 64 lines are run. The rest are compiled when they are imported (directly or indirectly by the main module) and run in their own scopes. the good and bad news is that for steady state the degradation is 600%. The good part is that maybe it's this bad because I'm using one or two flows which have a very specific and silly problem (like the **kw which you fixed already). I will try to focus the problem better once I've gotten over Rosh Hashana dinner :-) btw, the only way I found to get the default scope was through CompiledCode.DefaultScope. Expected it to be accessible directly from the engine. Is there are reason it's not? (or have I just missed it) thanks Ronnie On Mon, Sep 29, 2008 at 2:55 AM, Dino Viehland wrote: > Also not passing a scope is probably bound to help ? especially if the > perf critical code is in this file and accesses lots of globals. Do > .Compile, get the DefaultScope, update that w/ the vars you want set, and > then just do .Execute(). > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Jimmy Schementi > *Sent:* Sunday, September 28, 2008 1:32 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IPyb5 performance > > > > Make that last line call compile and see if it helps. When the Silverlight > integration was written that gave a 4x speedup when using top-level > functions/variables: > > > > source.Compile().Execute(mainScope); > > > > Not sure if that's the case anymore, but it's worth a try. > > > > ~js > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Ronnie Maor > *Sent:* Saturday, September 27, 2008 11:22 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] IPyb5 performance > > > > Hi all, > > I've finally managed to get my code running correctly under IPy2b5 - thanks > everyone who helped! > > I'm now left with a performance problem. My code seems to run roughly 2 > times slower: > * infra tests regressed from 19 seconds in IPy 1.1.1 to 33 seconds in > IPy2b5 > * application level tests regressed from 375 seconds in 1.1.1 to 705 > seconds in IPy2b5 > (these are single measurements, but variance is not too big - about 5%) > startup time is also much longer, but I can live with that. > > before trying to pinpoint the bottlenecks, I wanted to check I'm not > missing something stupid, like turning on optimizations in the DLR... > below is the hosting code I'm using to run the tests. I tried with and > without "Debug" flag, and it doesn't seem to change anything (except debug > allows me to understand the stack traces). I can also run the infra tests > with ipy directly, which showed that -O and -OO don't help either. > > Is there something else I should be doing? any tips? > thanks! > > // set up runtime and engine > Dictionary runtimeOptions = new > Dictionary(); > runtimeOptions["Debug"] = true; > ScriptRuntime runtime = > IronPython.Hosting.Python.CreateRuntime(runtimeOptions); > runtime.LoadAssembly(typeof(String).Assembly); // Add reference > to System > runtime.LoadAssembly(typeof(Uri).Assembly); // Add reference to > mscorlib > engine = runtime.GetEngine("Python"); > .... > > // run file as __main__ > engine.SetSearchPaths(new string[] {".", progdir, backend_dir, > stdlib_dir}); > > List argv = new List(); > argv.append(filename); > for (int i = 2; i < args.Length; ++i) > argv.append(args[i]); > engine.GetSysModule().SetVariable("argv", argv); > > mainScope = engine.CreateScope(); > mainScope.SetVariable("__name__", "__main__"); > var main_module = > Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetScope(mainScope); > runtime.Globals.SetVariable("__main__", main_module); > mainScope.SetVariable("__file__",filename); > > ScriptSource source = > engine.CreateScriptSourceFromFile(filename, Encoding.Default, > SourceCodeKind.Statements); > source.Execute(mainScope); > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daftspaniel at gmail.com Mon Sep 29 14:17:10 2008 From: daftspaniel at gmail.com (Davy Mitchell) Date: Mon, 29 Sep 2008 13:17:10 +0100 Subject: [IronPython] Bug in 1.1.2 with Indexer on SqlDataReader Message-ID: <20253b0c0809290517i378dae7blcacc731d0c53ffbb@mail.gmail.com> Hi Folks, Bug in 1.1.2 with Indexer on SqlDataReader - see below. Don't really need a fix for this and appears fixed in 2.0, but is there a better workaround than accessing fields by index i.e. Reader[0] etc. ? Cheers, Davy Mitchell IronPython 1.1.2 (1.1.2) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference('System.Data') >>> from System.Data.SqlClient import * >>> SqlDataReader.Item Traceback (most recent call last): File , line 0, in ##89 AttributeError: type object 'SqlDataReader' has no attribute 'Item' IronPython 2.0 Beta (2.0.0.5000) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> clr.AddReference('System.Data') >>> from System.Data.SqlClient import * >>> SqlDataReader.Item -------------- next part -------------- An HTML attachment was scrubbed... URL: From william at resolversystems.com Mon Sep 29 16:10:57 2008 From: william at resolversystems.com (William Reade) Date: Mon, 29 Sep 2008 15:10:57 +0100 Subject: [IronPython] blocker: objects deleted when they shouldn't be Message-ID: <48E0E1F1.30802@resolversystems.com> Hi all I'm about to file this on Codeplex, but I think I've tracked down a subtle and nasty bug, which is blocking Ironclad with numpy (it fatally breaks matrices and masked arrays), and I feel compelled to shout loudly about it to ensure it doesn't get lost in the noise of the impending 2.0 release. In short, the following code: ------------------------------------------------------------- from System import GC class C(object): _instance = None def __new__(cls): if C._instance is None: C._instance = object.__new__(cls) return C._instance def __del__(self): print 'deleting object with id', id(self) c = C() print 'created a C with id', id(c) d = C() print 'created another C with id', id(d) for _ in range(3): GC.Collect() GC.WaitForPendingFinalizers() print id(c), id(d) print c print d ------------------------------------------------------------- ...produces the following output: ------------------------------------------------------------- C:\dev\ironclad\build>ipy deltest.py created a C with id 43 created another C with id 43 deleting object with id 43 43 43 ------------------------------------------------------------- ...and I don't think that the 'deleting...' message should be printed at that point. My suspicion is that c's 'magic_finalization_wossname'* slot is being overwritten with a new instance after __new__ returns, leaving the original 'magic_finalization_wossname' unreferenced; in the fullness of time, that gets finalized and calls c.__del__, even though c itself still exists. Cheers William * This is probably not the actual member name, but I couldn't find the relevant code today, even though I remember reading it in the past... hopefully the implementers know what I'm trying to refer to, even if nobody else does. From dinov at microsoft.com Mon Sep 29 18:51:10 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 09:51:10 -0700 Subject: [IronPython] IPyb5 performance In-Reply-To: <2fd6b9d0809290015u41af0a65k5ff6cc2849d4ab9b@mail.gmail.com> References: <2fd6b9d0809272321u72097557p28b8f70d71724f11@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489EDD7915@NA-EXMSG-C116.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC2355421B66A9EE@NA-EXMSG-C102.redmond.corp.microsoft.com> <2fd6b9d0809290015u41af0a65k5ff6cc2849d4ab9b@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC235547877B9788@NA-EXMSG-C102.redmond.corp.microsoft.com> The default scope is the default for that particular piece of code. What we do is generate a .NET type which has a bunch of static fields in it - 1 for each global that is accessed. The compiled code then can access these directly and we wrap this all up in a Python dictionary object for late bound access. When you run against a non-default scope we have to run against a piece of code which is compiled to lookup all the globals from a real dictionary. It'll be interesting to hear what you find out what you can narrow it down to. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor Sent: Monday, September 29, 2008 12:16 AM To: Discussion of IronPython Subject: Re: [IronPython] IPyb5 performance thanks for the help. I tried both suggestions, but unfortunately it didn't change anything. I now use a benchmark that builds a typical setup and then checks performance of calculations in steady state: Ipy 1.1.1: total time: 80 sec. single "compute actions": 0.23 sec Ipy 2.0b5: total time: 200 sec. single "compute actions": 1.2 sec I believe the changes didn't help because most of the code is python, so the main is just the "tip of the iceberg". The main file is 64 lines and the code it launches is about 15K lines. IIUC what Dino said, the changes you proposed only affect how the 64 lines are run. The rest are compiled when they are imported (directly or indirectly by the main module) and run in their own scopes. the good and bad news is that for steady state the degradation is 600%. The good part is that maybe it's this bad because I'm using one or two flows which have a very specific and silly problem (like the **kw which you fixed already). I will try to focus the problem better once I've gotten over Rosh Hashana dinner :-) btw, the only way I found to get the default scope was through CompiledCode.DefaultScope. Expected it to be accessible directly from the engine. Is there are reason it's not? (or have I just missed it) thanks Ronnie On Mon, Sep 29, 2008 at 2:55 AM, Dino Viehland > wrote: Also not passing a scope is probably bound to help - especially if the perf critical code is in this file and accesses lots of globals. Do .Compile, get the DefaultScope, update that w/ the vars you want set, and then just do .Execute(). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Sunday, September 28, 2008 1:32 PM To: Discussion of IronPython Subject: Re: [IronPython] IPyb5 performance Make that last line call compile and see if it helps. When the Silverlight integration was written that gave a 4x speedup when using top-level functions/variables: source.Compile().Execute(mainScope); Not sure if that's the case anymore, but it's worth a try. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor Sent: Saturday, September 27, 2008 11:22 PM To: Discussion of IronPython Subject: [IronPython] IPyb5 performance Hi all, I've finally managed to get my code running correctly under IPy2b5 - thanks everyone who helped! I'm now left with a performance problem. My code seems to run roughly 2 times slower: * infra tests regressed from 19 seconds in IPy 1.1.1 to 33 seconds in IPy2b5 * application level tests regressed from 375 seconds in 1.1.1 to 705 seconds in IPy2b5 (these are single measurements, but variance is not too big - about 5%) startup time is also much longer, but I can live with that. before trying to pinpoint the bottlenecks, I wanted to check I'm not missing something stupid, like turning on optimizations in the DLR... below is the hosting code I'm using to run the tests. I tried with and without "Debug" flag, and it doesn't seem to change anything (except debug allows me to understand the stack traces). I can also run the infra tests with ipy directly, which showed that -O and -OO don't help either. Is there something else I should be doing? any tips? thanks! // set up runtime and engine Dictionary runtimeOptions = new Dictionary(); runtimeOptions["Debug"] = true; ScriptRuntime runtime = IronPython.Hosting.Python.CreateRuntime(runtimeOptions); runtime.LoadAssembly(typeof(String).Assembly); // Add reference to System runtime.LoadAssembly(typeof(Uri).Assembly); // Add reference to mscorlib engine = runtime.GetEngine("Python"); .... // run file as __main__ engine.SetSearchPaths(new string[] {".", progdir, backend_dir, stdlib_dir}); List argv = new List(); argv.append(filename); for (int i = 2; i < args.Length; ++i) argv.append(args[i]); engine.GetSysModule().SetVariable("argv", argv); mainScope = engine.CreateScope(); mainScope.SetVariable("__name__", "__main__"); var main_module = Microsoft.Scripting.Hosting.Providers.HostingHelpers.GetScope(mainScope); runtime.Globals.SetVariable("__main__", main_module); mainScope.SetVariable("__file__",filename); ScriptSource source = engine.CreateScriptSourceFromFile(filename, Encoding.Default, SourceCodeKind.Statements); source.Execute(mainScope); _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Sep 29 18:56:45 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 09:56:45 -0700 Subject: [IronPython] InvalidProgramException exception with NUnit In-Reply-To: <8140eff40809261200i3740f37dj2bd8dd7146cdb5a6@mail.gmail.com> References: <8140eff40809261200i3740f37dj2bd8dd7146cdb5a6@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC235547877B979A@NA-EXMSG-C102.redmond.corp.microsoft.com> What if you create the runtime through IronPython.Hosting.Python.CreateRuntime() instead of reading it from configuration? Also, does the happen outside of NUnit? When I change the program to the code below it works for me w/o any issues. So I'm wondering if it's somehow related to the config you have or if it's related to NUnit doing something which could be altering process state in an unexpected manner. using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using Microsoft.Scripting.Hosting; using Microsoft.Scripting; using IronPython.Hosting; namespace HelloDLRWorld { public class DlrTest { public static void Main(string[]args) { ImportTest(); } public static void ImportTest() { ScriptRuntime runtime = Python.CreateRuntime(); runtime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); runtime.LoadAssembly(typeof(System.Double).Assembly); ScriptEngine pyEng = runtime.GetEngine("IronPython"); ScriptSource source = pyEng.CreateScriptSourceFromString(@" import System.Diagnostics output='hello world from DLR/IronPython' System.Diagnostics.Debug.WriteLine(output) ", SourceCodeKind.Statements); ScriptScope scope = pyEng.CreateScope(); source.Execute(scope); object outputMsg = scope.GetVariable("output"); Console.WriteLine(outputMsg.ToString()); } } } From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fernando Correia Sent: Friday, September 26, 2008 12:01 PM To: Discussion of IronPython Subject: [IronPython] InvalidProgramException exception with NUnit I'm upgrading IronPython 2 from B4 to B5 and one of my unit tests is aborting with InvalidProgramException exception in Microsoft.Scripting.Actions.MatchCaller.Call6. The problem occurs if in the Python statements I try to import anything, no matter what. No import statement, no error. Also, when executed directly, without a unit test, the same code runs correctly. Is this a bug? Source code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using Microsoft.Scripting.Hosting; using Microsoft.Scripting; namespace HelloDLRWorld { [TestFixture] public class DlrTest { [Test] public void ImportTest() { ScriptRuntimeSetup srs = ScriptRuntimeSetup.ReadConfiguration(); ScriptRuntime runtime = new ScriptRuntime(srs); runtime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); runtime.LoadAssembly(typeof(System.Double).Assembly); ScriptEngine pyEng = runtime.GetEngine("IronPython"); ScriptSource source = pyEng.CreateScriptSourceFromString(@" import System.Diagnostics output='hello world from DLR/IronPython' System.Diagnostics.Debug.WriteLine(output) ", SourceCodeKind.Statements); ScriptScope scope = pyEng.CreateScope(); source.Execute(scope); object outputMsg = scope.GetVariable("output"); Assert.AreEqual("hello world from DLR/IronPython", outputMsg.ToString()); } } } Test result: ------ Test started: Assembly: HelloDLRWorld.exe ------ TestCase 'HelloDLRWorld.DlrTest.ImportTest' failed: System.InvalidProgramException : Common Language Runtime detectou um programa inv?lido. em Microsoft.Scripting.Actions.MatchCaller.Call6[T0,T1,T2,T3,T4,T5,TRet](Func`8 target, CallSite site, Object[] args) em Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) em Microsoft.Scripting.Actions.UpdateDelegates.Update6[T,T0,T1,T2,T3,T4,T5,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) em IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) em IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) em $1##1(Closure , Scope , LanguageContext ) em Microsoft.Scripting.Runtime.OptimizedScriptCode.InvokeTarget(LambdaExpression code, Scope scope) em Microsoft.Scripting.ScriptCode.Run(Scope scope) em Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) em Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) C:\Temp\HelloDLRWorld\HelloDLRWorld\HelloDLRWorld\DlrTest.cs(28,0): em HelloDLRWorld.DlrTest.ImportTest() 0 passed, 1 failed, 0 skipped, took 6,47 seconds. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Sep 29 19:02:36 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 10:02:36 -0700 Subject: [IronPython] blocker: objects deleted when they shouldn't be In-Reply-To: <48E0E1F1.30802@resolversystems.com> References: <48E0E1F1.30802@resolversystems.com> Message-ID: <350E7D38B6D819428718949920EC235547877B97B2@NA-EXMSG-C102.redmond.corp.microsoft.com> Very cool bug and great analysis - thanks for reporting this. BTW That code lives in MetaPythonType.Calls now. It seems like this logic needs to be moved into PythonType.CreateInstance instead instead of in the generated rule code. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade Sent: Monday, September 29, 2008 7:11 AM To: users at lists.ironpython.com Subject: [IronPython] blocker: objects deleted when they shouldn't be Hi all I'm about to file this on Codeplex, but I think I've tracked down a subtle and nasty bug, which is blocking Ironclad with numpy (it fatally breaks matrices and masked arrays), and I feel compelled to shout loudly about it to ensure it doesn't get lost in the noise of the impending 2.0 release. In short, the following code: ------------------------------------------------------------- from System import GC class C(object): _instance = None def __new__(cls): if C._instance is None: C._instance = object.__new__(cls) return C._instance def __del__(self): print 'deleting object with id', id(self) c = C() print 'created a C with id', id(c) d = C() print 'created another C with id', id(d) for _ in range(3): GC.Collect() GC.WaitForPendingFinalizers() print id(c), id(d) print c print d ------------------------------------------------------------- ...produces the following output: ------------------------------------------------------------- C:\dev\ironclad\build>ipy deltest.py created a C with id 43 created another C with id 43 deleting object with id 43 43 43 ------------------------------------------------------------- ...and I don't think that the 'deleting...' message should be printed at that point. My suspicion is that c's 'magic_finalization_wossname'* slot is being overwritten with a new instance after __new__ returns, leaving the original 'magic_finalization_wossname' unreferenced; in the fullness of time, that gets finalized and calls c.__del__, even though c itself still exists. Cheers William * This is probably not the actual member name, but I couldn't find the relevant code today, even though I remember reading it in the past... hopefully the implementers know what I'm trying to refer to, even if nobody else does. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fernandoacorreia at gmail.com Mon Sep 29 19:41:03 2008 From: fernandoacorreia at gmail.com (Fernando Correia) Date: Mon, 29 Sep 2008 14:41:03 -0300 Subject: [IronPython] InvalidProgramException exception with NUnit In-Reply-To: <350E7D38B6D819428718949920EC235547877B979A@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <8140eff40809261200i3740f37dj2bd8dd7146cdb5a6@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B979A@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <8140eff40809291041l7a55fff4pb6e8503e6f61f3ac@mail.gmail.com> Dino, thanks for your support. The modified code still aborts under NUnit, so it is not related to the configuration. The program runs correctly outside NUnit, but raises an InvalidProgramException when executed as a unit test. I had a similar problem with a previous version of IronPython that disappeared in another release. Granted that NUnit must be doing something to the execution context, but it would really be a shame if code that uses IronPython could not be tested under NUnit. Please notice that until Beta 4 this kind of test was working. The exception started with Beta 5. Regards. using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using Microsoft.Scripting.Hosting; using Microsoft.Scripting; using IronPython.Hosting; using NUnit.Framework; namespace HelloDLRWorld { [TestFixture] public class DlrTest2 { public static void Main(string[] args) { var test = new DlrTest2(); test.ImportTest(); } [Test] public void ImportTest() { ScriptRuntime runtime = Python.CreateRuntime(); runtime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); runtime.LoadAssembly(typeof(System.Double).Assembly); ScriptEngine pyEng = runtime.GetEngine("IronPython"); ScriptSource source = pyEng.CreateScriptSourceFromString(@" import System.Diagnostics output='hello world from DLR/IronPython!' System.Diagnostics.Debug.WriteLine(output) ", SourceCodeKind.Statements); ScriptScope scope = pyEng.CreateScope(); source.Execute(scope); object outputMsg = scope.GetVariable("output"); Console.WriteLine(outputMsg.ToString()); } } } From curt at hagenlocher.org Mon Sep 29 19:46:17 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 29 Sep 2008 10:46:17 -0700 Subject: [IronPython] InvalidProgramException exception with NUnit In-Reply-To: <8140eff40809291041l7a55fff4pb6e8503e6f61f3ac@mail.gmail.com> References: <8140eff40809261200i3740f37dj2bd8dd7146cdb5a6@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B979A@NA-EXMSG-C102.redmond.corp.microsoft.com> <8140eff40809291041l7a55fff4pb6e8503e6f61f3ac@mail.gmail.com> Message-ID: Does it work correctly under NUnit if you disable shadow copying? On Mon, Sep 29, 2008 at 10:41 AM, Fernando Correia < fernandoacorreia at gmail.com> wrote: > Dino, thanks for your support. > > The modified code still aborts under NUnit, so it is not related to > the configuration. The program runs correctly outside NUnit, but > raises an InvalidProgramException when executed as a unit test. > > I had a similar problem with a previous version of IronPython that > disappeared in another release. Granted that NUnit must be doing > something to the execution context, but it would really be a shame if > code that uses IronPython could not be tested under NUnit. > > Please notice that until Beta 4 this kind of test was working. The > exception started with Beta 5. > > Regards. > > using System; > using System.Collections.Generic; > using System.Diagnostics; > using System.Text; > using Microsoft.Scripting.Hosting; > using Microsoft.Scripting; > using IronPython.Hosting; > using NUnit.Framework; > > namespace HelloDLRWorld > { > [TestFixture] > public class DlrTest2 > { > public static void Main(string[] args) > { > var test = new DlrTest2(); > test.ImportTest(); > } > > [Test] > public void ImportTest() > { > ScriptRuntime runtime = Python.CreateRuntime(); > runtime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); > runtime.LoadAssembly(typeof(System.Double).Assembly); > ScriptEngine pyEng = runtime.GetEngine("IronPython"); > ScriptSource source = pyEng.CreateScriptSourceFromString(@" > import System.Diagnostics > output='hello world from DLR/IronPython!' > System.Diagnostics.Debug.WriteLine(output) > ", SourceCodeKind.Statements); > ScriptScope scope = pyEng.CreateScope(); > source.Execute(scope); > object outputMsg = scope.GetVariable("output"); > Console.WriteLine(outputMsg.ToString()); > } > } > } > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From william at resolversystems.com Mon Sep 29 19:50:28 2008 From: william at resolversystems.com (William Reade) Date: Mon, 29 Sep 2008 18:50:28 +0100 Subject: [IronPython] blocker: objects deleted when they shouldn't be In-Reply-To: <350E7D38B6D819428718949920EC235547877B97B2@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <48E0E1F1.30802@resolversystems.com> <350E7D38B6D819428718949920EC235547877B97B2@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E11564.8050405@resolversystems.com> Thanks Dino :) Can you suggest an approximate ETA for a fix? I don't want to hassle you, but I'm very keen to get numpy matrices working and would really appreciate a guess -- even if it's wildly wrong, it still gives me a framework to work within ;). Cheers William Dino Viehland wrote: > Very cool bug and great analysis - thanks for reporting this. BTW That code lives in MetaPythonType.Calls now. > > It seems like this logic needs to be moved into PythonType.CreateInstance instead instead of in the generated rule code. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade > Sent: Monday, September 29, 2008 7:11 AM > To: users at lists.ironpython.com > Subject: [IronPython] blocker: objects deleted when they shouldn't be > > Hi all > > I'm about to file this on Codeplex, but I think I've tracked down a > subtle and nasty bug, which is blocking Ironclad with numpy (it fatally > breaks matrices and masked arrays), and I feel compelled to shout loudly > about it to ensure it doesn't get lost in the noise of the impending 2.0 > release. > > In short, the following code: > ------------------------------------------------------------- > from System import GC > > class C(object): > _instance = None > def __new__(cls): > if C._instance is None: > C._instance = object.__new__(cls) > return C._instance > > def __del__(self): > print 'deleting object with id', id(self) > > c = C() > print 'created a C with id', id(c) > d = C() > print 'created another C with id', id(d) > > for _ in range(3): > GC.Collect() > GC.WaitForPendingFinalizers() > > print id(c), id(d) > print c > print d > ------------------------------------------------------------- > > ...produces the following output: > ------------------------------------------------------------- > C:\dev\ironclad\build>ipy deltest.py > created a C with id 43 > created another C with id 43 > deleting object with id 43 > 43 43 > > > ------------------------------------------------------------- > > ...and I don't think that the 'deleting...' message should be printed at > that point. > > My suspicion is that c's 'magic_finalization_wossname'* slot is being > overwritten with a new instance after __new__ returns, leaving the > original 'magic_finalization_wossname' unreferenced; in the fullness of > time, that gets finalized and calls c.__del__, even though c itself > still exists. > > Cheers > William > > * This is probably not the actual member name, but I couldn't find the > relevant code today, even though I remember reading it in the past... > hopefully the implementers know what I'm trying to refer to, even if > nobody else does. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From deus.verus at gmail.com Mon Sep 29 20:36:56 2008 From: deus.verus at gmail.com (Serge) Date: Tue, 30 Sep 2008 04:36:56 +1000 Subject: [IronPython] Getting exception line number? Message-ID: <18c139230809291136j602efd4fh96b0584385067eb6@mail.gmail.com> Hi all, I've been unable to figure out how to get the python line number/source span associated with an exception being thrown from IP2. The IronPython.Runtime.Exceptions don't seem to have an attibute to describe this. Can someone enlighten me please? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Sep 29 21:59:03 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 12:59:03 -0700 Subject: [IronPython] Getting exception line number? In-Reply-To: <18c139230809291136j602efd4fh96b0584385067eb6@mail.gmail.com> References: <18c139230809291136j602efd4fh96b0584385067eb6@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC235547877B9996@NA-EXMSG-C102.redmond.corp.microsoft.com> You can Microsoft.Scripting.Runtime.ExceptionHelpers.GetStackFrames on the Exception object and you'll get back an enumerable of DynamicStackFrame's. That will give you function names, filenames, and line numbers. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Serge Sent: Monday, September 29, 2008 11:37 AM To: users at lists.ironpython.com Subject: [IronPython] Getting exception line number? Hi all, I've been unable to figure out how to get the python line number/source span associated with an exception being thrown from IP2. The IronPython.Runtime.Exceptions don't seem to have an attibute to describe this. Can someone enlighten me please? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Mon Sep 29 22:23:00 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 29 Sep 2008 15:23:00 -0500 Subject: [IronPython] What happened to source drops? Message-ID: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> I'm noticing that the last source drop was the beta 5 release two weeks ago. I don't mean to pressure you guys, but I am looking forward to the next source release, which seems to have the delegate regressions fixed. Any (vague) idea of when regular source drops will be resumed? By the way, I built IronPython b5 for Silverlight RC0, and I had to modify Microsoft.Scripting.Silverlight.ErrorFormatter: - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); I'm not fully sure how this code compiled in the first place, as ScriptObject never had an AppendChild method. Probably this code has already been fixed, but it's worth checking anyway. -Dan From dinov at microsoft.com Mon Sep 29 23:08:06 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 14:08:06 -0700 Subject: [IronPython] What happened to source drops? In-Reply-To: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> Message-ID: <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Monday, September 29, 2008 1:23 PM To: Discussion of IronPython Subject: [IronPython] What happened to source drops? I'm noticing that the last source drop was the beta 5 release two weeks ago. I don't mean to pressure you guys, but I am looking forward to the next source release, which seems to have the delegate regressions fixed. Any (vague) idea of when regular source drops will be resumed? By the way, I built IronPython b5 for Silverlight RC0, and I had to modify Microsoft.Scripting.Silverlight.ErrorFormatter: - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); I'm not fully sure how this code compiled in the first place, as ScriptObject never had an AppendChild method. Probably this code has already been fixed, but it's worth checking anyway. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Mon Sep 29 23:08:50 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 14:08:50 -0700 Subject: [IronPython] blocker: objects deleted when they shouldn't be In-Reply-To: <48E11564.8050405@resolversystems.com> References: <48E0E1F1.30802@resolversystems.com> <350E7D38B6D819428718949920EC235547877B97B2@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E11564.8050405@resolversystems.com> Message-ID: <350E7D38B6D819428718949920EC235547877B9A25@NA-EXMSG-C102.redmond.corp.microsoft.com> It might be this week, it might be next week - I'm currently doing some perf tuning for the DLR team and am queueing up a bunch of bugs to fix in a single day or two. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade Sent: Monday, September 29, 2008 10:50 AM To: Discussion of IronPython Subject: Re: [IronPython] blocker: objects deleted when they shouldn't be Thanks Dino :) Can you suggest an approximate ETA for a fix? I don't want to hassle you, but I'm very keen to get numpy matrices working and would really appreciate a guess -- even if it's wildly wrong, it still gives me a framework to work within ;). Cheers William Dino Viehland wrote: > Very cool bug and great analysis - thanks for reporting this. BTW That code lives in MetaPythonType.Calls now. > > It seems like this logic needs to be moved into PythonType.CreateInstance instead instead of in the generated rule code. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade > Sent: Monday, September 29, 2008 7:11 AM > To: users at lists.ironpython.com > Subject: [IronPython] blocker: objects deleted when they shouldn't be > > Hi all > > I'm about to file this on Codeplex, but I think I've tracked down a > subtle and nasty bug, which is blocking Ironclad with numpy (it fatally > breaks matrices and masked arrays), and I feel compelled to shout loudly > about it to ensure it doesn't get lost in the noise of the impending 2.0 > release. > > In short, the following code: > ------------------------------------------------------------- > from System import GC > > class C(object): > _instance = None > def __new__(cls): > if C._instance is None: > C._instance = object.__new__(cls) > return C._instance > > def __del__(self): > print 'deleting object with id', id(self) > > c = C() > print 'created a C with id', id(c) > d = C() > print 'created another C with id', id(d) > > for _ in range(3): > GC.Collect() > GC.WaitForPendingFinalizers() > > print id(c), id(d) > print c > print d > ------------------------------------------------------------- > > ...produces the following output: > ------------------------------------------------------------- > C:\dev\ironclad\build>ipy deltest.py > created a C with id 43 > created another C with id 43 > deleting object with id 43 > 43 43 > > > ------------------------------------------------------------- > > ...and I don't think that the 'deleting...' message should be printed at > that point. > > My suspicion is that c's 'magic_finalization_wossname'* slot is being > overwritten with a new instance after __new__ returns, leaving the > original 'magic_finalization_wossname' unreferenced; in the fullness of > time, that gets finalized and calls c.__del__, even though c itself > still exists. > > Cheers > William > > * This is probably not the actual member name, but I couldn't find the > relevant code today, even though I remember reading it in the past... > hopefully the implementers know what I'm trying to refer to, even if > nobody else does. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Sep 29 23:15:16 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 29 Sep 2008 22:15:16 +0100 Subject: [IronPython] What happened to source drops? In-Reply-To: <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E14564.1050403@voidspace.org.uk> Dino Viehland wrote: > It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. > Cool. If you get the compiling packages fixes into a code drop please let me know so that we can start testing them early. Thanks Michael Foord > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, September 29, 2008 1:23 PM > To: Discussion of IronPython > Subject: [IronPython] What happened to source drops? > > I'm noticing that the last source drop was the beta 5 release two weeks ago. > > I don't mean to pressure you guys, but I am looking forward to the > next source release, which seems to have the delegate regressions > fixed. Any (vague) idea of when regular source drops will be resumed? > > By the way, I built IronPython b5 for Silverlight RC0, and I had to > modify Microsoft.Scripting.Silverlight.ErrorFormatter: > > - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); > + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); > > I'm not fully sure how this code compiled in the first place, as > ScriptObject never had an AppendChild method. Probably this code has > already been fixed, but it's worth checking anyway. > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at microsoft.com Mon Sep 29 23:26:12 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 14:26:12 -0700 Subject: [IronPython] What happened to source drops? In-Reply-To: <48E14564.1050403@voidspace.org.uk> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> Message-ID: <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, September 29, 2008 2:15 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? Dino Viehland wrote: > It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. > Cool. If you get the compiling packages fixes into a code drop please let me know so that we can start testing them early. Thanks Michael Foord > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, September 29, 2008 1:23 PM > To: Discussion of IronPython > Subject: [IronPython] What happened to source drops? > > I'm noticing that the last source drop was the beta 5 release two weeks ago. > > I don't mean to pressure you guys, but I am looking forward to the > next source release, which seems to have the delegate regressions > fixed. Any (vague) idea of when regular source drops will be resumed? > > By the way, I built IronPython b5 for Silverlight RC0, and I had to > modify Microsoft.Scripting.Silverlight.ErrorFormatter: > > - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); > + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); > > I'm not fully sure how this code compiled in the first place, as > ScriptObject never had an AppendChild method. Probably this code has > already been fixed, but it's worth checking anyway. > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Sep 29 23:29:39 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 29 Sep 2008 22:29:39 +0100 Subject: [IronPython] What happened to source drops? In-Reply-To: <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E148C3.9030207@voidspace.org.uk> Dino Viehland wrote: > They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. > Cool - thanks. 550mb for one module - wow. Good job we aren't intending to precompile the Python standard library modules we're using. Having said that we have quite a chunk of Python source we would like to compile - I wonder if a 4gb address space will be enough. I think we will be reluctant to move to 64bit oses only... ;-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:15 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >> >> > > Cool. If you get the compiling packages fixes into a code drop please > let me know so that we can start testing them early. > > Thanks > > Michael Foord > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, September 29, 2008 1:23 PM >> To: Discussion of IronPython >> Subject: [IronPython] What happened to source drops? >> >> I'm noticing that the last source drop was the beta 5 release two weeks ago. >> >> I don't mean to pressure you guys, but I am looking forward to the >> next source release, which seems to have the delegate regressions >> fixed. Any (vague) idea of when regular source drops will be resumed? >> >> By the way, I built IronPython b5 for Silverlight RC0, and I had to >> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >> >> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >> >> I'm not fully sure how this code compiled in the first place, as >> ScriptObject never had an AppendChild method. Probably this code has >> already been fixed, but it's worth checking anyway. >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at microsoft.com Mon Sep 29 23:39:53 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 14:39:53 -0700 Subject: [IronPython] What happened to source drops? In-Reply-To: <48E148C3.9030207@voidspace.org.uk> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> Message-ID: <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> I would actually suggest compiling the standard modules as well as your code and then ngen them both on install. You can compile the std modules into their own .dll so the user can always replace them w/ their own version (or they can simply delete the DLL and then pick up the .py files). The reason I suggest this is with the bits on my machine I'm seeing massive import speed ups w/ pre-compilation + ngen (e.g. 3x or so). And decimal does import a lot more - but the real working set hit came from publishing all the SymbolIDs for every precompiled module - once for each module - on startup! A small oversight :)... But there were a few other areas that could use some improvement as well. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, September 29, 2008 2:30 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? Dino Viehland wrote: > They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. > Cool - thanks. 550mb for one module - wow. Good job we aren't intending to precompile the Python standard library modules we're using. Having said that we have quite a chunk of Python source we would like to compile - I wonder if a 4gb address space will be enough. I think we will be reluctant to move to 64bit oses only... ;-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:15 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >> >> > > Cool. If you get the compiling packages fixes into a code drop please > let me know so that we can start testing them early. > > Thanks > > Michael Foord > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, September 29, 2008 1:23 PM >> To: Discussion of IronPython >> Subject: [IronPython] What happened to source drops? >> >> I'm noticing that the last source drop was the beta 5 release two weeks ago. >> >> I don't mean to pressure you guys, but I am looking forward to the >> next source release, which seems to have the delegate regressions >> fixed. Any (vague) idea of when regular source drops will be resumed? >> >> By the way, I built IronPython b5 for Silverlight RC0, and I had to >> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >> >> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >> >> I'm not fully sure how this code compiled in the first place, as >> ScriptObject never had an AppendChild method. Probably this code has >> already been fixed, but it's worth checking anyway. >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From srivatsn at microsoft.com Tue Sep 30 00:11:46 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Mon, 29 Sep 2008 15:11:46 -0700 Subject: [IronPython] What happened to source drops? In-Reply-To: <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: I've pushed out a source drop with the latest sources - http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, September 29, 2008 2:40 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? I would actually suggest compiling the standard modules as well as your code and then ngen them both on install. You can compile the std modules into their own .dll so the user can always replace them w/ their own version (or they can simply delete the DLL and then pick up the .py files). The reason I suggest this is with the bits on my machine I'm seeing massive import speed ups w/ pre-compilation + ngen (e.g. 3x or so). And decimal does import a lot more - but the real working set hit came from publishing all the SymbolIDs for every precompiled module - once for each module - on startup! A small oversight :)... But there were a few other areas that could use some improvement as well. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, September 29, 2008 2:30 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? Dino Viehland wrote: > They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. > Cool - thanks. 550mb for one module - wow. Good job we aren't intending to precompile the Python standard library modules we're using. Having said that we have quite a chunk of Python source we would like to compile - I wonder if a 4gb address space will be enough. I think we will be reluctant to move to 64bit oses only... ;-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:15 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >> >> > > Cool. If you get the compiling packages fixes into a code drop please > let me know so that we can start testing them early. > > Thanks > > Michael Foord > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, September 29, 2008 1:23 PM >> To: Discussion of IronPython >> Subject: [IronPython] What happened to source drops? >> >> I'm noticing that the last source drop was the beta 5 release two weeks ago. >> >> I don't mean to pressure you guys, but I am looking forward to the >> next source release, which seems to have the delegate regressions >> fixed. Any (vague) idea of when regular source drops will be resumed? >> >> By the way, I built IronPython b5 for Silverlight RC0, and I had to >> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >> >> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >> >> I'm not fully sure how this code compiled in the first place, as >> ScriptObject never had an AppendChild method. Probably this code has >> already been fixed, but it's worth checking anyway. >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Sep 30 00:14:07 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 29 Sep 2008 23:14:07 +0100 Subject: [IronPython] What happened to source drops? In-Reply-To: <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E1532F.4090106@voidspace.org.uk> Dino Viehland wrote: > I would actually suggest compiling the standard modules as well as your code and then ngen them both on install. You can compile the std modules into their own .dll so the user can always replace them w/ their own version (or they can simply delete the DLL and then pick up the .py files). > > The reason I suggest this is with the bits on my machine I'm seeing massive import speed ups w/ pre-compilation + ngen (e.g. 3x or so). > > Wow - that's great news. It makes the transition to IronPython 2 all the better for Resolver One. In the next release of Resolver One (1.3) we have almost halved startup time - all down to the work of Kamil Dworakowski who has implemented various improvements including a very clever parallel import system (complete with import graph analysis) that I'm sure he'll blog about soon... Thanks Michael Foord > And decimal does import a lot more - but the real working set hit came from publishing all the SymbolIDs for every precompiled module - once for each module - on startup! A small oversight :)... But there were a few other areas that could use some improvement as well. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:30 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. >> >> > > Cool - thanks. 550mb for one module - wow. Good job we aren't intending > to precompile the Python standard library modules we're using. Having > said that we have quite a chunk of Python source we would like to > compile - I wonder if a 4gb address space will be enough. I think we > will be reluctant to move to 64bit oses only... ;-) > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, September 29, 2008 2:15 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] What happened to source drops? >> >> Dino Viehland wrote: >> >> >>> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >>> >>> >>> >> Cool. If you get the compiling packages fixes into a code drop please >> let me know so that we can start testing them early. >> >> Thanks >> >> Michael Foord >> >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >>> Sent: Monday, September 29, 2008 1:23 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] What happened to source drops? >>> >>> I'm noticing that the last source drop was the beta 5 release two weeks ago. >>> >>> I don't mean to pressure you guys, but I am looking forward to the >>> next source release, which seems to have the delegate regressions >>> fixed. Any (vague) idea of when regular source drops will be resumed? >>> >>> By the way, I built IronPython b5 for Silverlight RC0, and I had to >>> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >>> >>> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >>> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >>> >>> I'm not fully sure how this code compiled in the first place, as >>> ScriptObject never had an AppendChild method. Probably this code has >>> already been fixed, but it's worth checking anyway. >>> >>> -Dan >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dan.eloff at gmail.com Tue Sep 30 00:17:19 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 29 Sep 2008 17:17:19 -0500 Subject: [IronPython] What happened to source drops? In-Reply-To: References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809291517y5ecdd186i2ffbf1672dcf7@mail.gmail.com> On Mon, Sep 29, 2008 at 5:11 PM, Srivatsn Narayanan wrote: > I've pushed out a source drop with the latest sources - http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx Thank you! I've just downloaded it. Hopefully now I will be able to migrate the codebase to b5. Cheers, -Dan From fuzzyman at voidspace.org.uk Tue Sep 30 00:17:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 29 Sep 2008 23:17:34 +0100 Subject: [IronPython] What happened to source drops? In-Reply-To: References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E153FE.1080505@voidspace.org.uk> Srivatsn Narayanan wrote: > I've pushed out a source drop with the latest sources - http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx > Cool - thanks. Michael > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, September 29, 2008 2:40 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > I would actually suggest compiling the standard modules as well as your code and then ngen them both on install. You can compile the std modules into their own .dll so the user can always replace them w/ their own version (or they can simply delete the DLL and then pick up the .py files). > > The reason I suggest this is with the bits on my machine I'm seeing massive import speed ups w/ pre-compilation + ngen (e.g. 3x or so). > > And decimal does import a lot more - but the real working set hit came from publishing all the SymbolIDs for every precompiled module - once for each module - on startup! A small oversight :)... But there were a few other areas that could use some improvement as well. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:30 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. >> >> > > Cool - thanks. 550mb for one module - wow. Good job we aren't intending > to precompile the Python standard library modules we're using. Having > said that we have quite a chunk of Python source we would like to > compile - I wonder if a 4gb address space will be enough. I think we > will be reluctant to move to 64bit oses only... ;-) > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, September 29, 2008 2:15 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] What happened to source drops? >> >> Dino Viehland wrote: >> >> >>> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >>> >>> >>> >> Cool. If you get the compiling packages fixes into a code drop please >> let me know so that we can start testing them early. >> >> Thanks >> >> Michael Foord >> >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >>> Sent: Monday, September 29, 2008 1:23 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] What happened to source drops? >>> >>> I'm noticing that the last source drop was the beta 5 release two weeks ago. >>> >>> I don't mean to pressure you guys, but I am looking forward to the >>> next source release, which seems to have the delegate regressions >>> fixed. Any (vague) idea of when regular source drops will be resumed? >>> >>> By the way, I built IronPython b5 for Silverlight RC0, and I had to >>> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >>> >>> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >>> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >>> >>> I'm not fully sure how this code compiled in the first place, as >>> ScriptObject never had an AppendChild method. Probably this code has >>> already been fixed, but it's worth checking anyway. >>> >>> -Dan >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From wangym at gmail.com Tue Sep 30 01:33:13 2008 From: wangym at gmail.com (Yongming Wang) Date: Tue, 30 Sep 2008 07:33:13 +0800 Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? Message-ID: <000e01c9228b$bf885030$3e98f090$@com> I want to save the ScriptCode to assembly, load and run it next time. I tried 3 ways, but all failed. 1. Here is my code --------------------------------------------------- public void RunScript(string script) { try { if (!System.IO.File.Exists(@"E:\Source \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")) { _source = _engine.CreateScriptSourceFromString(script, Microsoft.Scripting.SourceCodeKind.Statements); _binary = _source.Compile(); ScriptCode code = HostingHelpers.GetScriptCode(_binary); List codes = new List(); codes.Add(code); ScriptCode.SaveToAssembly("demo.dll", codes.ToArray()); _binary.Execute(_scope); } else { ScriptCode[] codes = ScriptCode.LoadFromAssembly(HostingHelpers.GetDomainManager(_runtime), System.Reflection.Assembly.LoadFile(@"E:\Source \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")); if (codes != null && codes.Length >= 1) { OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; Scope scope = optimizedCode.CreateScope(); this._mainForm.setScope(scope); // SetObjectName "Button1" etc. optimizedCode.Run(scope); } } } catch (System.Exception ex) { } } ---------------------------------------------------------------------------- ----------------------------- As you can see, ScriptCode.SaveToAssembly was execute succesfully. And ScriptCode.LoadFromAssembly successfully returned. But when I got exception when I run it. I got Microsoft.Scripting.Runtime.UnboundNameException {"name 'Button1' is not defined"} But I have set the object name to the scope. I don't know why. 2. If I use another ScriptScope _scope, e.g. ------------------------------------- OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; optimizedCode.Run(HostingHelpers.GetScope(_scope)); -------------------------------------------------- I got System.NullReferenceException because code is null in the following function of OptimizedScriptCode.cs --------------------------------------------------- protected override object InvokeTarget(LambdaExpression code, Scope scope) { if (scope == _optimizedScope) { return _optimizedTarget(scope, LanguageContext); } // new scope, compile unoptimized code and use that. if (_unoptimizedTarget == null) { // TODO: fix generated DLR ASTs - languages should remove their usage // of GlobalVariables and then this can go away. code = new GlobalLookupRewriter().RewriteLambda(code); _unoptimizedTarget = code.Compile(SourceUnit.EmitDebugSymbols); } return _unoptimizedTarget(scope, LanguageContext); } ------------------------------------------------------- 3. If I modified the InvokeTarget function to if (scope == _optimizedScope || code == null) I got System.InvalidCastException. Cann't convert Microsoft.Scripting.Runtime.SymbolDictionary to Microsoft.Scripting.Runtime.GlobalsDictionary. I don't know why this convertion wass needed. Could anyone give a help? Thanks. Yongming From dinov at microsoft.com Tue Sep 30 02:01:34 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 17:01:34 -0700 Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? In-Reply-To: <000e01c9228b$bf885030$3e98f090$@com> References: <000e01c9228b$bf885030$3e98f090$@com> Message-ID: <350E7D38B6D819428718949920EC235547877B9B86@NA-EXMSG-C102.redmond.corp.microsoft.com> My guess is you're hitting a bug I already have a fix for. What's probably happening is we're burning the SymbolID into the compiled code and then when you run it we have the value inappropriately associated with the wrong string. This should be fixed in the latest sources which were just pushed up today. Also in RC1 ScriptRuntime.LoadAssembly will effectively do the load for you and then a simple "import mymodulename" should work although maybe you don't want to do compile & run the import. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Yongming Wang Sent: Monday, September 29, 2008 4:33 PM To: users at lists.ironpython.com Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? I want to save the ScriptCode to assembly, load and run it next time. I tried 3 ways, but all failed. 1. Here is my code --------------------------------------------------- public void RunScript(string script) { try { if (!System.IO.File.Exists(@"E:\Source \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")) { _source = _engine.CreateScriptSourceFromString(script, Microsoft.Scripting.SourceCodeKind.Statements); _binary = _source.Compile(); ScriptCode code = HostingHelpers.GetScriptCode(_binary); List codes = new List(); codes.Add(code); ScriptCode.SaveToAssembly("demo.dll", codes.ToArray()); _binary.Execute(_scope); } else { ScriptCode[] codes = ScriptCode.LoadFromAssembly(HostingHelpers.GetDomainManager(_runtime), System.Reflection.Assembly.LoadFile(@"E:\Source \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")); if (codes != null && codes.Length >= 1) { OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; Scope scope = optimizedCode.CreateScope(); this._mainForm.setScope(scope); // SetObjectName "Button1" etc. optimizedCode.Run(scope); } } } catch (System.Exception ex) { } } ---------------------------------------------------------------------------- ----------------------------- As you can see, ScriptCode.SaveToAssembly was execute succesfully. And ScriptCode.LoadFromAssembly successfully returned. But when I got exception when I run it. I got Microsoft.Scripting.Runtime.UnboundNameException {"name 'Button1' is not defined"} But I have set the object name to the scope. I don't know why. 2. If I use another ScriptScope _scope, e.g. ------------------------------------- OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; optimizedCode.Run(HostingHelpers.GetScope(_scope)); -------------------------------------------------- I got System.NullReferenceException because code is null in the following function of OptimizedScriptCode.cs --------------------------------------------------- protected override object InvokeTarget(LambdaExpression code, Scope scope) { if (scope == _optimizedScope) { return _optimizedTarget(scope, LanguageContext); } // new scope, compile unoptimized code and use that. if (_unoptimizedTarget == null) { // TODO: fix generated DLR ASTs - languages should remove their usage // of GlobalVariables and then this can go away. code = new GlobalLookupRewriter().RewriteLambda(code); _unoptimizedTarget = code.Compile(SourceUnit.EmitDebugSymbols); } return _unoptimizedTarget(scope, LanguageContext); } ------------------------------------------------------- 3. If I modified the InvokeTarget function to if (scope == _optimizedScope || code == null) I got System.InvalidCastException. Cann't convert Microsoft.Scripting.Runtime.SymbolDictionary to Microsoft.Scripting.Runtime.GlobalsDictionary. I don't know why this convertion wass needed. Could anyone give a help? Thanks. Yongming _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Tue Sep 30 04:20:28 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 29 Sep 2008 21:20:28 -0500 Subject: [IronPython] Anyone have IronPython running on Silverlight RC0 yet? Message-ID: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> It was easy to build the latest sources with silverlight rc0, but there seems to be some issues using the resulting binaries. InitializeError- Failed to load the application. It was built with an obsolete version of Silverlight I went back and uninstalled silverlight and silverlight sdk + tools, and physically deleted C:/Program Files/Microsoft SDKs/Silverlight. I reinstalled, rebuilt everything, but no luck. The only thing I could have from an older silverlight is I kept the old chiron.exe.config file, but I don't buy that it's the problem. The error here is not very helpful since it's impossible for the binaries to have been built with anything but the very latest silverlight version. I'm not sure what's going on here. Is IronPython supposed to be able to work with RC0 in it's current state? Jimmy, if you're reading this, have you had any success with the DLR on RC0? -Dan From wangym at gmail.com Tue Sep 30 06:20:34 2008 From: wangym at gmail.com (Yongming) Date: Mon, 29 Sep 2008 21:20:34 -0700 (PDT) Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? In-Reply-To: <350E7D38B6D819428718949920EC235547877B9B86@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <000e01c9228b$bf885030$3e98f090$@com> <350E7D38B6D819428718949920EC235547877B9B86@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: Thanks, But I tried the new version named IronPython-40877.zip, the problem still exists. Is this version fixed? And I tried to use ScriptRuntime.LoadAssembly -------------------------------- _runtime.LoadAssembly(System.Reflection.Assembly.LoadFile(@"E:\Source \IronPython_Main\Src\PyDemo\bin\Debug\demo.dll")); //_engine.SetSearchPaths(new string[] { @"E:\Source \IronPython_Main\Src\PyDemo\bin\Debug" }); _source = _engine.CreateScriptSourceFromString("import demo", Microsoft.Scripting.SourceCodeKind.Statements); _source.Execute(_scope); -------------------------------- I got an IronPython.Runtime.Exceptions.ImportException. {"No module named demo"} Is my code wrong? Best Regards Yongming On Sep 30, 8:01?am, Dino Viehland wrote: > My guess is you're hitting a bug I already have a fix for. ?What's probably happening is we're burning the SymbolID into the compiled code and then when you run it we have the value inappropriately associated with the wrong string. ?This should be fixed in the latest sources which were just pushed up today. > > Also in RC1 ScriptRuntime.LoadAssembly will effectively do the load for you and then a simple "import mymodulename" should work although maybe you don't want to do compile & run the import. > > -----Original Message----- > From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Yongming Wang > Sent: Monday, September 29, 2008 4:33 PM > To: us... at lists.ironpython.com > Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? > > I want to save the ScriptCode to assembly, load and run it next time. > I tried 3 ways, but all failed. > > 1. Here is my code > --------------------------------------------------- > > ? ? ? ? public void RunScript(string script) > ? ? ? ? { > ? ? ? ? ? ? try > ? ? ? ? ? ? { > ? ? ? ? ? ? ? ? if (!System.IO.File.Exists(@"E:\Source > \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")) > ? ? ? ? ? ? ? ? { > ? ? ? ? ? ? ? ? ? ? _source = > _engine.CreateScriptSourceFromString(script, > Microsoft.Scripting.SourceCodeKind.Statements); > ? ? ? ? ? ? ? ? ? ? _binary = _source.Compile(); > ? ? ? ? ? ? ? ? ? ? ScriptCode code = > HostingHelpers.GetScriptCode(_binary); > ? ? ? ? ? ? ? ? ? ? List codes = new List(); > ? ? ? ? ? ? ? ? ? ? codes.Add(code); > ? ? ? ? ? ? ? ? ? ? ScriptCode.SaveToAssembly("demo.dll", > codes.ToArray()); > ? ? ? ? ? ? ? ? ? ? _binary.Execute(_scope); > ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? ? else > ? ? ? ? ? ? ? ? { > ? ? ? ? ? ? ? ? ? ? ScriptCode[] codes = > ScriptCode.LoadFromAssembly(HostingHelpers.GetDomainManager(_runtime), > ? ? ? ? ? ? ? ? ? ? ? ? System.Reflection.Assembly.LoadFile(@"E:\Source > \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")); > ? ? ? ? ? ? ? ? ? ? if (codes != null && codes.Length >= 1) > ? ? ? ? ? ? ? ? ? ? { > ? ? ? ? ? ? ? ? ? ? ? ? OptimizedScriptCode optimizedCode = > (OptimizedScriptCode)codes[0]; > ? ? ? ? ? ? ? ? ? ? ? ? Scope scope = optimizedCode.CreateScope(); > ? ? ? ? ? ? ? ? ? ? ? ? this._mainForm.setScope(scope); // > SetObjectName "Button1" etc. > ? ? ? ? ? ? ? ? ? ? ? ? optimizedCode.Run(scope); > ? ? ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? ? ? } > ? ? ? ? ? ? } > ? ? ? ? ? ? catch (System.Exception ex) > ? ? ? ? ? ? { > ? ? ? ? ? ? } > ? ? ? ? } > ---------------------------------------------------------------------------- > ----------------------------- > As you can see, ScriptCode.SaveToAssembly was execute succesfully. > And ScriptCode.LoadFromAssembly successfully returned. > But when I got exception when I run it. > I got Microsoft.Scripting.Runtime.UnboundNameException > {"name 'Button1' is not defined"} > But I have set the object name to the scope. I don't know why. > > 2. If I use another ScriptScope _scope, e.g. > ------------------------------------- > ? OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; > ? optimizedCode.Run(HostingHelpers.GetScope(_scope)); > -------------------------------------------------- > I got System.NullReferenceException because code is null in the > following function of OptimizedScriptCode.cs > --------------------------------------------------- > ? ? ? ? protected override object InvokeTarget(LambdaExpression code, > Scope scope) { > ? ? ? ? ? ? if (scope == _optimizedScope) { > ? ? ? ? ? ? ? ? return _optimizedTarget(scope, LanguageContext); > ? ? ? ? ? ? } > > ? ? ? ? ? ? // new scope, compile unoptimized code and use that. > ? ? ? ? ? ? if (_unoptimizedTarget == null) { > ? ? ? ? ? ? ? ? // TODO: fix generated DLR ASTs - languages should > remove their usage > ? ? ? ? ? ? ? ? // of GlobalVariables and then this can go away. > ? ? ? ? ? ? ? ? code = new GlobalLookupRewriter().RewriteLambda(code); > > ? ? ? ? ? ? ? ? _unoptimizedTarget = > code.Compile(SourceUnit.EmitDebugSymbols); > ? ? ? ? ? ? } > > ? ? ? ? ? ? return _unoptimizedTarget(scope, > LanguageContext); > ? ? ? ? } > ------------------------------------------------------- > > 3. If I ?modified the InvokeTarget function to > ?if (scope == _optimizedScope || code == null) > I got System.InvalidCastException. > Cann't convert Microsoft.Scripting.Runtime.SymbolDictionary to > Microsoft.Scripting.Runtime.GlobalsDictionary. > I don't know why this convertion wass needed. > > Could anyone give a help? > Thanks. > Yongming > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Tue Sep 30 06:48:29 2008 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Sep 2008 21:48:29 -0700 Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? In-Reply-To: References: <000e01c9228b$bf885030$3e98f090$@com> <350E7D38B6D819428718949920EC235547877B9B86@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <350E7D38B6D819428718949920EC235547877B9C0D@NA-EXMSG-C102.redmond.corp.microsoft.com> Ok, it could be a problem on the compiling side instead then... Does it work if you compile demo.dll w/ clr.CompileModules from Python instead and load w/ the code you have? One significant difference here could be that your create/compile calls result in code that is being re-writen to be non-optimized code. I think when we save it the code will be doing dictionary lookups instead of checking the array like it should. BTW, I'd also advise against casting the code from LoadFromAssembly to OptimizedScriptCode - it could, and in fact most likely will, change. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Yongming Sent: Monday, September 29, 2008 9:21 PM To: users at lists.ironpython.com Subject: Re: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? Thanks, But I tried the new version named IronPython-40877.zip, the problem still exists. Is this version fixed? And I tried to use ScriptRuntime.LoadAssembly -------------------------------- _runtime.LoadAssembly(System.Reflection.Assembly.LoadFile(@"E:\Source \IronPython_Main\Src\PyDemo\bin\Debug\demo.dll")); //_engine.SetSearchPaths(new string[] { @"E:\Source \IronPython_Main\Src\PyDemo\bin\Debug" }); _source = _engine.CreateScriptSourceFromString("import demo", Microsoft.Scripting.SourceCodeKind.Statements); _source.Execute(_scope); -------------------------------- I got an IronPython.Runtime.Exceptions.ImportException. {"No module named demo"} Is my code wrong? Best Regards Yongming On Sep 30, 8:01 am, Dino Viehland wrote: > My guess is you're hitting a bug I already have a fix for. What's probably happening is we're burning the SymbolID into the compiled code and then when you run it we have the value inappropriately associated with the wrong string. This should be fixed in the latest sources which were just pushed up today. > > Also in RC1 ScriptRuntime.LoadAssembly will effectively do the load for you and then a simple "import mymodulename" should work although maybe you don't want to do compile & run the import. > > -----Original Message----- > From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Yongming Wang > Sent: Monday, September 29, 2008 4:33 PM > To: us... at lists.ironpython.com > Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? > > I want to save the ScriptCode to assembly, load and run it next time. > I tried 3 ways, but all failed. > > 1. Here is my code > --------------------------------------------------- > > public void RunScript(string script) > { > try > { > if (!System.IO.File.Exists(@"E:\Source > \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")) > { > _source = > _engine.CreateScriptSourceFromString(script, > Microsoft.Scripting.SourceCodeKind.Statements); > _binary = _source.Compile(); > ScriptCode code = > HostingHelpers.GetScriptCode(_binary); > List codes = new List(); > codes.Add(code); > ScriptCode.SaveToAssembly("demo.dll", > codes.ToArray()); > _binary.Execute(_scope); > } > else > { > ScriptCode[] codes = > ScriptCode.LoadFromAssembly(HostingHelpers.GetDomainManager(_runtime), > System.Reflection.Assembly.LoadFile(@"E:\Source > \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")); > if (codes != null && codes.Length >= 1) > { > OptimizedScriptCode optimizedCode = > (OptimizedScriptCode)codes[0]; > Scope scope = optimizedCode.CreateScope(); > this._mainForm.setScope(scope); // > SetObjectName "Button1" etc. > optimizedCode.Run(scope); > } > } > } > catch (System.Exception ex) > { > } > } > ---------------------------------------------------------------------------- > ----------------------------- > As you can see, ScriptCode.SaveToAssembly was execute succesfully. > And ScriptCode.LoadFromAssembly successfully returned. > But when I got exception when I run it. > I got Microsoft.Scripting.Runtime.UnboundNameException > {"name 'Button1' is not defined"} > But I have set the object name to the scope. I don't know why. > > 2. If I use another ScriptScope _scope, e.g. > ------------------------------------- > OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; > optimizedCode.Run(HostingHelpers.GetScope(_scope)); > -------------------------------------------------- > I got System.NullReferenceException because code is null in the > following function of OptimizedScriptCode.cs > --------------------------------------------------- > protected override object InvokeTarget(LambdaExpression code, > Scope scope) { > if (scope == _optimizedScope) { > return _optimizedTarget(scope, LanguageContext); > } > > // new scope, compile unoptimized code and use that. > if (_unoptimizedTarget == null) { > // TODO: fix generated DLR ASTs - languages should > remove their usage > // of GlobalVariables and then this can go away. > code = new GlobalLookupRewriter().RewriteLambda(code); > > _unoptimizedTarget = > code.Compile(SourceUnit.EmitDebugSymbols); > } > > return _unoptimizedTarget(scope, > LanguageContext); > } > ------------------------------------------------------- > > 3. If I modified the InvokeTarget function to > if (scope == _optimizedScope || code == null) > I got System.InvalidCastException. > Cann't convert Microsoft.Scripting.Runtime.SymbolDictionary to > Microsoft.Scripting.Runtime.GlobalsDictionary. > I don't know why this convertion wass needed. > > Could anyone give a help? > Thanks. > Yongming > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From wangym at gmail.com Tue Sep 30 11:06:47 2008 From: wangym at gmail.com (Yongming) Date: Tue, 30 Sep 2008 02:06:47 -0700 (PDT) Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? In-Reply-To: <350E7D38B6D819428718949920EC235547877B9C0D@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <000e01c9228b$bf885030$3e98f090$@com> <350E7D38B6D819428718949920EC235547877B9B86@NA-EXMSG-C102.redmond.corp.microsoft.com> <350E7D38B6D819428718949920EC235547877B9C0D@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: I tried to use clr.CompileModules, it's exactly the same with previous. -------------------------- CodeContext codeCtx = new CodeContext(HostingHelpers.GetScope(_scope), HostingHelpers.GetLanguageContext(_engine)); ClrModule.CompileModules(codeCtx, "demo.dll", null, "demo.py"); -------------------------- On Sep 30, 12:48?pm, Dino Viehland wrote: > Ok, it could be a problem on the compiling side instead then... ?Does it work if you compile demo.dll w/ clr.CompileModules from Python instead and load w/ the code you have? ?One significant difference here could be that your create/compile calls result in code that is being re-writen to be non-optimized code. ?I think when we save it the code will be doing dictionary lookups instead of checking the array like it should. > > BTW, I'd also advise against casting the code from LoadFromAssembly to OptimizedScriptCode - it could, and in fact most likely will, change. > > -----Original Message----- > From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Yongming > Sent: Monday, September 29, 2008 9:21 PM > To: us... at lists.ironpython.com > Subject: Re: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? > > Thanks, > But I tried the new version named IronPython-40877.zip, the problem > still exists. Is this version fixed? > And I tried to use ScriptRuntime.LoadAssembly > -------------------------------- > > _runtime.LoadAssembly(System.Reflection.Assembly.LoadFile(@"E:\Source > \IronPython_Main\Src\PyDemo\bin\Debug\demo.dll")); > ? ? ? ? ? ? ? ? ? ? //_engine.SetSearchPaths(new string[] { @"E:\Source > \IronPython_Main\Src\PyDemo\bin\Debug" }); > ? ? ? ? ? ? ? ? ? ? _source = > _engine.CreateScriptSourceFromString("import demo", > Microsoft.Scripting.SourceCodeKind.Statements); > ? ? ? ? ? ? ? ? ? ? _source.Execute(_scope); > -------------------------------- > I got an IronPython.Runtime.Exceptions.ImportException. {"No module > named demo"} > Is my code wrong? > > Best Regards > Yongming > > On Sep 30, 8:01 am, Dino Viehland wrote: > > My guess is you're hitting a bug I already have a fix for. ?What's probably happening is we're burning the SymbolID into the compiled code and then when you run it we have the value inappropriately associated with the wrong string. ?This should be fixed in the latest sources which were just pushed up today. > > > Also in RC1 ScriptRuntime.LoadAssembly will effectively do the load for you and then a simple "import mymodulename" should work although maybe you don't want to do compile & run the import. > > > -----Original Message----- > > From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Yongming Wang > > Sent: Monday, September 29, 2008 4:33 PM > > To: us... at lists.ironpython.com > > Subject: [IronPython] How to run ScriptCode from ScriptCode.LoadFromAssembly? > > > I want to save the ScriptCode to assembly, load and run it next time. > > I tried 3 ways, but all failed. > > > 1. Here is my code > > --------------------------------------------------- > > > ? ? ? ? public void RunScript(string script) > > ? ? ? ? { > > ? ? ? ? ? ? try > > ? ? ? ? ? ? { > > ? ? ? ? ? ? ? ? if (!System.IO.File.Exists(@"E:\Source > > \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")) > > ? ? ? ? ? ? ? ? { > > ? ? ? ? ? ? ? ? ? ? _source = > > _engine.CreateScriptSourceFromString(script, > > Microsoft.Scripting.SourceCodeKind.Statements); > > ? ? ? ? ? ? ? ? ? ? _binary = _source.Compile(); > > ? ? ? ? ? ? ? ? ? ? ScriptCode code = > > HostingHelpers.GetScriptCode(_binary); > > ? ? ? ? ? ? ? ? ? ? List codes = new List(); > > ? ? ? ? ? ? ? ? ? ? codes.Add(code); > > ? ? ? ? ? ? ? ? ? ? ScriptCode.SaveToAssembly("demo.dll", > > codes.ToArray()); > > ? ? ? ? ? ? ? ? ? ? _binary.Execute(_scope); > > ? ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? ? else > > ? ? ? ? ? ? ? ? { > > ? ? ? ? ? ? ? ? ? ? ScriptCode[] codes = > > ScriptCode.LoadFromAssembly(HostingHelpers.GetDomainManager(_runtime), > > ? ? ? ? ? ? ? ? ? ? ? ? System.Reflection.Assembly.LoadFile(@"E:\Source > > \IronPython-2.0B5\Src\PyDemo\bin\Debug\demo.dll")); > > ? ? ? ? ? ? ? ? ? ? if (codes != null && codes.Length >= 1) > > ? ? ? ? ? ? ? ? ? ? { > > ? ? ? ? ? ? ? ? ? ? ? ? OptimizedScriptCode optimizedCode = > > (OptimizedScriptCode)codes[0]; > > ? ? ? ? ? ? ? ? ? ? ? ? Scope scope = optimizedCode.CreateScope(); > > ? ? ? ? ? ? ? ? ? ? ? ? this._mainForm.setScope(scope); // > > SetObjectName "Button1" etc. > > ? ? ? ? ? ? ? ? ? ? ? ? optimizedCode.Run(scope); > > ? ? ? ? ? ? ? ? ? ? } > > ? ? ? ? ? ? ? ? } > > ? ? ? ? ? ? } > > ? ? ? ? ? ? catch (System.Exception ex) > > ? ? ? ? ? ? { > > ? ? ? ? ? ? } > > ? ? ? ? } > > ---------------------------------------------------------------------------- > > ----------------------------- > > As you can see, ScriptCode.SaveToAssembly was execute succesfully. > > And ScriptCode.LoadFromAssembly successfully returned. > > But when I got exception when I run it. > > I got Microsoft.Scripting.Runtime.UnboundNameException > > {"name 'Button1' is not defined"} > > But I have set the object name to the scope. I don't know why. > > > 2. If I use another ScriptScope _scope, e.g. > > ------------------------------------- > > ? OptimizedScriptCode optimizedCode = (OptimizedScriptCode)codes[0]; > > ? optimizedCode.Run(HostingHelpers.GetScope(_scope)); > > -------------------------------------------------- > > I got System.NullReferenceException because code is null in the > > following function of OptimizedScriptCode.cs > > --------------------------------------------------- > > ? ? ? ? protected override object InvokeTarget(LambdaExpression code, > > Scope scope) { > > ? ? ? ? ? ? if (scope == _optimizedScope) { > > ? ? ? ? ? ? ? ? return _optimizedTarget(scope, LanguageContext); > > ? ? ? ? ? ? } > > > ? ? ? ? ? ? // new scope, compile unoptimized code and use that. > > ? ? ? ? ? ? if (_unoptimizedTarget == null) { > > ? ? ? ? ? ? ? ? // TODO: fix generated DLR ASTs - languages should > > remove their usage > > ? ? ? ? ? ? ? ? // of GlobalVariables and then this can go away. > > ? ? ? ? ? ? ? ? code = new GlobalLookupRewriter().RewriteLambda(code); > > > ? ? ? ? ? ? ? ? _unoptimizedTarget = > > code.Compile(SourceUnit.EmitDebugSymbols); > > ? ? ? ? ? ? } > > > ? ? ? ? ? ? return _unoptimizedTarget(scope, > > LanguageContext); > > ? ? ? ? } > > ------------------------------------------------------- > > > 3. If I ?modified the InvokeTarget function to > > ?if (scope == _optimizedScope || code == null) > > I got System.InvalidCastException. > > Cann't convert Microsoft.Scripting.Runtime.SymbolDictionary to > > Microsoft.Scripting.Runtime.GlobalsDictionary. > > I don't know why this convertion wass needed. > > > Could anyone give a help? > > Thanks. > > Yongming > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From william at resolversystems.com Tue Sep 30 11:17:59 2008 From: william at resolversystems.com (William Reade) Date: Tue, 30 Sep 2008 10:17:59 +0100 Subject: [IronPython] blocker: objects deleted when they shouldn't be In-Reply-To: <350E7D38B6D819428718949920EC235547877B9A25@NA-EXMSG-C102.redmond.corp.microsoft.com> References: <48E0E1F1.30802@resolversystems.com> <350E7D38B6D819428718949920EC235547877B97B2@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E11564.8050405@resolversystems.com> <350E7D38B6D819428718949920EC235547877B9A25@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E1EEC7.6080505@resolversystems.com> Great -- thank you very much. Dino Viehland wrote: > It might be this week, it might be next week - I'm currently doing some perf tuning for the DLR team and am queueing up a bunch of bugs to fix in a single day or two. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade > Sent: Monday, September 29, 2008 10:50 AM > To: Discussion of IronPython > Subject: Re: [IronPython] blocker: objects deleted when they shouldn't be > > Thanks Dino :) > > Can you suggest an approximate ETA for a fix? I don't want to hassle > you, but I'm very keen to get numpy matrices working and would really > appreciate a guess -- even if it's wildly wrong, it still gives me a > framework to work within ;). > > Cheers > William > > Dino Viehland wrote: > >> Very cool bug and great analysis - thanks for reporting this. BTW That code lives in MetaPythonType.Calls now. >> >> It seems like this logic needs to be moved into PythonType.CreateInstance instead instead of in the generated rule code. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade >> Sent: Monday, September 29, 2008 7:11 AM >> To: users at lists.ironpython.com >> Subject: [IronPython] blocker: objects deleted when they shouldn't be >> >> Hi all >> >> I'm about to file this on Codeplex, but I think I've tracked down a >> subtle and nasty bug, which is blocking Ironclad with numpy (it fatally >> breaks matrices and masked arrays), and I feel compelled to shout loudly >> about it to ensure it doesn't get lost in the noise of the impending 2.0 >> release. >> >> In short, the following code: >> ------------------------------------------------------------- >> from System import GC >> >> class C(object): >> _instance = None >> def __new__(cls): >> if C._instance is None: >> C._instance = object.__new__(cls) >> return C._instance >> >> def __del__(self): >> print 'deleting object with id', id(self) >> >> c = C() >> print 'created a C with id', id(c) >> d = C() >> print 'created another C with id', id(d) >> >> for _ in range(3): >> GC.Collect() >> GC.WaitForPendingFinalizers() >> >> print id(c), id(d) >> print c >> print d >> ------------------------------------------------------------- >> >> ...produces the following output: >> ------------------------------------------------------------- >> C:\dev\ironclad\build>ipy deltest.py >> created a C with id 43 >> created another C with id 43 >> deleting object with id 43 >> 43 43 >> >> >> ------------------------------------------------------------- >> >> ...and I don't think that the 'deleting...' message should be printed at >> that point. >> >> My suspicion is that c's 'magic_finalization_wossname'* slot is being >> overwritten with a new instance after __new__ returns, leaving the >> original 'magic_finalization_wossname' unreferenced; in the fullness of >> time, that gets finalized and calls c.__del__, even though c itself >> still exists. >> >> Cheers >> William >> >> * This is probably not the actual member name, but I couldn't find the >> relevant code today, even though I remember reading it in the past... >> hopefully the implementers know what I'm trying to refer to, even if >> nobody else does. >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From ben2004uk at googlemail.com Tue Sep 30 11:31:51 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Tue, 30 Sep 2008 10:31:51 +0100 Subject: [IronPython] Anyone have IronPython running on Silverlight RC0 yet? In-Reply-To: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> References: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> Message-ID: Hi Dan, I think the assemblies for RC0 are being finalised so should be released shortly. Not sure how long this process takes, should only be a few days. Thanks Ben Blog.BenHall.me.uk On Tue, Sep 30, 2008 at 3:20 AM, Dan Eloff wrote: > It was easy to build the latest sources with silverlight rc0, but > there seems to be some issues using the resulting binaries. > > InitializeError- Failed to load the application. It was built with an > obsolete version of Silverlight > > I went back and uninstalled silverlight and silverlight sdk + tools, > and physically deleted C:/Program Files/Microsoft SDKs/Silverlight. I > reinstalled, rebuilt everything, but no luck. The only thing I could > have from an older silverlight is I kept the old chiron.exe.config > file, but I don't buy that it's the problem. > > The error here is not very helpful since it's impossible for the > binaries to have been built with anything but the very latest > silverlight version. > > I'm not sure what's going on here. Is IronPython supposed to be able > to work with RC0 in it's current state? Jimmy, if you're reading this, > have you had any success with the DLR on RC0? > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fernandoacorreia at gmail.com Tue Sep 30 16:19:57 2008 From: fernandoacorreia at gmail.com (Fernando Correia) Date: Tue, 30 Sep 2008 11:19:57 -0300 Subject: [IronPython] InvalidProgramException exception with NUnit In-Reply-To: References: <8140eff40809261200i3740f37dj2bd8dd7146cdb5a6@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B979A@NA-EXMSG-C102.redmond.corp.microsoft.com> <8140eff40809291041l7a55fff4pb6e8503e6f61f3ac@mail.gmail.com> Message-ID: <8140eff40809300719o2354650ena0c9a9badc9c225f@mail.gmail.com> 2008/9/29 Curt Hagenlocher : > Does it work correctly under NUnit if you disable shadow copying? The sample test I provided runs without problem when it is executed directly by NUnit, but fails if NUnit is being called by some other layer, like the TestDriven.NET plugin for Visual Studio or the NCover code coverage tool. This behavior happens in both my desktop and in our build server, and both within Visual Studio and in our command-line based build. The use of the /noshadow parameter did not affect the results. This behavior is probably linked to some difference in process or AppDomain when NUnit is executed within another tool. I wouldn't be able to tell what is the difference, though. It only affects testing of IronPython code, and only when the "import" command is used in the script. The exception is raised at line 276 of CallSite.cs: result = caller(ruleTarget, site, args); In the stack trace it appears as (line breaks added): Microsoft.Scripting.Core.dll!Microsoft.Scripting.Actions.CallSite >.UpdateAndExecute(object[] args = {object[6]}) Line 276 C# "caller" is: - caller {Method = {System.Object Call6[CodeContext,Object,String,IAttributesCollection,IAttributesCollection,PythonTuple,Object](Microsoft.Func`8[Microsoft.Scripting.Actions.CallSite,Microsoft.Scripting.Runtime.CodeContext, System.Object,System.String,Microsoft.Scripting.IAttributesCollection,Microsoft.Scripting.IAttributesCollection, IronPython.Runtime.PythonTuple,System.Object], Microsoft.Scripting.Actions.CallSite, System.Object[])}} Microsoft.Scripting.Actions.MatchCallerTarget> And the Call6 function is: /// Matchcaller - arity 6 internal static object Call6(Func target, CallSite site, object[] args) { return (object)target(site, (T0)args[0], (T1)args[1], (T2)args[2], (T3)args[3], (T4)args[4], (T5)args[5]); } But a breakpoint set at Call6 never is reached while debugging this issue. From Jimmy.Schementi at microsoft.com Tue Sep 30 17:57:00 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 30 Sep 2008 08:57:00 -0700 Subject: [IronPython] Anyone have IronPython running on Silverlight RC0 yet? In-Reply-To: References: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489FEB92C0@NA-EXMSG-C116.redmond.corp.microsoft.com> Yep, just packaging stuff up and testing it out now ... > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, September 30, 2008 2:32 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Anyone have IronPython running on Silverlight > RC0 yet? > > Hi Dan, > > I think the assemblies for RC0 are being finalised so should be > released shortly. Not sure how long this process takes, should only be > a few days. > > > Thanks > > Ben > Blog.BenHall.me.uk > > > > On Tue, Sep 30, 2008 at 3:20 AM, Dan Eloff wrote: > > It was easy to build the latest sources with silverlight rc0, but > > there seems to be some issues using the resulting binaries. > > > > InitializeError- Failed to load the application. It was built with an > > obsolete version of Silverlight > > > > I went back and uninstalled silverlight and silverlight sdk + tools, > > and physically deleted C:/Program Files/Microsoft SDKs/Silverlight. I > > reinstalled, rebuilt everything, but no luck. The only thing I could > > have from an older silverlight is I kept the old chiron.exe.config > > file, but I don't buy that it's the problem. > > > > The error here is not very helpful since it's impossible for the > > binaries to have been built with anything but the very latest > > silverlight version. > > > > I'm not sure what's going on here. Is IronPython supposed to be able > > to work with RC0 in it's current state? Jimmy, if you're reading > this, > > have you had any success with the DLR on RC0? > > > > -Dan > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Tue Sep 30 18:12:42 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 30 Sep 2008 09:12:42 -0700 Subject: [IronPython] Anyone have IronPython running on Silverlight RC0 yet? In-Reply-To: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> References: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A328489FEB92DA@NA-EXMSG-C116.redmond.corp.microsoft.com> BTW, things do build correctly, and you build from the current sources things will definitely work in Silverlight 2 RC0. The "obsolete version of Silverlight" error is because in the XAP file, the AppManifest.xaml has the RuntimeVersion for beta2, not rc0. If you're using Chiron, open Chiron.exe.config and in the section edit the RuntimeVersion to be "2.0.30923.0". Also, make sure the "type" property of the object tag in your HTML page is set to "application/x-silverlight-2", and NOT "application/x-silverlight-2-b2". ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, September 29, 2008 7:20 PM > To: Discussion of IronPython > Subject: [IronPython] Anyone have IronPython running on Silverlight RC0 > yet? > > It was easy to build the latest sources with silverlight rc0, but > there seems to be some issues using the resulting binaries. > > InitializeError- Failed to load the application. It was built with an > obsolete version of Silverlight > > I went back and uninstalled silverlight and silverlight sdk + tools, > and physically deleted C:/Program Files/Microsoft SDKs/Silverlight. I > reinstalled, rebuilt everything, but no luck. The only thing I could > have from an older silverlight is I kept the old chiron.exe.config > file, but I don't buy that it's the problem. > > The error here is not very helpful since it's impossible for the > binaries to have been built with anything but the very latest > silverlight version. > > I'm not sure what's going on here. Is IronPython supposed to be able > to work with RC0 in it's current state? Jimmy, if you're reading this, > have you had any success with the DLR on RC0? > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dfugate at microsoft.com Tue Sep 30 21:12:48 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Tue, 30 Sep 2008 12:12:48 -0700 Subject: [IronPython] What happened to source drops? In-Reply-To: References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: Actually there was a little confusion internally and the 40877 changeset uploaded to CodePlex yesterday corresponds to our new IronPython 2.1 branch. In turn, the 2.1 branch was the reason there's been no source pushes for the past two weeks - some scripts and TFS enlistments needed updating to re-enable IP 2.0 source updates. The latest update, changeset 40917, comes from our IronPython 2.0 branch and does not yet include most of the fixes in changeset 40877. If you want these now (and possibly some changes that won't be making it into IP 2.0), use http://www.codeplex.com/IronPython/SourceControl/DownloadSourceCode.aspx?changeSetId=40877. Otherwise, we hope to have the fixes included in TFS within a week. Sorry for any confusion about this. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Srivatsn Narayanan Sent: Monday, September 29, 2008 3:12 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? I've pushed out a source drop with the latest sources - http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, September 29, 2008 2:40 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? I would actually suggest compiling the standard modules as well as your code and then ngen them both on install. You can compile the std modules into their own .dll so the user can always replace them w/ their own version (or they can simply delete the DLL and then pick up the .py files). The reason I suggest this is with the bits on my machine I'm seeing massive import speed ups w/ pre-compilation + ngen (e.g. 3x or so). And decimal does import a lot more - but the real working set hit came from publishing all the SymbolIDs for every precompiled module - once for each module - on startup! A small oversight :)... But there were a few other areas that could use some improvement as well. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, September 29, 2008 2:30 PM To: Discussion of IronPython Subject: Re: [IronPython] What happened to source drops? Dino Viehland wrote: > They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. > Cool - thanks. 550mb for one module - wow. Good job we aren't intending to precompile the Python standard library modules we're using. Having said that we have quite a chunk of Python source we would like to compile - I wonder if a 4gb address space will be enough. I think we will be reluctant to move to 64bit oses only... ;-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:15 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >> >> > > Cool. If you get the compiling packages fixes into a code drop please > let me know so that we can start testing them early. > > Thanks > > Michael Foord > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, September 29, 2008 1:23 PM >> To: Discussion of IronPython >> Subject: [IronPython] What happened to source drops? >> >> I'm noticing that the last source drop was the beta 5 release two weeks ago. >> >> I don't mean to pressure you guys, but I am looking forward to the >> next source release, which seems to have the delegate regressions >> fixed. Any (vague) idea of when regular source drops will be resumed? >> >> By the way, I built IronPython b5 for Silverlight RC0, and I had to >> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >> >> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >> >> I'm not fully sure how this code compiled in the first place, as >> ScriptObject never had an AppendChild method. Probably this code has >> already been fixed, but it's worth checking anyway. >> >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Sep 30 21:16:37 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 30 Sep 2008 20:16:37 +0100 Subject: [IronPython] What happened to source drops? In-Reply-To: References: <4817b6fc0809291323k52a7dc6cj9976fcb5ac6ce290@mail.gmail.com> <350E7D38B6D819428718949920EC235547877B9A24@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E14564.1050403@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A48@NA-EXMSG-C102.redmond.corp.microsoft.com> <48E148C3.9030207@voidspace.org.uk> <350E7D38B6D819428718949920EC235547877B9A65@NA-EXMSG-C102.redmond.corp.microsoft.com> Message-ID: <48E27B15.3010701@voidspace.org.uk> Dave Fugate wrote: > Actually there was a little confusion internally and the 40877 changeset uploaded to CodePlex yesterday corresponds to our new IronPython 2.1 branch. In turn, the 2.1 branch was the reason there's been no source pushes for the past two weeks - some scripts and TFS enlistments needed updating to re-enable IP 2.0 source updates. > > The latest update, changeset 40917, comes from our IronPython 2.0 branch and does not yet include most of the fixes in changeset 40877. If you want these now (and possibly some changes that won't be making it into IP 2.0), use http://www.codeplex.com/IronPython/SourceControl/DownloadSourceCode.aspx?changeSetId=40877. Otherwise, we hope to have the fixes included in TFS within a week. Sorry for any confusion about this. > > No problem. Any ETA on getting the features that will make it in to 2.0 available in a code drop? Are the 'compiling packages' fixes in the current 2.0 branch code drop? Michael > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Srivatsn Narayanan > Sent: Monday, September 29, 2008 3:12 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > I've pushed out a source drop with the latest sources - http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, September 29, 2008 2:40 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > I would actually suggest compiling the standard modules as well as your code and then ngen them both on install. You can compile the std modules into their own .dll so the user can always replace them w/ their own version (or they can simply delete the DLL and then pick up the .py files). > > The reason I suggest this is with the bits on my machine I'm seeing massive import speed ups w/ pre-compilation + ngen (e.g. 3x or so). > > And decimal does import a lot more - but the real working set hit came from publishing all the SymbolIDs for every precompiled module - once for each module - on startup! A small oversight :)... But there were a few other areas that could use some improvement as well. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 29, 2008 2:30 PM > To: Discussion of IronPython > Subject: Re: [IronPython] What happened to source drops? > > Dino Viehland wrote: > >> They're checked in so they'll be in the next source push. There are some perf problems that I have fixes for though that aren't checked in (e.g. import decimal in pre-compiled currently allocates ~550MB of memory) - but you should be able to do functional testing :). I'll should have the pre-comp perf fixes in this week. >> >> > > Cool - thanks. 550mb for one module - wow. Good job we aren't intending > to precompile the Python standard library modules we're using. Having > said that we have quite a chunk of Python source we would like to > compile - I wonder if a 4gb address space will be enough. I think we > will be reluctant to move to 64bit oses only... ;-) > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, September 29, 2008 2:15 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] What happened to source drops? >> >> Dino Viehland wrote: >> >> >>> It looks like the script which automatically publishes the code has stopped publishing the updates. Dave's OOF today and I can't find the original instructions but Sri's looking into it. >>> >>> >>> >> Cool. If you get the compiling packages fixes into a code drop please >> let me know so that we can start testing them early. >> >> Thanks >> >> Michael Foord >> >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >>> Sent: Monday, September 29, 2008 1:23 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] What happened to source drops? >>> >>> I'm noticing that the last source drop was the beta 5 release two weeks ago. >>> >>> I don't mean to pressure you guys, but I am looking forward to the >>> next source release, which seems to have the delegate regressions >>> fixed. Any (vague) idea of when regular source drops will be resumed? >>> >>> By the way, I built IronPython b5 for Silverlight RC0, and I had to >>> modify Microsoft.Scripting.Silverlight.ErrorFormatter: >>> >>> - HtmlPage.Document.GetElementsByTagName("body")[0].AppendChild(target); >>> + ((HtmlElement)HtmlPage.Document.GetElementsByTagName("body")[0]).AppendChild(target); >>> >>> I'm not fully sure how this code compiled in the first place, as >>> ScriptObject never had an AppendChild method. Probably this code has >>> already been fixed, but it's worth checking anyway. >>> >>> -Dan >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From codekaizen at gmail.com Tue Sep 30 22:28:05 2008 From: codekaizen at gmail.com (CodeKaizen) Date: Tue, 30 Sep 2008 13:28:05 -0700 Subject: [IronPython] Execv in the CPython 'os' module Message-ID: Hi all - I've been baffled by this problem for months, since I can't find it addressed anywhere, and have worked around it by using System.Diagnostics.Process or switching to powershell, but decided to get to the bottom of what is going on. I can import the 'os' module, from which I want to use 'execvp' or similar, and it appears everything delegates down to 'execv' at some point, and that's when I get this error: "NameError: name 'execv' is not defined." When I do a 'dir(os)', sure enough, it's not there. Is it looking for the system call 'execv' at this point? I'm still a bit green on Python yet, and I'm wondering if I can write my own 'execv' function and "attach" it to the 'os' module by adding it to the name table or something. Thanks, -rory -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Tue Sep 30 22:34:45 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 30 Sep 2008 13:34:45 -0700 Subject: [IronPython] Execv in the CPython 'os' module In-Reply-To: References: Message-ID: For IronPython as for CPython running under Windows, the underlying implementation of the (pure Python) os module is largely contained in the "nt" module. That's where execv and execve would be if they were implemented -- which, as you've pointed out, they're not. Yet. So that's probably where you'd want to "monkey patch" IronPython, possibly running code like the following from site.py: import nt # defining these as appropriate def execv(*args): pass def execve(*args): pass nt.execv = execv nt.execve = execve Then when you import os, it should pickup these definitions from the nt module. There should be an entry in CodePlex that says "implement nt.execv and nt.execve", but if there's not, please feel free to add one. On Tue, Sep 30, 2008 at 1:28 PM, CodeKaizen wrote: > Hi all - > > I've been baffled by this problem for months, since I can't find it > addressed anywhere, and have worked around it by using > System.Diagnostics.Process or switching to powershell, but decided to get to > the bottom of what is going on. > > I can import the 'os' module, from which I want to use 'execvp' or similar, > and it appears everything delegates down to 'execv' at some point, and > that's when I get this error: "NameError: name 'execv' is not defined." > > When I do a 'dir(os)', sure enough, it's not there. Is it looking for the > system call 'execv' at this point? I'm still a bit green on Python yet, and > I'm wondering if I can write my own 'execv' function and "attach" it to the > 'os' module by adding it to the name table or something. > > Thanks, > -rory > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Tue Sep 30 22:55:24 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 30 Sep 2008 15:55:24 -0500 Subject: [IronPython] Anyone have IronPython running on Silverlight RC0 yet? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A328489FEB92DA@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0809291920t6b5794afob9b5187cd2627f21@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A328489FEB92DA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0809301355s24e1441bufd6eb7f90d739bc6@mail.gmail.com> On Tue, Sep 30, 2008 at 11:12 AM, Jimmy Schementi wrote: > The "obsolete version of Silverlight" error is because in the XAP file, the AppManifest.xaml has the RuntimeVersion for beta2, not rc0. If you're using Chiron, open Chiron.exe.config and in the section edit the RuntimeVersion to be "2.0.30923.0". > Thanks!! That was exactly the problem. You should post that on your blog, I'm probably not the only one wondering why things weren't working. -Dan