From no_reply at codeplex.com Thu Mar 1 13:14:28 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 1 Mar 2012 04:14:28 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/29/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] json.dump fails to dump Unicode strings 2. [New issue] Traceback is lost when ImportError is re-raised 3. [New comment] Traceback is lost when ImportError is re-raised 4. [New issue] zipimport adding an extra newline to the end of every line of imported source on windows 5. [New comment] zipimport adding an extra newline to the end of every line of imported source on windows ---------------------------------------------- ISSUES 1. [New issue] json.dump fails to dump Unicode strings http://ironpython.codeplex.com/workitem/32331 User pekkaklarck has proposed the issue: "Demonstration of the problem is below. With CPython this works fine and the result is, as expected "\u00e4". IronPython 2.7 (2.7.0.40) on .NET 4.0.30319.261 Type "help", "copyright", "credits" or "license" for more information. >>> import json >>> from StringIO import StringIO >>> s = StringIO() >>> json.dump(u'\xe4', s) Traceback (most recent call last): File "C:\Program Files\IronPython 2.7\Lib\json\encoder.py", line 413, in _iterencode File "", line 1, in File "C:\Program Files\IronPython 2.7\Lib\json\__init__.py", line 181, in dump File "C:\Program Files\IronPython 2.7\Lib\json\encoder.py", line 48, in py_encode_basestring_ascii UnicodeDecodeError: ('unknown', u'\xe4', -1, 0, '')"----------------- 2. [New issue] Traceback is lost when ImportError is re-raised http://ironpython.codeplex.com/workitem/32332 User pekkaklarck has proposed the issue: "It seems that if ImportError is caught and then re-raised, the traceback object associated with the exception is lost and we get None instead. This doesn't occur with all exceptions and, for example, NameError, is not affected. This problem can be reproduced using the attached ipy_tb_bug.py script. When I run it with CPython I get this output: NameError: ImportError: With IronPython 2.7 I get this instead: NameError: ImportError: None Notice also that even with NameError the traceback object is different with IronPython but CPython re-uses the same object. Not sure does that really matter but it might have something to do with the problem with ImportError. A workaround for this bug is re-raising the exception using `raise sys.exc_value, sys.exc_type, sys.exc_traceback` instead of plain `raise`."----------------- 3. [New comment] Traceback is lost when ImportError is re-raised http://ironpython.codeplex.com/workitem/32332 User pekkaklarck has commented on the issue: "Ooops, values given to raise statement in the above workaround were wrong. The correct order is: raise sys.exc_type, sys.exc_value, sys.exc_traceback"----------------- 4. [New issue] zipimport adding an extra newline to the end of every line of imported source on windows http://ironpython.codeplex.com/workitem/32335 User bmvetter has proposed the issue: "On Windows, zipimport is adding an extra newline to the end of every line of imported source. I found this because the extra blank lines cause many of the standard library modules to fail when trying to import them from a zip file. This is reproducible by trying to import warnings.py from a .zip file. I think the problem is in NormalizeLineEndings in ZipImport.cs where it replaces \r\n with \n\n instead of just \n."----------------- 5. [New comment] zipimport adding an extra newline to the end of every line of imported source on windows http://ironpython.codeplex.com/workitem/32335 User slide_o_mix has commented on the issue: "Can you upload a test case? I have a fix but would like to test it first." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Thu Mar 1 21:13:13 2012 From: cmello at gmail.com (Cesar Mello) Date: Thu, 1 Mar 2012 17:13:13 -0300 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: Hey guys! Just curious: is there a way to implement in the .NET class something that maps to the ** operator? I've tried the other way: calling into a Python function that works as a factory of proxy objects. These proxies overload the arithmetic operators and delegates everything to the real (.NET) class. The user is given access to the proxies in the expressions instead of the real objects. It works, but performance suffers. (My performance target right now is 20.000 expression evaluations / second). Thank you very much for the attention! Best regards Mello On Fri, Feb 24, 2012 at 5:17 PM, Jeff Hardy wrote: > On Fri, Feb 24, 2012 at 12:00 PM, Cesar Mello wrote: > > Thank you very much for the quick response Jeff! > > > > First, let me clarify I am a Python newbie, so my assumptions about > Python > > may be all wrong. > > > > I had tried __float__ in a Python object, but it does not work implicitly > > inside expressions (and I think that's the correct behavior). You still > have > > to use float(a) for the conversion to be used. > > > > Now I implemented the C# implicit conversion to double() and I get the > same > > behavior (it works if I use float(a) in the expression but if I use a * > 5.0 > > for example I get the error: "unsupported operand type(s) for *: > 'DataValue' > > and 'float'. > > Ah, you missed this first part: you'll need to overload the arithmetic > operators for your objects. > > Python: Define __add__, __sub__, etc. > (http://docs.python.org/reference/datamodel.html#object.__add__) > C#: Define operator+, operator-, etc. > (http://msdn.microsoft.com/en-us/library/aa288467(v=vs.71).aspx) > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuomas.utrecht at gmail.com Thu Mar 1 21:31:39 2012 From: tuomas.utrecht at gmail.com (Tuomas Utrecht) Date: Thu, 1 Mar 2012 15:31:39 -0500 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython Message-ID: Hello, I apologize if this has been answered elsewhere, but I am unable to find anything up to date, or that covers my question in particular. The short version is: Can I modify the AST of a parsed file before compiling/executing in an embedded context? I want to allow simple, Excel-like statements to be executed from a .NET application. One major hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I would be able to catch calls to ^ and replace with ** at compile time. If this is just not possible without rebuilding IronPython, do let me know. I have gotten as far as the below, although the BinaryExpression node's Operator is only gettable. I also am unsure how to take an AST and compile it, or if that is even public/allowed. var engine = Python.CreateEngine(); var s = HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); var cc = new CompilerContext(s, new PythonCompilerOptions(), ErrorSink.Default); var p = Parser.CreateParser(cc, new PythonOptions()); PythonAst ast = p.ParseFile(false); // I originally tried this with a PythonWalker, but this is more succinct for the purpose of this example SuiteStatement body = (SuiteStatement)ast.Body; ExpressionStatement st = (ExpressionStatement)body.Statements[0]; BinaryExpression exp = (BinaryExpression) st.Expression; //exp.Operator = PythonOperator.Power; // Were it only so easy... Thanks for reading! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Thu Mar 1 21:37:49 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 1 Mar 2012 12:37:49 -0800 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello wrote: > Hey guys! > > Just curious: is there a way to implement in the .NET class something that > maps to the ** operator? You should be able to create a method called __pow__ like so: public object __pow__(object b, object e) { ... } Replace object with whatever types you're working with. - Jeff From cmello at gmail.com Thu Mar 1 22:31:44 2012 From: cmello at gmail.com (Cesar Mello) Date: Thu, 1 Mar 2012 18:31:44 -0300 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: It worked perfectly and fast! Thank you so much!!!! Best regards Mello On Thu, Mar 1, 2012 at 5:37 PM, Jeff Hardy wrote: > On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello wrote: > > Hey guys! > > > > Just curious: is there a way to implement in the .NET class something > that > > maps to the ** operator? > > You should be able to create a method called __pow__ like so: > public object __pow__(object b, object e) { ... } > > Replace object with whatever types you're working with. > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Mar 1 22:58:15 2012 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 1 Mar 2012 21:58:15 +0000 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CEAC1C@TK5EX14MBXC293.redmond.corp.microsoft.com> The ASTs are generally immutable so to re-write you'll create a copy of the AST and any parent nodes. The ExpressionVisitor class makes this easy in that you can override VisitExtension method and re-write any Python nodes you care about there. You return a modified node somewhere within the tree and then the rest of the tree will be re-written for you and you get it back out after the visitor completes. Overall I'd say you might be able to make this work, but you might also hit a wall and need to tweak Ipy a little bit so you can actually compile the re-written code in a useful way. I'm thinking you might start running into internal APIs when you start trying to create a ScriptCode or compile it, but I'm not 100% certain. From: ironpython-users-bounces+dinov=exchange.microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] On Behalf Of Tuomas Utrecht Sent: Thursday, March 01, 2012 12:32 PM To: ironpython-users at python.org Subject: [Ironpython-users] Modifying ASTs when embedding IronPython Hello, I apologize if this has been answered elsewhere, but I am unable to find anything up to date, or that covers my question in particular. The short version is: Can I modify the AST of a parsed file before compiling/executing in an embedded context? I want to allow simple, Excel-like statements to be executed from a .NET application. One major hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I would be able to catch calls to ^ and replace with ** at compile time. If this is just not possible without rebuilding IronPython, do let me know. I have gotten as far as the below, although the BinaryExpression node's Operator is only gettable. I also am unsure how to take an AST and compile it, or if that is even public/allowed. var engine = Python.CreateEngine(); var s = HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); var cc = new CompilerContext(s, new PythonCompilerOptions(), ErrorSink.Default); var p = Parser.CreateParser(cc, new PythonOptions()); PythonAst ast = p.ParseFile(false); // I originally tried this with a PythonWalker, but this is more succinct for the purpose of this example SuiteStatement body = (SuiteStatement)ast.Body; ExpressionStatement st = (ExpressionStatement)body.Statements[0]; BinaryExpression exp = (BinaryExpression) st.Expression; //exp.Operator = PythonOperator.Power; // Were it only so easy... Thanks for reading! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Mar 1 22:59:18 2012 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 1 Mar 2012 21:59:18 +0000 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CEAC43@TK5EX14MBXC293.redmond.corp.microsoft.com> We also might recognize something like op_Power or Power if the method has [SpecialName] attribute, but I'm not 100% certain if that's still there. > -----Original Message----- > From: ironpython-users-bounces+dinov=microsoft.com at python.org > [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On > Behalf Of Jeff Hardy > Sent: Thursday, March 01, 2012 12:38 PM > To: Cesar Mello > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] Implicit conversion of objects to float > > On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello wrote: > > Hey guys! > > > > Just curious: is there a way to implement in the .NET class something > > that maps to the ** operator? > > You should be able to create a method called __pow__ like so: > public object __pow__(object b, object e) { ... } > > Replace object with whatever types you're working with. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From tuomas.utrecht at gmail.com Fri Mar 2 01:01:17 2012 From: tuomas.utrecht at gmail.com (Tuomas Utrecht) Date: Thu, 1 Mar 2012 19:01:17 -0500 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CEAC1C@TK5EX14MBXC293.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CEAC1C@TK5EX14MBXC293.redmond.corp.microsoft.com> Message-ID: Ok, I'm going to read up on this, but to confirm, I'd need something like the following (from reading http://stackoverflow.com/questions/7944521/interrupt-interpreted-user-code-in-silverlight )? public class ExpressionRewriter : ExpressionVisitor { protected override Expression VisitBinary(BinaryExpression node) { ... } } ExpressionVisitor comes from System.Linq.Expressions? I see BinaryExpression in both System.Linq.Expressions and IronPython.Compiler.Ast. I don't see that I can override the above unless I use the Linq one. I will look into Ipy's code further, but I thought I'd pose these questions. Thank you for your guidance. Le 1 mars 2012 16:58, Dino Viehland a ?crit : > The ASTs are generally immutable so to re-write you?ll create a copy of > the AST and any parent nodes. The ExpressionVisitor class makes this easy > in that you can override VisitExtension method and re-write any Python > nodes you care about there. You return a modified node somewhere within > the tree and then the rest of the tree will be re-written for you and you > get it back out after the visitor completes.**** > > ** ** > > Overall I?d say you might be able to make this work, but you might also > hit a wall and need to tweak Ipy a little bit so you can actually compile > the re-written code in a useful way. I?m thinking you might start running > into internal APIs when you start trying to create a ScriptCode or compile > it, but I?m not 100% certain. **** > > ** ** > > *From:* ironpython-users-bounces+dinov=exchange.microsoft.com at python.org[mailto: > ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] *On > Behalf Of *Tuomas Utrecht > *Sent:* Thursday, March 01, 2012 12:32 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] Modifying ASTs when embedding IronPython**** > > ** ** > > Hello, > > I apologize if this has been answered elsewhere, but I am unable to find > anything up to date, or that covers my question in particular. > > The short version is: Can I modify the AST of a parsed file before > compiling/executing in an embedded context? I want to allow simple, > Excel-like statements to be executed from a .NET application. One major > hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I > would be able to catch calls to ^ and replace with ** at compile time. > > If this is just not possible without rebuilding IronPython, do let me know. > > I have gotten as far as the below, although the BinaryExpression node's > Operator is only gettable. I also am unsure how to take an AST and compile > it, or if that is even public/allowed. > > var engine = Python.CreateEngine(); > var s = > HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); > var cc = new CompilerContext(s, new PythonCompilerOptions(), > ErrorSink.Default); > var p = Parser.CreateParser(cc, new PythonOptions()); > PythonAst ast = p.ParseFile(false); > > // I originally tried this with a PythonWalker, but this is more > succinct for the purpose of this example > SuiteStatement body = (SuiteStatement)ast.Body; > ExpressionStatement st = (ExpressionStatement)body.Statements[0]; > BinaryExpression exp = (BinaryExpression) st.Expression; > //exp.Operator = PythonOperator.Power; // Were it only so easy... > > > Thanks for reading!**** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Mar 2 01:57:56 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 2 Mar 2012 00:57:56 +0000 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54CEAC1C@TK5EX14MBXC293.redmond.corp.microsoft.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CF90EF@TK5EX14MBXC294.redmond.corp.microsoft.com> Yep, but all of the main IronPython nodes will show up as an extension node so you'll want to override VisitExtension instead of VisitBinary. VisitBinary is for simple binary operations such as adding two primitive values and doesn't include dynamic binary operations. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Tuomas Utrecht Sent: Thursday, March 01, 2012 4:01 PM To: ironpython-users at python.org Subject: Re: [Ironpython-users] Modifying ASTs when embedding IronPython Ok, I'm going to read up on this, but to confirm, I'd need something like the following (from reading http://stackoverflow.com/questions/7944521/interrupt-interpreted-user-code-in-silverlight)? public class ExpressionRewriter : ExpressionVisitor { protected override Expression VisitBinary(BinaryExpression node) { ... } } ExpressionVisitor comes from System.Linq.Expressions? I see BinaryExpression in both System.Linq.Expressions and IronPython.Compiler.Ast. I don't see that I can override the above unless I use the Linq one. I will look into Ipy's code further, but I thought I'd pose these questions. Thank you for your guidance. Le 1 mars 2012 16:58, Dino Viehland > a ?crit : The ASTs are generally immutable so to re-write you'll create a copy of the AST and any parent nodes. The ExpressionVisitor class makes this easy in that you can override VisitExtension method and re-write any Python nodes you care about there. You return a modified node somewhere within the tree and then the rest of the tree will be re-written for you and you get it back out after the visitor completes. Overall I'd say you might be able to make this work, but you might also hit a wall and need to tweak Ipy a little bit so you can actually compile the re-written code in a useful way. I'm thinking you might start running into internal APIs when you start trying to create a ScriptCode or compile it, but I'm not 100% certain. From: ironpython-users-bounces+dinov=exchange.microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] On Behalf Of Tuomas Utrecht Sent: Thursday, March 01, 2012 12:32 PM To: ironpython-users at python.org Subject: [Ironpython-users] Modifying ASTs when embedding IronPython Hello, I apologize if this has been answered elsewhere, but I am unable to find anything up to date, or that covers my question in particular. The short version is: Can I modify the AST of a parsed file before compiling/executing in an embedded context? I want to allow simple, Excel-like statements to be executed from a .NET application. One major hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I would be able to catch calls to ^ and replace with ** at compile time. If this is just not possible without rebuilding IronPython, do let me know. I have gotten as far as the below, although the BinaryExpression node's Operator is only gettable. I also am unsure how to take an AST and compile it, or if that is even public/allowed. var engine = Python.CreateEngine(); var s = HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); var cc = new CompilerContext(s, new PythonCompilerOptions(), ErrorSink.Default); var p = Parser.CreateParser(cc, new PythonOptions()); PythonAst ast = p.ParseFile(false); // I originally tried this with a PythonWalker, but this is more succinct for the purpose of this example SuiteStatement body = (SuiteStatement)ast.Body; ExpressionStatement st = (ExpressionStatement)body.Statements[0]; BinaryExpression exp = (BinaryExpression) st.Expression; //exp.Operator = PythonOperator.Power; // Were it only so easy... Thanks for reading! -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Mar 2 03:58:12 2012 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 1 Mar 2012 18:58:12 -0800 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: I would argue that this is a bad idea. How Python-compatible do you want this simple Excel-like language to be? If it's really just a small subset of the full Python language, you may be better off writing a simple parser that emits Python text as its back end and prevents the users from doing anything more complicated. This should not be significantly more complex than what you propose to do. If you really want to offer the full power of the Python language, then you should consider whether you are doing your users a disservice by teaching them a language that's almost the same as Python, but different in just one minor and hard-to-debug respect. On Thu, Mar 1, 2012 at 12:31 PM, Tuomas Utrecht wrote: > Hello, > > I apologize if this has been answered elsewhere, but I am unable to find > anything up to date, or that covers my question in particular. > > The short version is: Can I modify the AST of a parsed file before > compiling/executing in an embedded context? I want to allow simple, > Excel-like statements to be executed from a .NET application. One major > hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I > would be able to catch calls to ^ and replace with ** at compile time. > > If this is just not possible without rebuilding IronPython, do let me know. > > I have gotten as far as the below, although the BinaryExpression node's > Operator is only gettable. I also am unsure how to take an AST and compile > it, or if that is even public/allowed. > > var engine = Python.CreateEngine(); > var s = > HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); > var cc = new CompilerContext(s, new PythonCompilerOptions(), > ErrorSink.Default); > var p = Parser.CreateParser(cc, new PythonOptions()); > PythonAst ast = p.ParseFile(false); > > // I originally tried this with a PythonWalker, but this is more > succinct for the purpose of this example > SuiteStatement body = (SuiteStatement)ast.Body; > ExpressionStatement st = (ExpressionStatement)body.Statements[0]; > BinaryExpression exp = (BinaryExpression) st.Expression; > //exp.Operator = PythonOperator.Power; // Were it only so easy... > > > Thanks for reading! > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Fri Mar 2 06:00:53 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Thu, 1 Mar 2012 22:00:53 -0700 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: Err, ummm, ... Are you perhaps trying to reinvent Resolver 1 -- a spreadsheet written in Python? Maybe I misunderstand what you are trying to do, but you may want to look at it, unless you cannot use a commercial product. On Mar 1, 2012 7:58 PM, "Curt Hagenlocher" wrote: > I would argue that this is a bad idea. How Python-compatible do you want > this simple Excel-like language to be? If it's really just a small subset > of the full Python language, you may be better off writing a simple parser > that emits Python text as its back end and prevents the users from doing > anything more complicated. This should not be significantly more complex > than what you propose to do. If you really want to offer the full power of > the Python language, then you should consider whether you are doing your > users a disservice by teaching them a language that's almost the same as > Python, but different in just one minor and hard-to-debug respect. > > On Thu, Mar 1, 2012 at 12:31 PM, Tuomas Utrecht wrote: > >> Hello, >> >> I apologize if this has been answered elsewhere, but I am unable to find >> anything up to date, or that covers my question in particular. >> >> The short version is: Can I modify the AST of a parsed file before >> compiling/executing in an embedded context? I want to allow simple, >> Excel-like statements to be executed from a .NET application. One major >> hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I >> would be able to catch calls to ^ and replace with ** at compile time. >> >> If this is just not possible without rebuilding IronPython, do let me >> know. >> >> I have gotten as far as the below, although the BinaryExpression node's >> Operator is only gettable. I also am unsure how to take an AST and compile >> it, or if that is even public/allowed. >> >> var engine = Python.CreateEngine(); >> var s = >> HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); >> var cc = new CompilerContext(s, new PythonCompilerOptions(), >> ErrorSink.Default); >> var p = Parser.CreateParser(cc, new PythonOptions()); >> PythonAst ast = p.ParseFile(false); >> >> // I originally tried this with a PythonWalker, but this is more >> succinct for the purpose of this example >> SuiteStatement body = (SuiteStatement)ast.Body; >> ExpressionStatement st = (ExpressionStatement)body.Statements[0]; >> BinaryExpression exp = (BinaryExpression) st.Expression; >> //exp.Operator = PythonOperator.Power; // Were it only so easy... >> >> >> Thanks for reading! >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Fri Mar 2 13:42:42 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 09:42:42 -0300 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: Hi! Is it possible for a .NET class to provide a property with the Python datetime instead of System.DateTime? Thank you very much for the attention! Best regards! Mello On Thu, Mar 1, 2012 at 6:31 PM, Cesar Mello wrote: > It worked perfectly and fast! Thank you so much!!!! > > Best regards > Mello > > > On Thu, Mar 1, 2012 at 5:37 PM, Jeff Hardy wrote: > >> On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello wrote: >> > Hey guys! >> > >> > Just curious: is there a way to implement in the .NET class something >> that >> > maps to the ** operator? >> >> You should be able to create a method called __pow__ like so: >> public object __pow__(object b, object e) { ... } >> >> Replace object with whatever types you're working with. >> >> - Jeff >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Mar 2 13:48:52 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 2 Mar 2012 04:48:52 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/1/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] zipimport adding an extra newline to the end of every line of imported source on windows 2. [New comment] zipimport adding an extra newline to the end of every line of imported source on windows ---------------------------------------------- ISSUES 1. [New comment] zipimport adding an extra newline to the end of every line of imported source on windows http://ironpython.codeplex.com/workitem/32335 User bmvetter has commented on the issue: "See attached script to reproduce in 2.7.2b1. To keep it simple, the script expects the current working directory to be the ironpython folder. "----------------- 2. [New comment] zipimport adding an extra newline to the end of every line of imported source on windows http://ironpython.codeplex.com/workitem/32335 User slide_o_mix has commented on the issue: "Fixed in 4ec8359" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuomas.utrecht at gmail.com Fri Mar 2 14:31:01 2012 From: tuomas.utrecht at gmail.com (Tuomas Utrecht) Date: Fri, 2 Mar 2012 08:31:01 -0500 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: Le 1 mars 2012 21:58, Curt Hagenlocher a ?crit : > I would argue that this is a bad idea. How Python-compatible do you want > this simple Excel-like language to be? > I have body of possible Excel formulas which are identical to Python syntax, except for the use of ^. > If it's really just a small subset of the full Python language, you may be > better off writing a simple parser that emits Python text as its back end > and prevents the users from doing anything more complicated. > At the point where I can generate an AST on my own, I may be better off not even using Ipy. I'm hoping to leverage the work already done in this area. The upside to Python is the introduction of new syntax/functionality, but supporting the existing formulas is paramount. > This should not be significantly more complex than what you propose to do. > If you really want to offer the full power of the Python language, then you > should consider whether you are doing your users a disservice by teaching > them a language that's almost the same as Python, but different in just one > minor and hard-to-debug respect. > As you know, it is difficult to encourage even programmers to learn new programming languages. :) The use case here is the ability to paste something from Excel into a C# application for it to be run. Launching Excel from the application is an obvious but undesirable solution due to some third-party plug-in limitations, among other reasons. > On Thu, Mar 1, 2012 at 12:31 PM, Tuomas Utrecht wrote: > >> Hello, >> >> I apologize if this has been answered elsewhere, but I am unable to find >> anything up to date, or that covers my question in particular. >> >> The short version is: Can I modify the AST of a parsed file before >> compiling/executing in an embedded context? I want to allow simple, >> Excel-like statements to be executed from a .NET application. One major >> hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I >> would be able to catch calls to ^ and replace with ** at compile time. >> >> If this is just not possible without rebuilding IronPython, do let me >> know. >> >> I have gotten as far as the below, although the BinaryExpression node's >> Operator is only gettable. I also am unsure how to take an AST and compile >> it, or if that is even public/allowed. >> >> var engine = Python.CreateEngine(); >> var s = >> HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); >> var cc = new CompilerContext(s, new PythonCompilerOptions(), >> ErrorSink.Default); >> var p = Parser.CreateParser(cc, new PythonOptions()); >> PythonAst ast = p.ParseFile(false); >> >> // I originally tried this with a PythonWalker, but this is more >> succinct for the purpose of this example >> SuiteStatement body = (SuiteStatement)ast.Body; >> ExpressionStatement st = (ExpressionStatement)body.Statements[0]; >> BinaryExpression exp = (BinaryExpression) st.Expression; >> //exp.Operator = PythonOperator.Power; // Were it only so easy... >> >> >> Thanks for reading! >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuomas.utrecht at gmail.com Fri Mar 2 14:39:09 2012 From: tuomas.utrecht at gmail.com (Tuomas Utrecht) Date: Fri, 2 Mar 2012 08:39:09 -0500 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: No, my case is taking Excel formula strings into a C# application, redefining ^ to be ** and evaluating expressions in the context of a larger Python module which may override built-in and third-party Excel functions. Thank you for the information, though. Le 2 mars 2012 00:00, Vernon Cole a ?crit : > Err, ummm, ... > Are you perhaps trying to reinvent Resolver 1 -- a spreadsheet written in > Python? Maybe I misunderstand what you are trying to do, but you may want > to look at it, unless you cannot use a commercial product. > On Mar 1, 2012 7:58 PM, "Curt Hagenlocher" wrote: > >> I would argue that this is a bad idea. How Python-compatible do you want >> this simple Excel-like language to be? If it's really just a small subset >> of the full Python language, you may be better off writing a simple parser >> that emits Python text as its back end and prevents the users from doing >> anything more complicated. This should not be significantly more complex >> than what you propose to do. If you really want to offer the full power of >> the Python language, then you should consider whether you are doing your >> users a disservice by teaching them a language that's almost the same as >> Python, but different in just one minor and hard-to-debug respect. >> >> On Thu, Mar 1, 2012 at 12:31 PM, Tuomas Utrecht > > wrote: >> >>> Hello, >>> >>> I apologize if this has been answered elsewhere, but I am unable to find >>> anything up to date, or that covers my question in particular. >>> >>> The short version is: Can I modify the AST of a parsed file before >>> compiling/executing in an embedded context? I want to allow simple, >>> Excel-like statements to be executed from a .NET application. One major >>> hitch is that Excel uses ^ for power whereas Python uses **. Ideally, I >>> would be able to catch calls to ^ and replace with ** at compile time. >>> >>> If this is just not possible without rebuilding IronPython, do let me >>> know. >>> >>> I have gotten as far as the below, although the BinaryExpression node's >>> Operator is only gettable. I also am unsure how to take an AST and compile >>> it, or if that is even public/allowed. >>> >>> var engine = Python.CreateEngine(); >>> var s = >>> HostingHelpers.GetSourceUnit(engine.CreateScriptSourceFromString("3^4")); >>> var cc = new CompilerContext(s, new PythonCompilerOptions(), >>> ErrorSink.Default); >>> var p = Parser.CreateParser(cc, new PythonOptions()); >>> PythonAst ast = p.ParseFile(false); >>> >>> // I originally tried this with a PythonWalker, but this is more >>> succinct for the purpose of this example >>> SuiteStatement body = (SuiteStatement)ast.Body; >>> ExpressionStatement st = (ExpressionStatement)body.Statements[0]; >>> BinaryExpression exp = (BinaryExpression) st.Expression; >>> //exp.Operator = PythonOperator.Power; // Were it only so easy... >>> >>> >>> Thanks for reading! >>> >>> _______________________________________________ >>> Ironpython-users mailing list >>> Ironpython-users at python.org >>> http://mail.python.org/mailman/listinfo/ironpython-users >>> >>> >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mchalkley at mail.com Fri Mar 2 16:37:45 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Fri, 2 Mar 2012 10:37:45 -0500 Subject: [Ironpython-users] Distributing apps Message-ID: <536820758.20120302103745@mail.com> Apologies in advance for the newbie question, especially if this has been covered 73 times already (I did spend a hour searching online and in the IPy documentation before resorting to this mailing list)... Is there a tutorial, overview, or how-to anywhere that describes how to distribute IronPython apps (console is fine, to start with) to .NET machines that don't have IronPython installed on them? I'm using Visual Studio 2010, and have installed the 2.7.2 Beta and the VS SDK. I can get it to run on my machine via the "ipy app.py" command, but that's only because I have the "C:\Program Files (x86)\IronPython 2.7\" directory on my machine, I suspect. (I've got the sys.path.append lines, the relevant clr.AddReference and import lines, etc., I think, but obviously they have to get bundled in the distributable...) I see the reference to the new pyc.py in the 2.7.2 beta, but I'm not sure if that's what I need or how to use it. Sorry for the long-winded question, but I just wanted to be clear that I've gotten a ways and worked on this for a while, so if I'm missing something really obvious, I'm going to be very embarrassed... :) Thanks, Mark From jdhardy at gmail.com Fri Mar 2 17:24:30 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 08:24:30 -0800 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: On Fri, Mar 2, 2012 at 4:42 AM, Cesar Mello wrote: > Hi! > > Is it possible for a .NET class to provide a property with the Python > datetime instead of System.DateTime? Yep - just use PythonDateTime.datetime, in the IronPython.Modules namespace. - Jeff > > Thank you very much for the attention! > > Best regards! > Mello > > > > On Thu, Mar 1, 2012 at 6:31 PM, Cesar Mello wrote: >> >> It worked perfectly and fast! Thank you so much!!!! >> >> Best regards >> Mello >> >> >> On Thu, Mar 1, 2012 at 5:37 PM, Jeff Hardy wrote: >>> >>> On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello wrote: >>> > Hey guys! >>> > >>> > Just curious: is there a way to implement in the .NET class something >>> > that >>> > maps to the ** operator? >>> >>> You should be able to create a method called __pow__ like so: >>> ? ?public object __pow__(object b, object e) { ... } >>> >>> Replace object with whatever types you're working with. >>> >>> - Jeff >> >> > From jdhardy at gmail.com Fri Mar 2 17:26:56 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 08:26:56 -0800 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: On Fri, Mar 2, 2012 at 5:31 AM, Tuomas Utrecht wrote: > I have body of possible Excel formulas which are identical to Python syntax, > except for the use of ^. If that's the case, why not rewrite them as strings instead (i.e. s/^/**/g), and then pass them to IronPython? - Jeff From jdhardy at gmail.com Fri Mar 2 17:37:20 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 08:37:20 -0800 Subject: [Ironpython-users] Distributing apps In-Reply-To: <536820758.20120302103745@mail.com> References: <536820758.20120302103745@mail.com> Message-ID: On Fri, Mar 2, 2012 at 7:37 AM, wrote: > Apologies in advance for the newbie question, especially if this has > been covered 73 times already (I did spend a hour searching online and > in the IPy documentation before resorting to this mailing list)... It does come up once in a while, and maybe someday I'll write some documentation explaining how to do it. Also, it's a lot better in 2.7.2, so things have changed a bit in the last month. > > I see the reference to the new pyc.py in the 2.7.2 beta, but I'm not > sure if that's what I need or how to use it. That's exactly what you need. What you want is something similar to: ipy %ipyroot%\Tools\Scripts\pyc.py /target:exe /standalone /main:foo.py bar.py etc.py Replace %ipyroot% with wherever you have IronPython installed. And let us know if it doesn't work for you, either. > > Sorry for the long-winded question, but I just wanted to be clear that > I've gotten a ways and worked on this for a while, so if I'm missing > something really obvious, I'm going to be very embarrassed... :) No, it's not obvious, nor is it documented. It's one of things I'd like to see done before 2.7.2 final. - Jeff From cmello at gmail.com Fri Mar 2 17:53:18 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 13:53:18 -0300 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: Hey thanks so much for the great help! It worked perfectly. Thanks! Best regards!!! Mello On Fri, Mar 2, 2012 at 1:24 PM, Jeff Hardy wrote: > On Fri, Mar 2, 2012 at 4:42 AM, Cesar Mello wrote: > > Hi! > > > > Is it possible for a .NET class to provide a property with the Python > > datetime instead of System.DateTime? > > Yep - just use PythonDateTime.datetime, in the IronPython.Modules > namespace. > > - Jeff > > > > > Thank you very much for the attention! > > > > Best regards! > > Mello > > > > > > > > On Thu, Mar 1, 2012 at 6:31 PM, Cesar Mello wrote: > >> > >> It worked perfectly and fast! Thank you so much!!!! > >> > >> Best regards > >> Mello > >> > >> > >> On Thu, Mar 1, 2012 at 5:37 PM, Jeff Hardy wrote: > >>> > >>> On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello wrote: > >>> > Hey guys! > >>> > > >>> > Just curious: is there a way to implement in the .NET class something > >>> > that > >>> > maps to the ** operator? > >>> > >>> You should be able to create a method called __pow__ like so: > >>> public object __pow__(object b, object e) { ... } > >>> > >>> Replace object with whatever types you're working with. > >>> > >>> - Jeff > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Fri Mar 2 17:54:54 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 13:54:54 -0300 Subject: [Ironpython-users] timedelta.total_seconds() Message-ID: Hi! This method doesn't seem to be implemented. From http://docs.python.org/library/datetime.html : timedelta.total_seconds() Return the total number of seconds contained in the duration. Equivalent to (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 computed with true division enabled. Note that for very large time intervals (greater than 270 years on most platforms) this method will lose microsecond accuracy. New in version 2.7. Best regards! Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Mar 2 18:10:37 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 09:10:37 -0800 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: Just an oversight. Can you open an issue on ironpython.codeplex.com? Should be easy enough to get this in. If you're up to it, a pull request would be even better :) - Jeff On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: > Hi! > > This method doesn't seem to be implemented. From > http://docs.python.org/library/datetime.html : > timedelta.total_seconds() > > Return the total number of seconds contained in the duration. Equivalent to > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 > computed with true division enabled. > > Note that for very large time intervals (greater than 270 years on most > platforms) this method will lose microsecond accuracy. > > New in version 2.7. > > > Best regards! > Mello > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From slide.o.mix at gmail.com Fri Mar 2 18:14:46 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 2 Mar 2012 10:14:46 -0700 Subject: [Ironpython-users] Distributing apps In-Reply-To: References: <536820758.20120302103745@mail.com> Message-ID: Do we currently have a wiki? On Fri, Mar 2, 2012 at 9:37 AM, Jeff Hardy wrote: > On Fri, Mar 2, 2012 at 7:37 AM, wrote: > > Apologies in advance for the newbie question, especially if this has > > been covered 73 times already (I did spend a hour searching online and > > in the IPy documentation before resorting to this mailing list)... > > It does come up once in a while, and maybe someday I'll write some > documentation explaining how to do it. Also, it's a lot better in > 2.7.2, so things have changed a bit in the last month. > > > > > I see the reference to the new pyc.py in the 2.7.2 beta, but I'm not > > sure if that's what I need or how to use it. > > That's exactly what you need. What you want is something similar to: > > ipy %ipyroot%\Tools\Scripts\pyc.py /target:exe /standalone > /main:foo.py bar.py etc.py > > Replace %ipyroot% with wherever you have IronPython installed. And let > us know if it doesn't work for you, either. > > > > > Sorry for the long-winded question, but I just wanted to be clear that > > I've gotten a ways and worked on this for a while, so if I'm missing > > something really obvious, I'm going to be very embarrassed... :) > > No, it's not obvious, nor is it documented. It's one of things I'd > like to see done before 2.7.2 final. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mchalkley at mail.com Fri Mar 2 18:33:44 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Fri, 2 Mar 2012 12:33:44 -0500 Subject: [Ironpython-users] Distributing apps In-Reply-To: References: <536820758.20120302103745@mail.com> Message-ID: <1267062163.20120302123344@mail.com> Friday, March 2, 2012, 11:37:20 AM, you wrote: > On Fri, Mar 2, 2012 at 7:37 AM, wrote: >> Apologies in advance for the newbie question, especially if this has >> been covered 73 times already (I did spend a hour searching online and >> in the IPy documentation before resorting to this mailing list)... > It does come up once in a while, and maybe someday I'll write some > documentation explaining how to do it. Also, it's a lot better in > 2.7.2, so things have changed a bit in the last month. >> >> I see the reference to the new pyc.py in the 2.7.2 beta, but I'm not >> sure if that's what I need or how to use it. > That's exactly what you need. What you want is something similar to: > ipy %ipyroot%\Tools\Scripts\pyc.py /target:exe /standalone > /main:foo.py bar.py etc.py > Replace %ipyroot% with wherever you have IronPython installed. And let > us know if it doesn't work for you, either. >> >> Sorry for the long-winded question, but I just wanted to be clear that >> I've gotten a ways and worked on this for a while, so if I'm missing >> something really obvious, I'm going to be very embarrassed... :) > No, it's not obvious, nor is it documented. It's one of things I'd > like to see done before 2.7.2 final. > - Jeff Ok, thanks - that got me a long ways past where I was. The exe that it builds doesn't include the standard python library stuff, like string, even though it's in an import statement. So do I have to explicitly include everything like that (datetime, sys, re, etc) in the pyc.py command, or is there a better way to do it? Thanks again, Mark From jdhardy at gmail.com Fri Mar 2 18:56:17 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 09:56:17 -0800 Subject: [Ironpython-users] IronPython Documentation (was: Distributing apps) Message-ID: On Fri, Mar 2, 2012 at 9:14 AM, Slide wrote: > Do we currently have a wiki? 2 of them - codeplex, and github - plus ironpython.info has stuff as well. For now the github wiki is probably the best one to use. On a bigger scale: I've long been in awe of the Python documentation. It's some of the best I've ever seen. So I decided to just copy it :) If you look at https://github.com/IronLanguages/ironpython-docs you can get an idea; although I wanted to get it further along before publicizing, now's as good a time as any to explain where I'm going with this. There's a site called readthedocs.org that is designed to host Sphinx (the toolkit the Python docs use) documentation. You link a repository to it and it pulls from it and builds the docs. One nice feature is that it can automatically rebuild it when a push happens. It just so happens that github has long supported editing files through its web interface, which is slightly odd for code but perfect for documentation. So, what I see happening: someone wants to add to the documentation; they go to github, edit the file, commit it, and RTD will automatically update the docs. It's about the lowest possible friction to getting nice docs. Admittedly, it's a lot like a wiki, but the output of sphinx is much nicer and much more customizable then any wiki we have available. I plan to keep the basic structure of Python docs but replacing sections like 'Extending & Embedding' with IronPython-specific stuff. Of course, I won't be able to do it myself, but hopefully the simple workflow will make it easier for others to contribute as well. All of this setup will probably happen after 2.7.2 is released. but that's what I had in mind. - Jeff From jdhardy at gmail.com Fri Mar 2 18:57:46 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 09:57:46 -0800 Subject: [Ironpython-users] Distributing apps In-Reply-To: <1267062163.20120302123344@mail.com> References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> Message-ID: On Fri, Mar 2, 2012 at 9:33 AM, wrote: > Ok, thanks - that got me a long ways past where I was. The exe that it > builds doesn't include the standard python library stuff, like string, > even though it's in an import statement. So do I have to explicitly > include everything like that (datetime, sys, re, etc) in the pyc.py > command, or is there a better way to do it? Your best bet is probably to put the standard library in a zip file and use zipimport. That's how Mercurial does it, for example. - Jeff From cmello at gmail.com Fri Mar 2 19:42:53 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 15:42:53 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: Hey nice! Let this one with me. Best regards Mello On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: > Just an oversight. Can you open an issue on ironpython.codeplex.com? > Should be easy enough to get this in. If you're up to it, a pull > request would be even better :) > > - Jeff > > On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: > > Hi! > > > > This method doesn't seem to be implemented. From > > http://docs.python.org/library/datetime.html : > > timedelta.total_seconds() > > > > Return the total number of seconds contained in the duration. Equivalent > to > > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 > > computed with true division enabled. > > > > Note that for very large time intervals (greater than 270 years on most > > platforms) this method will lose microsecond accuracy. > > > > New in version 2.7. > > > > > > Best regards! > > Mello > > > > _______________________________________________ > > Ironpython-users mailing list > > Ironpython-users at python.org > > http://mail.python.org/mailman/listinfo/ironpython-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Fri Mar 2 20:09:20 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 16:09:20 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: There is a work item for missing datetime features: http://ironpython.codeplex.com/workitem/17470 So should I just insert a comment instead of creating a new work item? Thanks! Best regards Mello On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: > Just an oversight. Can you open an issue on ironpython.codeplex.com? > Should be easy enough to get this in. If you're up to it, a pull > request would be even better :) > > - Jeff > > On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: > > Hi! > > > > This method doesn't seem to be implemented. From > > http://docs.python.org/library/datetime.html : > > timedelta.total_seconds() > > > > Return the total number of seconds contained in the duration. Equivalent > to > > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 > > computed with true division enabled. > > > > Note that for very large time intervals (greater than 270 years on most > > platforms) this method will lose microsecond accuracy. > > > > New in version 2.7. > > > > > > Best regards! > > Mello > > > > _______________________________________________ > > Ironpython-users mailing list > > Ironpython-users at python.org > > http://mail.python.org/mailman/listinfo/ironpython-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Mar 2 20:15:41 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 11:15:41 -0800 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: No, create a new one. That datetime one is so big (and out of date) that it might never be closed. I prefer them to be small pieces. - Jeff On Fri, Mar 2, 2012 at 11:09 AM, Cesar Mello wrote: > There is a work item for missing datetime features: > > http://ironpython.codeplex.com/workitem/17470 > > So should I just insert a comment instead of creating a new work item? > > Thanks! > > Best regards > Mello > > > > > > On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: >> >> Just an oversight. Can you open an issue on ironpython.codeplex.com? >> Should be easy enough to get this in. If you're up to it, a pull >> request would be even better :) >> >> - Jeff >> >> On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: >> > Hi! >> > >> > This method doesn't seem to be implemented. From >> > http://docs.python.org/library/datetime.html : >> > timedelta.total_seconds() >> > >> > Return the total number of seconds contained in the duration. Equivalent >> > to >> > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 >> > computed with true division enabled. >> > >> > Note that for very large time intervals (greater than 270 years on most >> > platforms) this method will lose microsecond accuracy. >> > >> > New in version 2.7. >> > >> > >> > Best regards! >> > Mello >> > >> > _______________________________________________ >> > Ironpython-users mailing list >> > Ironpython-users at python.org >> > http://mail.python.org/mailman/listinfo/ironpython-users >> > > > From cmello at gmail.com Fri Mar 2 20:57:29 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 16:57:29 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: OK I prefer small work items too: http://ironpython.codeplex.com/workitem/32342 Tonight I'll setup git and play around, maybe I can solve this one. Best regards Mello On Fri, Mar 2, 2012 at 4:15 PM, Jeff Hardy wrote: > No, create a new one. That datetime one is so big (and out of date) > that it might never be closed. I prefer them to be small pieces. > > - Jeff > > On Fri, Mar 2, 2012 at 11:09 AM, Cesar Mello wrote: > > There is a work item for missing datetime features: > > > > http://ironpython.codeplex.com/workitem/17470 > > > > So should I just insert a comment instead of creating a new work item? > > > > Thanks! > > > > Best regards > > Mello > > > > > > > > > > > > On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: > >> > >> Just an oversight. Can you open an issue on ironpython.codeplex.com? > >> Should be easy enough to get this in. If you're up to it, a pull > >> request would be even better :) > >> > >> - Jeff > >> > >> On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: > >> > Hi! > >> > > >> > This method doesn't seem to be implemented. From > >> > http://docs.python.org/library/datetime.html : > >> > timedelta.total_seconds() > >> > > >> > Return the total number of seconds contained in the duration. > Equivalent > >> > to > >> > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 > >> > computed with true division enabled. > >> > > >> > Note that for very large time intervals (greater than 270 years on > most > >> > platforms) this method will lose microsecond accuracy. > >> > > >> > New in version 2.7. > >> > > >> > > >> > Best regards! > >> > Mello > >> > > >> > _______________________________________________ > >> > Ironpython-users mailing list > >> > Ironpython-users at python.org > >> > http://mail.python.org/mailman/listinfo/ironpython-users > >> > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Mar 2 21:19:35 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 12:19:35 -0800 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: On Fri, Mar 2, 2012 at 11:57 AM, Cesar Mello wrote: > OK I prefer small work items too: > > http://ironpython.codeplex.com/workitem/32342 > > Tonight I'll setup git and play around, maybe I can solve this one. I'd like to cut the 2.7.2 RC on Sunday (and only fix showstoppers after that), so if you need any help let me know. In particular, make a note of anything you find confusing or underdocumented - great fodder for starting some better developer documentation. - Jeff From mchalkley at mail.com Fri Mar 2 21:58:09 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Fri, 2 Mar 2012 15:58:09 -0500 Subject: [Ironpython-users] Distributing apps In-Reply-To: References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> Message-ID: <1818417507.20120302155809@mail.com> Friday, March 2, 2012, 12:57:46 PM, you wrote: > On Fri, Mar 2, 2012 at 9:33 AM, wrote: >> Ok, thanks - that got me a long ways past where I was. The exe that it >> builds doesn't include the standard python library stuff, like string, >> even though it's in an import statement. So do I have to explicitly >> include everything like that (datetime, sys, re, etc) in the pyc.py >> command, or is there a better way to do it? > Your best bet is probably to put the standard library in a zip file > and use zipimport. That's how Mercurial does it, for example. > - Jeff Well, when you or whoever finds time to document the process, could you include something about that, too? If put some of the standard library files, but omit others, I get a message telling me which ones are missing, but if I include everything, I get: Unhandled Exception: Microsoft.Scripting.SyntaxErrorException: unexpected token '' at IronPython.Runtime.ThrowingErrorSink.Add(SourceUnit sourceUnit, String message, SourceSpan span, Int32 errorCode, Severity severity) at IronPython.Compiler.Parser.ReportSyntaxError(Int32 start, Int32 end, String message, Int32 errorCode) at IronPython.Compiler.Parser.ReportSyntaxError(Token t, IndexSpan span, Int32 errorCode, Boolean allowIncomplete) at IronPython.Compiler.Parser.ParsePrimary() at IronPython.Compiler.Parser.ParsePower() So, it seems it doesn't like the libs being in a zip file... I'll keep playing with it... Thanks, Mark From jdhardy at gmail.com Fri Mar 2 22:30:23 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 2 Mar 2012 13:30:23 -0800 Subject: [Ironpython-users] Distributing apps In-Reply-To: <1818417507.20120302155809@mail.com> References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> <1818417507.20120302155809@mail.com> Message-ID: On Fri, Mar 2, 2012 at 12:58 PM, wrote: > Well, when you or whoever finds time to document the process, could > you include something about that, too? If put some of the standard > library files, but omit others, I get a message telling me which ones > are missing, but if I include everything, I get: > > Unhandled Exception: Microsoft.Scripting.SyntaxErrorException: unexpected token '' > ? at IronPython.Runtime.ThrowingErrorSink.Add(SourceUnit sourceUnit, String message, SourceSpan span, Int32 errorCode, Severity severity) > ? at IronPython.Compiler.Parser.ReportSyntaxError(Int32 start, Int32 end, String message, Int32 errorCode) > ? at IronPython.Compiler.Parser.ReportSyntaxError(Token t, IndexSpan span, Int32 errorCode, Boolean allowIncomplete) > ? at IronPython.Compiler.Parser.ParsePrimary() > ? at IronPython.Compiler.Parser.ParsePower() > > So, it seems it doesn't like the libs being in a zip file... I'll keep > playing with it... See http://ironpython.codeplex.com/workitem/32335. It'll be fixed in the RC. - Jeff From cmello at gmail.com Fri Mar 2 23:39:00 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 2 Mar 2012 19:39:00 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: I am a newbie so my first task other than keep reading the documentation all the time is getting acquainted to git, the build environment and the regression tests. Should I test in both Windows and Linux? The implementation seems to be the expression: (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 But if you tell me what means "*computed with true division enabled* " regarding the .NET implementation it will be a shortcut. By the way I have a Windows Phone and an AppHub account. It would be fun to deliver an ipy console with the tutorial embedded, any feedback about this is also appreciated. Thanks and best regards! Mello On Fri, Mar 2, 2012 at 5:19 PM, Jeff Hardy wrote: > On Fri, Mar 2, 2012 at 11:57 AM, Cesar Mello wrote: > > OK I prefer small work items too: > > > > http://ironpython.codeplex.com/workitem/32342 > > > > Tonight I'll setup git and play around, maybe I can solve this one. > > I'd like to cut the 2.7.2 RC on Sunday (and only fix showstoppers > after that), so if you need any help let me know. In particular, make > a note of anything you find confusing or underdocumented - great > fodder for starting some better developer documentation. > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Sat Mar 3 05:56:59 2012 From: cmello at gmail.com (Cesar Mello) Date: Sat, 3 Mar 2012 01:56:59 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: Oh please forget my questions... Everything sorted out. Just found https://github.com/IronLanguages/main/wiki . That's so great! Best regards! Mello On Fri, Mar 2, 2012 at 7:39 PM, Cesar Mello wrote: > I am a newbie so my first task other than keep reading the documentation > all the time is getting acquainted to git, the build environment and the > regression tests. Should I test in both Windows and Linux? > > The implementation seems to be the expression: > > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 > > But if you tell me what means "*computed with true division enabled* " > regarding the .NET implementation it will be a shortcut. > > By the way I have a Windows Phone and an AppHub account. It would be fun > to deliver an ipy console with the tutorial embedded, any feedback about > this is also appreciated. > > Thanks and best regards! > Mello > > > On Fri, Mar 2, 2012 at 5:19 PM, Jeff Hardy wrote: > >> On Fri, Mar 2, 2012 at 11:57 AM, Cesar Mello wrote: >> > OK I prefer small work items too: >> > >> > http://ironpython.codeplex.com/workitem/32342 >> > >> > Tonight I'll setup git and play around, maybe I can solve this one. >> >> I'd like to cut the 2.7.2 RC on Sunday (and only fix showstoppers >> after that), so if you need any help let me know. In particular, make >> a note of anything you find confusing or underdocumented - great >> fodder for starting some better developer documentation. >> >> - Jeff >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Sat Mar 3 16:08:18 2012 From: cmello at gmail.com (Cesar Mello) Date: Sat, 3 Mar 2012 12:08:18 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: Hi, Any help here is appreciated. I found a related unit test here: main\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py: def test_total_seconds(self): td = timedelta(days=365) self.assertEqual(td.total_seconds(), 31536000.0) for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]: td = timedelta(seconds=total_seconds) self.assertEqual(td.total_seconds(), total_seconds) # Issue8644: Test that td.total_seconds() has the same # accuracy as td / timedelta(seconds=1). for ms in [-1, -2, -123]: td = timedelta(microseconds=ms) self.assertEqual(td.total_seconds(), ((24*3600*td.days + td.seconds)*10**6 + td.microseconds)/10**6) I would like to know how to enable and run this in the build. Thank you very much. Mello On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: > Just an oversight. Can you open an issue on ironpython.codeplex.com? > Should be easy enough to get this in. If you're up to it, a pull > request would be even better :) > > - Jeff > > On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: > > Hi! > > > > This method doesn't seem to be implemented. From > > http://docs.python.org/library/datetime.html : > > timedelta.total_seconds() > > > > Return the total number of seconds contained in the duration. Equivalent > to > > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 > > computed with true division enabled. > > > > Note that for very large time intervals (greater than 270 years on most > > platforms) this method will lose microsecond accuracy. > > > > New in version 2.7. > > > > > > Best regards! > > Mello > > > > _______________________________________________ > > Ironpython-users mailing list > > Ironpython-users at python.org > > http://mail.python.org/mailman/listinfo/ironpython-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Sat Mar 3 16:57:51 2012 From: cmello at gmail.com (Cesar Mello) Date: Sat, 3 Mar 2012 12:57:51 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: I could run the test using the command line: D:\workspace-git\IronLanguages-main\Languages\IronPython\Internal>ipy ..\..\..\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py And then got 4 failures, including the one I want to fix: ====================================================================== ERROR: test_total_seconds (__main__.TestTimeDelta) ---------------------------------------------------------------------- Traceback (most recent call last): File "..\..\..\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py", line 269, in test_total_seconds self.assertEqual(td.total_seconds(), 31536000.0) AttributeError: 'timedelta' object has no attribute 'total_seconds' ====================================================================== Just couldn't figure out yet how to run all the IronPython tests at once. Best regards Mello On Sat, Mar 3, 2012 at 12:08 PM, Cesar Mello wrote: > Hi, > > Any help here is appreciated. > > I found a related unit test here: > > > main\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py: > > def test_total_seconds(self): > td = timedelta(days=365) > self.assertEqual(td.total_seconds(), 31536000.0) > for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, > 1e6]: > td = timedelta(seconds=total_seconds) > self.assertEqual(td.total_seconds(), total_seconds) > # Issue8644: Test that td.total_seconds() has the same > # accuracy as td / timedelta(seconds=1). > for ms in [-1, -2, -123]: > td = timedelta(microseconds=ms) > self.assertEqual(td.total_seconds(), > ((24*3600*td.days + td.seconds)*10**6 > + td.microseconds)/10**6) > > > I would like to know how to enable and run this in the build. > > Thank you very much. > Mello > > > > > > On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: > >> Just an oversight. Can you open an issue on ironpython.codeplex.com? >> Should be easy enough to get this in. If you're up to it, a pull >> request would be even better :) >> >> - Jeff >> >> On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: >> > Hi! >> > >> > This method doesn't seem to be implemented. From >> > http://docs.python.org/library/datetime.html : >> > timedelta.total_seconds() >> > >> > Return the total number of seconds contained in the duration. >> Equivalent to >> > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 >> > computed with true division enabled. >> > >> > Note that for very large time intervals (greater than 270 years on most >> > platforms) this method will lose microsecond accuracy. >> > >> > New in version 2.7. >> > >> > >> > Best regards! >> > Mello >> > >> > _______________________________________________ >> > Ironpython-users mailing list >> > Ironpython-users at python.org >> > http://mail.python.org/mailman/listinfo/ironpython-users >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Sat Mar 3 17:16:33 2012 From: cmello at gmail.com (Cesar Mello) Date: Sat, 3 Mar 2012 13:16:33 -0300 Subject: [Ironpython-users] timedelta.total_seconds() In-Reply-To: References: Message-ID: OK can someone please review? https://github.com/cmello/IronLanguages-main/commit/0d9cad9e1ef203df6131b9d44013a0e0f31b8088 The test passes but I still don't know if/where to enable that test in the build? Thank you. Best regards Mello On Sat, Mar 3, 2012 at 12:57 PM, Cesar Mello wrote: > I could run the test using the command line: > > D:\workspace-git\IronLanguages-main\Languages\IronPython\Internal>ipy > ..\..\..\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py > > And then got 4 failures, including the one I want to fix: > > ====================================================================== > ERROR: test_total_seconds (__main__.TestTimeDelta) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File > "..\..\..\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py", > line 269, in test_total_seconds > self.assertEqual(td.total_seconds(), 31536000.0) > AttributeError: 'timedelta' object has no attribute 'total_seconds' > > ====================================================================== > > > Just couldn't figure out yet how to run all the IronPython tests at once. > > Best regards > Mello > > On Sat, Mar 3, 2012 at 12:08 PM, Cesar Mello wrote: > >> Hi, >> >> Any help here is appreciated. >> >> I found a related unit test here: >> >> >> main\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py: >> >> def test_total_seconds(self): >> td = timedelta(days=365) >> self.assertEqual(td.total_seconds(), 31536000.0) >> for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, >> 1e6]: >> td = timedelta(seconds=total_seconds) >> self.assertEqual(td.total_seconds(), total_seconds) >> # Issue8644: Test that td.total_seconds() has the same >> # accuracy as td / timedelta(seconds=1). >> for ms in [-1, -2, -123]: >> td = timedelta(microseconds=ms) >> self.assertEqual(td.total_seconds(), >> ((24*3600*td.days + td.seconds)*10**6 >> + td.microseconds)/10**6) >> >> >> I would like to know how to enable and run this in the build. >> >> Thank you very much. >> Mello >> >> >> >> >> >> On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy wrote: >> >>> Just an oversight. Can you open an issue on ironpython.codeplex.com? >>> Should be easy enough to get this in. If you're up to it, a pull >>> request would be even better :) >>> >>> - Jeff >>> >>> On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello wrote: >>> > Hi! >>> > >>> > This method doesn't seem to be implemented. From >>> > http://docs.python.org/library/datetime.html : >>> > timedelta.total_seconds() >>> > >>> > Return the total number of seconds contained in the duration. >>> Equivalent to >>> > (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 >>> > computed with true division enabled. >>> > >>> > Note that for very large time intervals (greater than 270 years on most >>> > platforms) this method will lose microsecond accuracy. >>> > >>> > New in version 2.7. >>> > >>> > >>> > Best regards! >>> > Mello >>> > >>> > _______________________________________________ >>> > Ironpython-users mailing list >>> > Ironpython-users at python.org >>> > http://mail.python.org/mailman/listinfo/ironpython-users >>> > >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at peter-schwalm.de Sat Mar 3 17:58:39 2012 From: ps at peter-schwalm.de (Peter Schwalm) Date: Sat, 03 Mar 2012 17:58:39 +0100 Subject: [Ironpython-users] debugging ipy.exe Message-ID: <4F524DBF.2040101@peter-schwalm.de> Hello, can anybody tell me how to debug ipy.exe in Visual Studio? I downloaded the latest source version of ironpython with github, opened the Visual Studio .sln file and selected IronPythonConsole (= ipy.exe) as the start project. Then I entered a test script in the command line arguments entry in debug project properties. The script (and ipy.exe) immediately terminates. If I run the new compiled ipy.exe from the command line, the following message appears: d:\w7\gitHub\ipy\bin\Debug>ipy d:\d\d0\versuche\ironPython\ipyInfra\myPyc2\test1.py Traceback (most recent call last): File "d:\w7\gitHub\ipy\bin\Debug\Lib\site.py", line 62, in ImportError: No module named osTraceback (most recent call last): File "d:\d\d0\versuche\ironPython\ipyInfra\myPyc2\test1.py", line 1, in ImportError: No module named os d:\w7\gitHub\ipy\bin\Debug> In another environment a message "No module named osIronPython" appears (I cannot reproduce this at the moment). I looks as if can debug ipy.exe only if there is an existing ironPython installation. I don't think this is a good idea because an existing installation and a newly compiled ipy.exe might not work well together. So: do I have to build a special testing environment for debugging ipy.exe in VS? Thank you Peter Schwalm From no_reply at codeplex.com Sat Mar 3 18:15:30 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 3 Mar 2012 09:15:30 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/2/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Implement timedelta.total_seconds() ---------------------------------------------- ISSUES 1. [New issue] Implement timedelta.total_seconds() http://ironpython.codeplex.com/workitem/32342 User cmello has proposed the issue: "From http://docs.python.org/library/datetime.html : timedelta.total_seconds() Return the total number of seconds contained in the duration. Equivalent to (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6 computed with true division enabled. Note that for very large time intervals (greater than 270 years on most platforms) this method will lose microsecond accuracy. New in version 2.7." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Mar 3 19:16:15 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 3 Mar 2012 10:16:15 -0800 Subject: [Ironpython-users] debugging ipy.exe In-Reply-To: <4F524DBF.2040101@peter-schwalm.de> References: <4F524DBF.2040101@peter-schwalm.de> Message-ID: Can you switch to the ipy-2.7-maint branch? I fixed that but may not have back ported to master yet. - Jeff On Saturday, March 3, 2012, Peter Schwalm wrote: > Hello, > > can anybody tell me how to debug ipy.exe in Visual Studio? > > I downloaded the latest source version of ironpython with github, opened the Visual Studio .sln file and selected IronPythonConsole (= ipy.exe) as the start project. > > Then I entered a test script in the command line arguments entry in debug project properties. > > The script (and ipy.exe) immediately terminates. > > If I run the new compiled ipy.exe from the command line, the following message appears: > > d:\w7\gitHub\ipy\bin\Debug>ipy d:\d\d0\versuche\ironPython\ipyInfra\myPyc2\test1.py > Traceback (most recent call last): > File "d:\w7\gitHub\ipy\bin\Debug\Lib\site.py", line 62, in > ImportError: No module named osTraceback (most recent call last): > File "d:\d\d0\versuche\ironPython\ipyInfra\myPyc2\test1.py", line 1, in > ImportError: No module named os > d:\w7\gitHub\ipy\bin\Debug> > > In another environment a message "No module named osIronPython" appears (I cannot reproduce this at the moment). > > I looks as if can debug ipy.exe only if there is an existing ironPython installation. I don't think this is a good idea because an existing installation and a newly compiled ipy.exe might not work well together. > > So: do I have to build a special testing environment for debugging ipy.exe in VS? > > Thank you > Peter Schwalm > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuomas.utrecht at gmail.com Sat Mar 3 19:45:15 2012 From: tuomas.utrecht at gmail.com (Tuomas Utrecht) Date: Sat, 3 Mar 2012 13:45:15 -0500 Subject: [Ironpython-users] Modifying ASTs when embedding IronPython In-Reply-To: References: Message-ID: Le 2 mars 2012 11:26, Jeff Hardy a ?crit : > On Fri, Mar 2, 2012 at 5:31 AM, Tuomas Utrecht > wrote: > > I have body of possible Excel formulas which are identical to Python > syntax, > > except for the use of ^. > > If that's the case, why not rewrite them as strings instead (i.e. > s/^/**/g), and then pass them to IronPython? > Yes, I am doing something similar now, different only in that it accounts for strings with the value. I was hoping for something a little more robust. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sun Mar 4 12:53:48 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 4 Mar 2012 03:53:48 -0800 Subject: [Ironpython-users] IronPython 2.7.2 RC Available Message-ID: On behalf of the IronPython team, I'm happy to announce the first (and probably only) release candidate for IronPython 2.7.2. Only showstopping bugs will be fixed before the release. You can download IronPython 2.7.2 RC from http://ironpython.codeplex.com/releases/view/81331. Like all IronPython 2.7-series releases, .NET 4 is required to install it. Installing this release will replace any existing IronPython 2.7-series installation. Unlike previous releases, the assemblies for all supported platforms are included in the installer as well as the zip package. IronPython 2.7.2 RC includes support for .NET 3.5, .NET 4, Silverlight 4, Silverlight 5, Mono for Android 4.0, and Windows Phone 7.5. Check the "Platforms" directory for the required assemblies. Any feedback on the supported platforms, especially for Android and Windows Phone, is greatly appreciated. For 2.7.2, the mobile platforms should be treated as previews, and expect them to change for 2.7.3. The biggest improvements in IronPython 2.7.2 are support for the zipimport module, thanks to Alex Earl, and the sqlite3 module. The pyc.py compiler can now generate standalone executables by embedding the IronPython assemblies. Many other bugs have been fixed as well. IronPython 2.7.2 RC 1 is also available on NuGet. To add it to your project, run Install-Package IronPython -IncludePrerelease (and Install-Package IronPython.StdLib -IncludePrerelease if you want the standard library as well) from the Package Manager Console. Because it's a prerelease package, it won't show up in the Package Manager UI. The final release of IronPython 2.7.2 is currently set for March 11. Also, Check out the new IronPython blog at http://blog.ironpython.net! - Jeff From slide.o.mix at gmail.com Sun Mar 4 12:55:56 2012 From: slide.o.mix at gmail.com (Slide) Date: Sun, 4 Mar 2012 04:55:56 -0700 Subject: [Ironpython-users] IronPython 2.7.2 RC Available In-Reply-To: References: Message-ID: Jeff, As always a big thanks for your continued hard work in keeping IronPython alive and well! Thanks! Slide On Mar 4, 2012 4:53 AM, "Jeff Hardy" wrote: > On behalf of the IronPython team, I'm happy to announce the first (and > probably only) release candidate for IronPython 2.7.2. Only > showstopping bugs will be fixed before the release. > > You can download IronPython 2.7.2 RC from > http://ironpython.codeplex.com/releases/view/81331. > > Like all IronPython 2.7-series releases, .NET 4 is required to install > it. Installing this release will replace any existing IronPython > 2.7-series installation. > > Unlike previous releases, the assemblies for all supported platforms > are included in the installer as well as the zip package. IronPython > 2.7.2 RC includes support for .NET 3.5, .NET 4, Silverlight 4, > Silverlight 5, Mono for Android 4.0, and Windows Phone 7.5. Check the > "Platforms" directory for the required assemblies. Any feedback on the > supported platforms, especially for Android and Windows Phone, is > greatly appreciated. For 2.7.2, the mobile platforms should be treated > as previews, and expect them to change for 2.7.3. > > The biggest improvements in IronPython 2.7.2 are support for the > zipimport module, thanks to Alex Earl, and the sqlite3 module. The > pyc.py compiler can now generate standalone executables by embedding > the IronPython assemblies. Many other bugs have been fixed as well. > > IronPython 2.7.2 RC 1 is also available on NuGet. To add it to your > project, run Install-Package IronPython -IncludePrerelease (and > Install-Package IronPython.StdLib -IncludePrerelease if you want the > standard library as well) from the Package Manager Console. Because > it's a prerelease package, it won't show up in the Package Manager UI. > > The final release of IronPython 2.7.2 is currently set for March 11. > Also, Check out the new IronPython blog at http://blog.ironpython.net! > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Sun Mar 4 14:14:16 2012 From: cmello at gmail.com (Cesar Mello) Date: Sun, 4 Mar 2012 10:14:16 -0300 Subject: [Ironpython-users] IronPython 2.7.2 RC Available In-Reply-To: References: Message-ID: This release with embedded sqlite is really awesome! Congratulations for the great work and thanks for providing such a nice software. Best regards Mello On Sun, Mar 4, 2012 at 8:53 AM, Jeff Hardy wrote: > On behalf of the IronPython team, I'm happy to announce the first (and > probably only) release candidate for IronPython 2.7.2. Only > showstopping bugs will be fixed before the release. > > You can download IronPython 2.7.2 RC from > http://ironpython.codeplex.com/releases/view/81331. > > Like all IronPython 2.7-series releases, .NET 4 is required to install > it. Installing this release will replace any existing IronPython > 2.7-series installation. > > Unlike previous releases, the assemblies for all supported platforms > are included in the installer as well as the zip package. IronPython > 2.7.2 RC includes support for .NET 3.5, .NET 4, Silverlight 4, > Silverlight 5, Mono for Android 4.0, and Windows Phone 7.5. Check the > "Platforms" directory for the required assemblies. Any feedback on the > supported platforms, especially for Android and Windows Phone, is > greatly appreciated. For 2.7.2, the mobile platforms should be treated > as previews, and expect them to change for 2.7.3. > > The biggest improvements in IronPython 2.7.2 are support for the > zipimport module, thanks to Alex Earl, and the sqlite3 module. The > pyc.py compiler can now generate standalone executables by embedding > the IronPython assemblies. Many other bugs have been fixed as well. > > IronPython 2.7.2 RC 1 is also available on NuGet. To add it to your > project, run Install-Package IronPython -IncludePrerelease (and > Install-Package IronPython.StdLib -IncludePrerelease if you want the > standard library as well) from the Package Manager Console. Because > it's a prerelease package, it won't show up in the Package Manager UI. > > The final release of IronPython 2.7.2 is currently set for March 11. > Also, Check out the new IronPython blog at http://blog.ironpython.net! > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Sun Mar 4 14:21:54 2012 From: cmello at gmail.com (Cesar Mello) Date: Sun, 4 Mar 2012 10:21:54 -0300 Subject: [Ironpython-users] IronPython on Windows Phone Message-ID: Hi! I created a Silverlight/WP project using Microsoft Visual Studio 2010 Express for Windows Phone. Added references to all the DLLs in IronPython-2.7.2rc1\Platforms\Sl4-WP71 . When I run the application I get the following error: File or assembly name 'Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7F709C5B713576E1', or one of its dependencies, was not found. Just curious if someone else has tried the binaries in WP7. Any suggestions, tests, information or even recommendations for debugging are welcome! I haven't tried to build from source for WP7 yet, but I'll try it later. Thanks a lot! Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at peter-schwalm.de Sun Mar 4 23:45:39 2012 From: ps at peter-schwalm.de (Peter Schwalm) Date: Sun, 04 Mar 2012 23:45:39 +0100 Subject: [Ironpython-users] debugging ipy.exe In-Reply-To: References: <4F524DBF.2040101@peter-schwalm.de> Message-ID: <4F53F093.8000503@peter-schwalm.de> Hello Jeff, I switched to the branch ipy-2.7-maint. Now I have the problem that I cannot debug because some ironPython dlls are loaded from the GAC. These versions are not debuggable. I suppose they are from the "normal" 2.7.1 installation. Do I have to / can I remove them manually from the GAC? Thank you Peter load messages from VS 2010: Der Thread 'vshost.LoadReference' (0x1a1c) hat mit Code 0 (0x0) geendet. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "D:\w7\gitHub\ipy\bin\Debug\ipy.exe" geladen, Symbole geladen. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Dynamic\v4.0_1.1.0.20__7f709c5b713576e1\Microsoft.Dynamic.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Scripting\v4.0_1.1.0.20__7f709c5b713576e1\Microsoft.Scripting.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\IronPython\v4.0_2.7.0.40__7f709c5b713576e1\IronPython.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\IronPython.Modules\v4.0_2.7.0.40__7f709c5b713576e1\IronPython.Modules.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "D:\w7\gitHub\ipy\bin\Debug\DLLs\IronPython.SQLite.dll" geladen, Symbole geladen. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "D:\w7\gitHub\ipy\bin\Debug\DLLs\IronPython.Wpf.dll" geladen, Symbole geladen. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll" wurde geladen, das Laden von Symbolen wurde ?bersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert. "ipy.vshost.exe" (Verwaltet (v4.0.30319)): "Anonymously Hosted DynamicMethods Assembly" geladen Der Thread 'vshost.RunParkingWindow' (0x2168) hat mit Code 0 (0x0) geendet. Der Thread '' (0x1b9c) hat mit Code 0 (0x0) geendet. Das Programm "[4816] ipy.vshost.exe: Verwaltet (v4.0.30319)" wurde mit Code 0 (0x0) beendet. From mchalkley at mail.com Mon Mar 5 03:35:12 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Sun, 4 Mar 2012 21:35:12 -0500 Subject: [Ironpython-users] Distributing apps In-Reply-To: References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> <1818417507.20120302155809@mail.com> Message-ID: <1309456662.20120304213512@mail.com> I really appreciate all the help getting the process of distributing a python app - I was able to get it working today, since RC 1 fixed the "Unexpected token " error. I have one more question regarding deploying python apps. If I put the python libraries I'm using (string, etc.) into a zip file, the app doesn't see it in the current working directory, for some reason. Since there's no PYTHONPATH on the target machine, and the 'os' module isn't available until after the library is imported, what's the best way to specify the path to the zipped lib file? I can specify a complete path, using sys.path.append (e.g. 'c:\lib.zip'), which requres putting it there, but is there a way specify the current working directory, so I can deploy the program in one place, rather than making the user copy the library to C:\ directory? Thanks, Mark Friday, March 2, 2012, 4:30:23 PM, you wrote: > On Fri, Mar 2, 2012 at 12:58 PM, wrote: >> Well, when you or whoever finds time to document the process, could >> you include something about that, too? If put some of the standard >> library files, but omit others, I get a message telling me which ones >> are missing, but if I include everything, I get: >> >> Unhandled Exception: Microsoft.Scripting.SyntaxErrorException: unexpected token '' >> ? at IronPython.Runtime.ThrowingErrorSink.Add(SourceUnit sourceUnit, String message, SourceSpan span, Int32 errorCode, Severity severity) >> ? at IronPython.Compiler.Parser.ReportSyntaxError(Int32 start, Int32 end, String message, Int32 errorCode) >> ? at IronPython.Compiler.Parser.ReportSyntaxError(Token t, IndexSpan span, Int32 errorCode, Boolean allowIncomplete) >> ? at IronPython.Compiler.Parser.ParsePrimary() >> ? at IronPython.Compiler.Parser.ParsePower() >> >> So, it seems it doesn't like the libs being in a zip file... I'll keep >> playing with it... > See http://ironpython.codeplex.com/workitem/32335. It'll be fixed in the RC. > - Jeff From jdhardy at gmail.com Mon Mar 5 05:54:19 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 4 Mar 2012 20:54:19 -0800 Subject: [Ironpython-users] Distributing apps In-Reply-To: <1309456662.20120304213512@mail.com> References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> <1818417507.20120302155809@mail.com> <1309456662.20120304213512@mail.com> Message-ID: On Sun, Mar 4, 2012 at 6:35 PM, wrote: > I have one more question regarding deploying python apps. If I put the > python libraries I'm using (string, etc.) into a zip file, the app > doesn't see it in the current working directory, for some reason. > Since there's no PYTHONPATH on the target machine, and the 'os' module > isn't available until after the library is imported, what's the best > way to specify the path to the zipped lib file? I can specify a > complete path, using sys.path.append (e.g. 'c:\lib.zip'), which > requres putting it there, but is there a way specify the current > working directory, so I can deploy the program in one place, rather > than making the user copy the library to C:\ directory? Does that work on CPython? If so, it's a bug, so please open an issue for it. - Jeff From jdhardy at gmail.com Mon Mar 5 05:57:44 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 4 Mar 2012 20:57:44 -0800 Subject: [Ironpython-users] debugging ipy.exe In-Reply-To: <4F53F093.8000503@peter-schwalm.de> References: <4F524DBF.2040101@peter-schwalm.de> <4F53F093.8000503@peter-schwalm.de> Message-ID: 2012/3/4 Peter Schwalm : > Hello Jeff, > > I switched to the branch ipy-2.7-maint. Now I have the problem that I cannot > debug because some ironPython dlls are loaded from the GAC. These versions > are not debuggable. I suppose they are from the "normal" 2.7.1 installation. > > Do I have to / can I remove them manually from the GAC? Yeah, that's a known issue. I actually ran into it while testing 2.7.2 the other night :). In 2.7.2 installing the assemblies to the GAC is optional for just that reason. To make it easier, for 2.7.3 I think I'll change the assembly versions when building in DEBUG mode. Your only option, then, is to uninstall 2.7.1 and install 2.7.2 without the GAC assemblies. And curse Microsoft for the frustrating assembly resolution order. - Jeff From m.schaber at 3s-software.com Mon Mar 5 09:38:37 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 5 Mar 2012 08:38:37 +0000 Subject: [Ironpython-users] Distributing apps In-Reply-To: <1309456662.20120304213512@mail.com> References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> <1818417507.20120302155809@mail.com> <1309456662.20120304213512@mail.com> Message-ID: <727D8E16AE957149B447FE368139F2B50D75FDFF@SERVER10> Hi, Mark, Von: mchalkley at mail.com > I have one more question regarding deploying python apps. If I put the python libraries I'm using (string, etc.) into a zip file, the app doesn't see it in the current working directory, for some reason. > Since there's no PYTHONPATH on the target machine, and the 'os' module isn't available until after the library is imported, what's the best way to specify the path to the zipped lib file? I can specify a complete path, using sys.path.append (e.g. 'c:\lib.zip'), which requres putting it there, but is there a way specify the current working directory, so I can deploy the program in one place, rather than making the user copy the library to C:\ directory? If you don't find a "nice" solution, there are 2 things to keep in mind which could help you to create a workaround: - Some IronPython modules are implemented in C#, and are in the IronPython.dll or IronPython.Modules.dll. Those modules should be available for "import" even without any pathes set. - You always can use the .NET libraries to find about the current working directory or such things. Thanks, Mark Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From ps at peter-schwalm.de Mon Mar 5 14:03:12 2012 From: ps at peter-schwalm.de (Peter Schwalm) Date: Mon, 05 Mar 2012 14:03:12 +0100 Subject: [Ironpython-users] debugging ipy.exe In-Reply-To: References: <4F524DBF.2040101@peter-schwalm.de> <4F53F093.8000503@peter-schwalm.de> Message-ID: <4F54B990.9060807@peter-schwalm.de> Hello Jeff, Thank you for your answer. I could capture a non-ironpython machine and circumvent the problem by using VS 2010 remotedebugging. Peter Am 05.03.2012 05:57, schrieb Jeff Hardy: > 2012/3/4 Peter Schwalm: >> Hello Jeff, >> >> I switched to the branch ipy-2.7-maint. Now I have the problem that I cannot >> debug because some ironPython dlls are loaded from the GAC. These versions >> are not debuggable. I suppose they are from the "normal" 2.7.1 installation. >> >> Do I have to / can I remove them manually from the GAC? > Yeah, that's a known issue. I actually ran into it while testing 2.7.2 > the other night :). In 2.7.2 installing the assemblies to the GAC is > optional for just that reason. > > To make it easier, for 2.7.3 I think I'll change the assembly versions > when building in DEBUG mode. > > Your only option, then, is to uninstall 2.7.1 and install 2.7.2 > without the GAC assemblies. And curse Microsoft for the frustrating > assembly resolution order. > > - Jeff > From mchalkley at mail.com Mon Mar 5 14:11:18 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Mon, 5 Mar 2012 08:11:18 -0500 Subject: [Ironpython-users] Distributing apps In-Reply-To: References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> <1818417507.20120302155809@mail.com> <1309456662.20120304213512@mail.com> Message-ID: <1591595792.20120305081118@mail.com> Sunday, March 4, 2012, 11:54:19 PM, you wrote: > On Sun, Mar 4, 2012 at 6:35 PM, wrote: >> I have one more question regarding deploying python apps. If I put the >> python libraries I'm using (string, etc.) into a zip file, the app >> doesn't see it in the current working directory, for some reason. >> Since there's no PYTHONPATH on the target machine, and the 'os' module >> isn't available until after the library is imported, what's the best >> way to specify the path to the zipped lib file? I can specify a >> complete path, using sys.path.append (e.g. 'c:\lib.zip'), which >> requres putting it there, but is there a way specify the current >> working directory, so I can deploy the program in one place, rather >> than making the user copy the library to C:\ directory? > Does that work on CPython? If so, it's a bug, so please open an issue for it. > - Jeff Done - thanks! Mark From no_reply at codeplex.com Mon Mar 5 17:58:22 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 5 Mar 2012 08:58:22 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/4/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] "platform" instructions on 2.7.2b1 2. [New comment] Incorrect integer conversion (long => Int32) 3. [New comment] Importer doesn't support .pth files 4. [New comment] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path 5. [New comment] Improve Release build process 6. [New comment] Nuget needs to be updated with IronPython 2.7+ 7. [New comment] [2.7 Beta 2] deepcopy(time(9, 0)) != time(9, 0) 8. [New comment] [2.7 Beta 2] deepcopy(time(9, 0)) != time(9, 0) 9. [New issue] Compiling issue in IronPython 2.7.2 RC 1 10. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py ---------------------------------------------- ISSUES 1. [New comment] "platform" instructions on 2.7.2b1 http://ironpython.codeplex.com/workitem/32322 User jdhardy has commented on the issue: "Fixed in 6fdc1ed."----------------- 2. [New comment] Incorrect integer conversion (long => Int32) http://ironpython.codeplex.com/workitem/25937 User jdhardy has commented on the issue: "This is still an issue in 2.7.2. Even casting to the `object` overload doesn't work because .NET 4's BigInteger doesn't implement IConvertible. Instead it's best to just cast to Int64 explicitly: Convert.ToInt32(System.Int64(long(2**24+1)))"----------------- 3. [New comment] Importer doesn't support .pth files http://ironpython.codeplex.com/workitem/1607 User jdhardy has commented on the issue: "Fixed in 75a2467."----------------- 4. [New comment] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path http://ironpython.codeplex.com/workitem/31749 User jdhardy has commented on the issue: "Fixed in 1755fbd."----------------- 5. [New comment] Improve Release build process http://ironpython.codeplex.com/workitem/31144 User jdhardy has commented on the issue: "Fixed prior to cb2b511."----------------- 6. [New comment] Nuget needs to be updated with IronPython 2.7+ http://ironpython.codeplex.com/workitem/31126 User jdhardy has commented on the issue: "Fixed in 8374ef5."----------------- 7. [New comment] [2.7 Beta 2] deepcopy(time(9, 0)) != time(9, 0) http://ironpython.codeplex.com/workitem/30274 User jonathanhiga has commented on the issue: "I discovered this bug while working with Django + System.Data (SQL Server). The Django QuerySet makes deep copies of query parameters, so calls such as SomeModel.objects.filter(time_field='09:00') were returning matches for midnight instead of nine o'clock."----------------- 8. [New comment] [2.7 Beta 2] deepcopy(time(9, 0)) != time(9, 0) http://ironpython.codeplex.com/workitem/30274 User jonathanhiga has commented on the issue: "Test case attached."----------------- 9. [New issue] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User krysros has proposed the issue: "Compilation output for IronPython 2.7.1 (working properly) and IronPython 2.7.2 RC 1: IronPython 2.7.1 =========== D:\workspace\itest>"C:\Program Files (x86)\IronPython 2.7.1\ipy.exe" "C:\Program Files (x86)\IronPython 2.7.1\Tools\Scripts\pyc.py" /main:itest.py /target:exe Input Files: Output: itest Target: ConsoleApplication Platform: ILOnly Machine: I386 Compiling... Saved to itest IronPython 2.7.2 RC 1 ============== D:\workspace\itest>C:\IronPython-2.7.2rc1\ipy.exe C:\IronPython-2.7.2rc1\Tools\Scripts\pyc.py /main:itest.py /target:exe Input Files: Output: itest Target: ConsoleApplication Platform: ILOnly Machine: I386 Compiling... Traceback (most recent call last): File "C:\IronPython-2.7.2rc1\Tools\Scripts\pyc.py", line 255, in File "C:\IronPython-2.7.2rc1\Tools\Scripts\pyc.py", line 250, in Main File "C:\IronPython-2.7.2rc1\Tools\Scripts\pyc.py", line 165, in GenerateExe TypeError: Warto?? nie mo?e by? zerowa. Nazwa parametru: methodInfo Translation ======== TypeError: Value can not be zero. Parameter name: methodInfo"----------------- 10. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py http://ironpython.codeplex.com/workitem/30263 User peterSchwalm has commented on the issue: "By debugging ipy.exe in VS 2010 I found out that the mentioned line (options["Arguments"]....RemoveFirst...) is not executed when ipy.exe executes a python script. And the comment of the containing function InitializeModule() also states that the function is provided for the pyc.py generated .exe-stub. So I also think it's save to remove the "RemoveFirst()"." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Mon Mar 5 19:18:23 2012 From: cmello at gmail.com (Cesar Mello) Date: Mon, 5 Mar 2012 15:18:23 -0300 Subject: [Ironpython-users] Importing modules in a restricted AppDomain Message-ID: Hi! Is there a way to load modules without giving permission to the AppDomain to read .py files from disk? I need to run user code with limited permissions. They should be able to do some simple calculations. But when I try to import a module like 'decimal', filesystem access permission is required. Thank you a lot for the attention! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Mon Mar 5 20:26:37 2012 From: cmello at gmail.com (Cesar Mello) Date: Mon, 5 Mar 2012 16:26:37 -0300 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: Message-ID: Please ignore my previous question. Sucessfully added FileIOPermission with PathDiscovery and it worked: var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath(); permissionSet.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, pythonLibsPath)); Now I'm facing some problem with Emit permissions. Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't work. I'm using .NET 4 in this project at work. Sorry if the subject is too general and off-topic. Best regards Mello Message: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name, Boolean emitSymbolInfo) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable, PortableExecutableKinds peKind, ImageFileMachine machine) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable) at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String nameSuffix, Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean emitSymbols, AssemblyGen& assembly) at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type parent, Boolean preserveName, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 lambda, Boolean emitDebugSymbols) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello wrote: > Hi! > > Is there a way to load modules without giving permission to the AppDomain > to read .py files from disk? > > I need to run user code with limited permissions. They should be able to > do some simple calculations. But when I try to import a module like > 'decimal', filesystem access permission is required. > > Thank you a lot for the attention! > > Best regards > Mello > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mchalkley at mail.com Mon Mar 5 20:56:16 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Mon, 5 Mar 2012 14:56:16 -0500 Subject: [Ironpython-users] Distributing apps In-Reply-To: <1591595792.20120305081118@mail.com> References: <536820758.20120302103745@mail.com> <1267062163.20120302123344@mail.com> <1818417507.20120302155809@mail.com> <1309456662.20120304213512@mail.com> <1591595792.20120305081118@mail.com> Message-ID: <13810383871.20120305145616@mail.com> Monday, March 5, 2012, 8:11:18 AM, you wrote: > Sunday, March 4, 2012, 11:54:19 PM, you wrote: >> On Sun, Mar 4, 2012 at 6:35 PM, wrote: >>> I have one more question regarding deploying python apps. If I put the >>> python libraries I'm using (string, etc.) into a zip file, the app >>> doesn't see it in the current working directory, for some reason. >>> Since there's no PYTHONPATH on the target machine, and the 'os' module >>> isn't available until after the library is imported, what's the best >>> way to specify the path to the zipped lib file? I can specify a >>> complete path, using sys.path.append (e.g. 'c:\lib.zip'), which >>> requres putting it there, but is there a way specify the current >>> working directory, so I can deploy the program in one place, rather >>> than making the user copy the library to C:\ directory? >> Does that work on CPython? If so, it's a bug, so please open an issue for it. >> - Jeff > Done - thanks! > Mark As slide_o_mix correctly pointed out, the behavior of IronPython's import and directory handling are the same as CPython's. For the benefit of others who want to do the same thing, this is what worked for me: import sys sys.path.append('mymodules.zip') import Done this way, the zip file can be located in the same directory as the exe built with pyc.py. Thanks for all the help, Mark From jdhardy at gmail.com Tue Mar 6 05:54:17 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 5 Mar 2012 20:54:17 -0800 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: On Sun, Mar 4, 2012 at 5:21 AM, Cesar Mello wrote: > Hi! > > I created a Silverlight/WP project using Microsoft Visual Studio 2010 > Express for Windows Phone. Added references to all the DLLs in > IronPython-2.7.2rc1\Platforms\Sl4-WP71 . When I run the application I get > the following error: > > File or assembly name 'Microsoft.Scripting, Version=1.1.0.20, > Culture=neutral, PublicKeyToken=7F709C5B713576E1', or one of its > dependencies, was not found. > > Just curious if someone else has tried the binaries in WP7. > > Any suggestions, tests, information or even recommendations for debugging > are welcome! Hi Cesar, I was just trying to build an app and hit a similar error. Check to make sure that the assembly references are set to "Copy Local" (right-click on References->IronPython et al., Properties, Copy Local = True). - Jeff From cmello at gmail.com Tue Mar 6 11:45:19 2012 From: cmello at gmail.com (Cesar Mello) Date: Tue, 6 Mar 2012 07:45:19 -0300 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: Hi Jeff, Oh my! Thanks! On Sunday I had compiled everything from scratch using new Windows Phone 7.1 project files. :-O But I reached the same corner: expressions like 2 + 2 work, but 2 + 2.5 doesn't. Do I have to setup runtime options specific to WP7.1? I've pasted the stack trace below. I've heard somewhere there is a pure interpreted mode but I don't remember where... I guessed this was due to some problem with my custom project files, so I didn't want to bother in the list (I already do it too much sorry! :-)) Best regards! Mello System.NotSupportedException at System.Reflection.MethodInfo.get_ReturnParameter() at Microsoft.Scripting.Actions.Calls.ReflectionOverloadInfo.get_ReturnParameter() at IronPython.Runtime.Binding.SlotOrFunction.get_MaybeNotImplemented() at IronPython.Runtime.Binding.PythonProtocol.MakeOneTarget(PythonContext state, SlotOrFunction target, PythonTypeSlot slotTarget, ConditionalBuilder bodyBuilder, Boolean reverse, DynamicMetaObject[] types) at IronPython.Runtime.Binding.PythonProtocol.MakeBinaryOperatorResult(DynamicMetaObject[] types, DynamicMetaObjectBinder operation, PythonOperationKind op, SlotOrFunction fCand, SlotOrFunction rCand, PythonTypeSlot fSlot, PythonTypeSlot rSlot, DynamicMetaObject errorSuggestion) at IronPython.Runtime.Binding.PythonProtocol.MakeSimpleOperation(DynamicMetaObject[] types, DynamicMetaObjectBinder binder, PythonOperationKind operation, DynamicMetaObject errorSuggestion) at IronPython.Runtime.Binding.PythonProtocol.MakeBinaryOperation(DynamicMetaObjectBinder operation, DynamicMetaObject[] args, PythonOperationKind opStr, DynamicMetaObject errorSuggestion) at IronPython.Runtime.Binding.PythonProtocol.Operation(BinaryOperationBinder operation, DynamicMetaObject target, DynamicMetaObject arg, DynamicMetaObject errorSuggestion) at IronPython.Runtime.Binding.PythonBinaryOperationBinder.FallbackBinaryOperation(DynamicMetaObject target, DynamicMetaObject arg, DynamicMetaObject errorSuggestion) at System.Dynamic.BinaryOperationBinder.FallbackBinaryOperation(DynamicMetaObject target, DynamicMetaObject arg) at System.Dynamic.DynamicMetaObject.BindBinaryOperation(BinaryOperationBinder binder, DynamicMetaObject arg) at System.Dynamic.BinaryOperationBinder.Bind(DynamicMetaObject target, DynamicMetaObject[] args) at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel) at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, Object arg0, Object arg1) at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](CodeContext arg0, FunctionCode arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at IronPythonPhone.MainPage.button1_Click(Object sender, RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName) On Tue, Mar 6, 2012 at 1:54 AM, Jeff Hardy wrote: > On Sun, Mar 4, 2012 at 5:21 AM, Cesar Mello wrote: > > Hi! > > > > I created a Silverlight/WP project using Microsoft Visual Studio 2010 > > Express for Windows Phone. Added references to all the DLLs in > > IronPython-2.7.2rc1\Platforms\Sl4-WP71 . When I run the application I get > > the following error: > > > > File or assembly name 'Microsoft.Scripting, Version=1.1.0.20, > > Culture=neutral, PublicKeyToken=7F709C5B713576E1', or one of its > > dependencies, was not found. > > > > Just curious if someone else has tried the binaries in WP7. > > > > Any suggestions, tests, information or even recommendations for debugging > > are welcome! > > Hi Cesar, > I was just trying to build an app and hit a similar error. Check to > make sure that the assembly references are set to "Copy Local" > (right-click on References->IronPython et al., Properties, Copy Local > = True). > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From see_toronto at web.de Tue Mar 6 11:54:48 2012 From: see_toronto at web.de (Frank Schusdziarra) Date: Tue, 06 Mar 2012 11:54:48 +0100 Subject: [Ironpython-users] Issue with restricted AppDomain Message-ID: <4F55ECF8.9050909@web.de> Hi all, I'm having trouble to run Python scripts from a C# app with IP 2.7.1 embedded in a restricted AppDomain. I have checked all the advice I could find on the net, but I must be missing something. This is the requirement: C# app creates a restricted app domain for the scripts to execute. The scripts however are allowed to access e.g. the lib folder and it's modules. If running in "unrestricted" mode, all works fine, but thats clearly not what I would like to achieve. Among other exceptions thrown (e.g. regarding Environment) there is one that seams to really cause the trouble: [System.Security.SecurityException] = {"Request failed."} at Microsoft.Scripting.Utils.WeakHandle..ctor(Object target, Boolean trackResurrection) at IronPython.Runtime.WeakRefTracker.CallbackInfo..ctor(Object callback, Object weakRef) at IronPython.Runtime.WeakRefTracker.ChainCallback(Object callback, Object weakRef) at IronPython.Runtime.WeakRefTracker..ctor(Object callback, Object weakRef) at IronPython.Modules.PythonWeakRef.WeakRefHelpers.InitializeWeakRef(Object self, Object target, Object callback) at IronPython.Modules.PythonWeakRef.ref..ctor(Object object, Object callback) at IronPython.Modules.PythonWeakRef.ref..ctor(Object object) at IronPython.Modules.PythonWeakRef.ref.__new__(CodeContext context, PythonType cls, Object object) at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) This exception is however not "visible" in the calling app domain. I understand that there is an outstanding bug regarding serialization of exception information. However a breakpoint on the WeakHandle ctor call allowed me to get the above exception information. But I can't figure out which permission is actually missing or if there is anything else I'm doing wrong. Any advice is greatly appreciated. Here's a stripped down sample (C# 4.0 console app) to reproduce the issue: using System; using System.Collections.Generic; using System.IO; using System.Security; using System.Security.Policy; using System.Security.Permissions; using System.Reflection; using Microsoft.Scripting.Hosting; using IronPython.Hosting; namespace SimpleAD { class Program { static void Main(string[] args) { string pyLibPath = @""; string code = @" print 'Importing sys and addding lib path' import sys sys.path.append('"+pyLibPath+@"') print 'Importing os' import os print 'OS Name',os.name print 'Done' "; StrongName fullTrustAssembly = typeof(Program).Assembly.Evidence.GetHostEvidence(); Evidence evi = AppDomain.CurrentDomain.Evidence; AppDomainSetup adSetup = new AppDomainSetup(); adSetup.ApplicationBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); /* THIS IS WORKING ! PermissionSet permSet = new PermissionSet(PermissionState.Unrestricted); */ PermissionSet permSet = new PermissionSet(PermissionState.None); permSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); permSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); FileIOPermission libPerm = new FileIOPermission(PermissionState.None); libPerm.AddPathList(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, adSetup.ApplicationBase); // Assembly Path libPerm.AddPathList(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, pyLibPath); // Iron-Python Lib Path permSet.AddPermission(libPerm); AppDomain restricted = AppDomain.CreateDomain("Sandbox",evi,adSetup,permSet,fullTrustAssembly); Dictionary options = new Dictionary(); ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(options); ScriptRuntime runtime = ScriptRuntime.CreateRemote(restricted, setup); ScriptEngine engine = runtime.GetEngine("Python"); try { engine.Execute(code); } catch (Exception e) { (new PermissionSet(PermissionState.Unrestricted)).Assert(); Console.WriteLine("Error:" + e.ToString()); CodeAccessPermission.RevertAssert(); } Console.ReadLine(); } } } Regards, Frank From no_reply at codeplex.com Tue Mar 6 13:02:46 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 6 Mar 2012 04:02:46 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/5/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 2. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 3. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 4. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 5. [New comment] Compiling issue in IronPython 2.7.2 RC 1 6. [New comment] Compiling issue in IronPython 2.7.2 RC 1 7. [New comment] Compiling issue in IronPython 2.7.2 RC 1 8. [New comment] Compiling issue in IronPython 2.7.2 RC 1 9. [New comment] Compiling issue in IronPython 2.7.2 RC 1 10. [New comment] Compiling issue in IronPython 2.7.2 RC 1 11. [Status update] Compiling issue in IronPython 2.7.2 RC 1 12. [New issue] Import does not search current working directory 13. [New comment] Import does not search current working directory 14. [New comment] Import does not search current working directory 15. [New comment] zipimport does not search current working directory 16. [New comment] zipimport does not search current working directory 17. [Status update] zipimport does not search current working directory 18. [New issue] Fatal app exit on import uuid 19. [New comment] Fatal app exit on import uuid ---------------------------------------------- ISSUES 1. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py http://ironpython.codeplex.com/workitem/30263 User slide_o_mix has commented on the issue: "Is there any problem that the args[0] will be the executable rather than a .py?"----------------- 2. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py http://ironpython.codeplex.com/workitem/30263 User peterSchwalm has commented on the issue: "I think the .exe-path as argv[0] should be not be problem. I think that should be considered in terms of compatibility with CPython (and C/C++). In these environments argv[1] ... argv[n] are always the "real" commandline arguments, whereas argv[0] is always "the program", usually identical to the way the program was effectively called (on the command line, by a link or whatever). So: argv[0] should give infos about the way the script/program is called, at least it should allow to extract the script name, possibly by using os.path.basename / os.path.dirname / os.path.splitext. argv[1] ... argv[n] should be the "real" arguments If I have script fileCopy.py, copying file source to file target, then fileCopy.py should be able to copy file argv[1] to file argv[2] regardless of whether the command line reads: ipy fileCopy.py infileName outFileName or fileCopy.exe inFileName outFileName or simply fileCopy inFileName outFileName "----------------- 3. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py http://ironpython.codeplex.com/workitem/30263 User peterSchwalm has commented on the issue: "... addition to last comment. In CPython these conditions are met with direct execution (python fileCopy.py ...) as well as with execution of a frozen script (fileCopy.exe ...) "----------------- 4. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py http://ironpython.codeplex.com/workitem/30263 User slide_o_mix has commented on the issue: "Fixed in c0ec50a"----------------- 5. [New comment] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User slide_o_mix has commented on the issue: "Can you attach your test script just to make sure there is not something I am missing?"----------------- 6. [New comment] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User slide_o_mix has commented on the issue: "Actually, now that I look at this issue again, you are saying that only the version of pyc.py that comes with the binaries of the RC1 shows this issue? If you use the installer, it does not?"----------------- 7. [New comment] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User slide_o_mix has commented on the issue: "I can't reproduce this issue with the binaries. Can you verify that you don't have another IronPython installation in your path, or that the IronPython DLL's from an older version are not in the GAC?"----------------- 8. [New comment] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User krysros has commented on the issue: ""IronPython DLL's from an older version are not in the GAC?" Perhaps this caused this issue. I tried again IronPython 2.7.2 RC 1 Binaries and it works. Now I have installed IronPython 2.7.2 RC 1 Installer version, I did not add path to IronPython to PATH variable. I'm using absolute paths as above. "you are saying that only the version of pyc.py that comes with the binaries of the RC1 shows this issue? If you use the installer, it does not?" Exactly. "Can you attach your test script" It's not a test of pyc.py, it's just an example. Script in the attachment."----------------- 9. [New comment] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User slide_o_mix has commented on the issue: "I think this is not an issue then, correct?"----------------- 10. [New comment] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User krysros has commented on the issue: "Corrent. To close."----------------- 11. [Status update] Compiling issue in IronPython 2.7.2 RC 1 http://ironpython.codeplex.com/workitem/32345 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Not a bug"----------------- 12. [New issue] Import does not search current working directory http://ironpython.codeplex.com/workitem/32352 User mchalkley has proposed the issue: "According to http://docs.python.org/tutorial/modules.html, import includes the current working directory in its search path by default. Ironpython does not appear to do so."----------------- 13. [New comment] Import does not search current working directory http://ironpython.codeplex.com/workitem/32352 User slide_o_mix has commented on the issue: "Please attach a test script to reproduce."----------------- 14. [New comment] Import does not search current working directory http://ironpython.codeplex.com/workitem/32352 User mchalkley has commented on the issue: "It appears the problem lies with zipimport, which would explain some of the earlier confusion. A script consisting simply of "import testlib" works, assuming testlib is a file named testlib.py and located in the same directory as the exe. If testlib is a zip file named testlib.zip, it doesn't work."----------------- 15. [New comment] zipimport does not search current working directory http://ironpython.codeplex.com/workitem/32352 User slide_o_mix has commented on the issue: "I don't think zip files are automatically searched on CPython either."----------------- 16. [New comment] zipimport does not search current working directory http://ironpython.codeplex.com/workitem/32352 User mchalkley has commented on the issue: "You're correct - the behavior is the same as CPython. This issue can be closed."----------------- 17. [Status update] zipimport does not search current working directory http://ironpython.codeplex.com/workitem/32352 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Not a bug."----------------- 18. [New issue] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has proposed the issue: "The below says it all: G:\BEurtle\BEXML>ipy IronPython 2.7.2rc1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import uuid Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at IronPython.Modules.NativeFunctions.LoadLibrary(String lpFileName) at IronPython.Modules.NativeFunctions.LoadDLL(String filename, Int32 flags) at IronPython.Modules.CTypes.LoadLibrary(String library, Int32 mode) at Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at IronPython.Compiler.Ast.CallExpression.Invoke2Instruction.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at Microsoft.Scripting.Interpreter.FuncCallInstruction`9.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite`1.CallTarget(CallSite site, CodeContext context, Object inst, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.PythonType.FastTypeSite`1.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) at IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) at IronPython.Runtime.Importer.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) at Microsoft.Scripting.Hosting.Shell.CommandLine.Run() at IronPython.Hosting.PythonCommandLine.Run() at Microsoft.Scripting.Hosting.Shell.CommandLine.Run(ScriptEngine engine, IConsole console, ConsoleOptions options) at Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() at PythonConsoleHost.ExecuteInternal() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) at PythonConsoleHost.Main(String[] args) Same problem in v2.7.1 stable. Niall"----------------- 19. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has commented on the issue: "Attaching the traceback ..." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue Mar 6 18:25:51 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 6 Mar 2012 09:25:51 -0800 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: On Tue, Mar 6, 2012 at 2:45 AM, Cesar Mello wrote: > Hi Jeff, > But I reached the same corner: expressions like 2 + 2 work, but 2 + 2.5 > doesn't. Do I have to setup runtime options specific to WP7.1? I've pasted > the stack trace below. I've heard somewhere there is a pure interpreted mode > but I don't remember where... IronPython isn't fully interpreted yet (IronRuby is, I believe). That's why the iOS port doesn't work at all, and WP has issues as well. Keep in mind these are "previews" for a reason - they've hardly been tested at all (clearly, if adding int + float doesn't even work...). This case, though, the interpreter is not affected. According to MSDN (http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.returntype(v=vs.95).aspx), ReturnParameter is not supported (present, but not supported. FFS). In this case a '#ifdef WP75' is used to separate WP workarounds from real code. Looking at it briefly I can't see an obvious workaround (I'm not sure what interactions MaybeNotImplementedAttribute will have); can you open an issue and attach a minimal repro if possible? Also, thank you for looking at WP stuff. It needs people to hammer on it to make sure that it works and find its limitations. - Jeff From dinov at microsoft.com Tue Mar 6 19:00:53 2012 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 6 Mar 2012 18:00:53 +0000 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D17DCE@TK5EX14MBXC294.redmond.corp.microsoft.com> Jeff wrote: > Looking at it briefly I can't see an obvious workaround (I'm not sure what > interactions MaybeNotImplementedAttribute will have); can you open an issue > and attach a minimal repro if possible? MaybeNotImplemented means that the method might return Python's NotImplemented. If the method might return that then we'll need to check the return value, and if we did get NotImplemented then we'll need to call the reverse method. For example if we're doing a + b and a.__add__ might return NotImplemented then we need to also generate code to do b.__radd__(a). But if we know that it'll never return NotImplemented (either because the type isn't object, or because it's a built-in function not decorated with this method) then we can skip the extra code gen. If there's no workaround you could make this say that it might always return NotImplemented. That'll cause some extra code gen but everything should still be correct. But ReturnTypeCustomAttributes does seem to be supported in the portable class library, so maybe that'll work? From cmello at gmail.com Tue Mar 6 20:43:13 2012 From: cmello at gmail.com (Cesar Mello) Date: Tue, 6 Mar 2012 16:43:13 -0300 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: Hi Jeff, > Looking at it briefly I can't see an obvious workaround (I'm not sure > what interactions MaybeNotImplementedAttribute will have); can you > open an issue and attach a minimal repro if possible? > > Sure! I'll open this issue at home later, because the Windows Phone use case is for a pet project in my spare time just for fun. That said, we are using IronPython at work with .NET 4, but I don't want to mix personal stuff with professional duties. You know. :-) > Also, thank you for looking at WP stuff. It needs people to hammer on > it to make sure that it works and find its limitations. > > Nice! It's a pleasure to help. I just don't have enough knowledge about the codebase and even Python is a new thing to me, but my objective is to learn. Hacking IronPython seems to be the best way to learn and have fun at the same time. (I've seen quite a nice performance from PyPy so I imagine there is a lot of room for optimizations in the long run too). Thanks a lot for the help! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 7 14:01:22 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 7 Mar 2012 10:01:22 -0300 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: Hi, For the repro sample, do you prefer to have references to the RC1 binaries, or should I add the IronPython projects to compile from source and aid debugging? A second question: what solution and projects are being used for the Windows Phone build? Thanks Mello On Tue, Mar 6, 2012 at 4:43 PM, Cesar Mello wrote: > Hi Jeff, > > >> Looking at it briefly I can't see an obvious workaround (I'm not sure >> what interactions MaybeNotImplementedAttribute will have); can you >> open an issue and attach a minimal repro if possible? >> >> > Sure! I'll open this issue at home later, because the Windows Phone use > case is for a pet project in my spare time just for fun. That said, we are > using IronPython at work with .NET 4, but I don't want to mix personal > stuff with professional duties. You know. :-) > > > >> Also, thank you for looking at WP stuff. It needs people to hammer on >> it to make sure that it works and find its limitations. >> >> > Nice! It's a pleasure to help. I just don't have enough knowledge about > the codebase and even Python is a new thing to me, but my objective is to > learn. Hacking IronPython seems to be the best way to learn and have fun > at the same time. (I've seen quite a nice performance from PyPy so I > imagine there is a lot of room for optimizations in the long run too). > > Thanks a lot for the help! > > Best regards > Mello > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 7 14:17:07 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 7 Mar 2012 10:17:07 -0300 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: Message-ID: Hi, Must I grant fulltrust permissions to the IronPython assemblies? Sorry for the basic question, but will the scripts still be restricted in this case? Thank you a lot. This is a bit urgent for me, because it's the last step before I can finish the prototype with IronPython and let it be accepted for embedding in our product. Best regards! Mello On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello wrote: > Please ignore my previous question. Sucessfully added FileIOPermission > with PathDiscovery and it worked: > > var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath(); > permissionSet.AddPermission(new > FileIOPermission(FileIOPermissionAccess.PathDiscovery | > FileIOPermissionAccess.Read, pythonLibsPath)); > > > Now I'm facing some problem with Emit permissions. > Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't > work. > > I'm using .NET 4 in this project at work. Sorry if the subject is too > general and off-topic. > > Best regards > Mello > > Message: Request for the permission of type > 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. > > at System.Security.CodeAccessSecurityEngine.Check(Object demand, > StackCrawlMark& stackMark, Boolean isPermSet) > at System.Security.CodeAccessPermission.Demand() > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) > at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String > name, Boolean emitSymbolInfo) > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable, > PortableExecutableKinds peKind, ImageFileMachine machine) > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable) > at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String > nameSuffix, Boolean emitSymbols) > at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean > emitSymbols, AssemblyGen& assembly) > at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean > emitSymbols) > at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type > parent, Boolean preserveName, Boolean emitDebugSymbols) > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) > at > Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 > lambda, Boolean emitDebugSymbols) > at IronPython.Compiler.RuntimeScriptCode.Compile() > at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String > name, String fullName, String str) > at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, > String name, String fullName, List path, Func`5 defaultLoader) > 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.Modules.Builtin.__import__(CodeContext context, String > name, Object globals, Object locals, Object fromlist, Int32 level) > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame > frame) > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) > at > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 > arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) > at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, > String fullName, PythonTuple from, Int32 level) > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level) > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame) > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 > arg0, T1 arg1) > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) > at IronPython.Compiler.PythonScriptCode.Run(Scope scope) > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope) > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope) > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174 > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82 > > > > On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello wrote: > >> Hi! >> >> Is there a way to load modules without giving permission to the AppDomain >> to read .py files from disk? >> >> I need to run user code with limited permissions. They should be able to >> do some simple calculations. But when I try to import a module like >> 'decimal', filesystem access permission is required. >> >> Thank you a lot for the attention! >> >> Best regards >> Mello >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicka at Vipac.com.au Wed Mar 7 04:23:33 2012 From: nicka at Vipac.com.au (Nick Aschberger) Date: Wed, 7 Mar 2012 14:23:33 +1100 Subject: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? Message-ID: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD185D@ruby.vipac.com.au> Hi All, I have added in IronPython references to my project via nuget, and things are working swimmingly. However, as I'm ramping up on using IronPython, I'm finding a need inside visual studio to hit good 'ol F12, and jump to the definition of a fn or class to have a bit of a read. I'm talking specifically about the CLR objects such as engine, ScriptScope, etc. However, there is no XML commentary in the referenced DLL, so there is nothing to read there. No problem - I figured there would be a class reference or other documentation around to explain to me what each function is for. But I can't find one. Perhaps due to weak google-fu. There is nothing installed, nothing online. Now there must be something out there, otherwise no-one would know what any of the functions actually do. J So where can I get this? Thanks in advance, Nick Aschberger -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Mar 7 18:01:53 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 7 Mar 2012 09:01:53 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/6/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Exception().__doc__ different from CPython 2. [New comment] Include RST docs in source control, ship HTML docs 3. [New comment] __file__ incorrect for modules compiled with Pyc 4. [Status update] ipy.exe hangs with 100% CPU core usage when inserting certain data into DB 5. [New comment] Pyc.py and FolderBrowserDialog 6. [Status update] IronPython 2.7.1 csv pyc 7. [Status update] 1.1: NullReferenceException if compiling with .resources that contains a string (or any non-stream resource) 8. [New comment] ipy.exe / pyc.py fails to create working WPF .exe on Windows Server 2008-64, .NET 4.0 9. [New comment] ipy.exe / pyc.py fails to create working WPF .exe on Windows Server 2008-64, .NET 4.0 10. [New comment] When compiling an EXE pyc.py should set STA thread for winexe's and provide control of STA/MTA 11. [New comment] When compiling an EXE pyc.py should set STA thread for winexe's and provide control of STA/MTA 12. [New comment] Compiling with pyc.py for asp.net 13. [Status update] IronPython desktop CLR debugging tests fail randomly with signed binaries 14. [New comment] Fatal app exit on import uuid 15. [New comment] Fatal app exit on import uuid 16. [New comment] Fatal app exit on import uuid 17. [Status update] ImportError: No module named strop 18. [Status update] SystemError: Attempted to read or write protected memory (While importing xmlrpclib) 19. [New comment] when compiling a .aspx.py file to dll by using clr.CompileModules() , the module in the dll created can't be imported 20. [Status update] when compiling a .aspx.py file to dll by using clr.CompileModules() , the module in the dll created can't be imported 21. [New comment] Support providing .NET configuration file for launching ipy.exe's app domain (was Error loading mixed mode DLL) 22. [New comment] Visual Studio warning C4945 when embedding IronPython 2.6RC2 as a scripting engine 23. [Status update] Visual Studio warning C4945 when embedding IronPython 2.6RC2 as a scripting engine 24. [New comment] Bad error message when accessing namespace member which doesn't exist 25. [New comment] Incorrect error message thrown when an argument is passed to a C# method expecting a dictionary 26. [New comment] Ironpython 2.7.1 on Windows 7 64bit Machines ---------------------------------------------- ISSUES 1. [New comment] Exception().__doc__ different from CPython http://ironpython.codeplex.com/workitem/25155 User slide_o_mix has commented on the issue: "Fixed in abff4a3"----------------- 2. [New comment] Include RST docs in source control, ship HTML docs http://ironpython.codeplex.com/workitem/25113 User slide_o_mix has commented on the issue: "Is this still an issue?"----------------- 3. [New comment] __file__ incorrect for modules compiled with Pyc http://ironpython.codeplex.com/workitem/21715 User slide_o_mix has commented on the issue: "Is this still an issue with 2.7.2?"----------------- 4. [Status update] ipy.exe hangs with 100% CPU core usage when inserting certain data into DB http://ironpython.codeplex.com/workitem/26500 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce."----------------- 5. [New comment] Pyc.py and FolderBrowserDialog http://ironpython.codeplex.com/workitem/27118 User slide_o_mix has commented on the issue: "This works for me with 2.7.1 which sets STAThreadAttribute on the main if using winexe."----------------- 6. [Status update] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "This is not a bug."----------------- 7. [Status update] 1.1: NullReferenceException if compiling with .resources that contains a string (or any non-stream resource) http://ironpython.codeplex.com/workitem/17684 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce."----------------- 8. [New comment] ipy.exe / pyc.py fails to create working WPF .exe on Windows Server 2008-64, .NET 4.0 http://ironpython.codeplex.com/workitem/29028 User slide_o_mix has commented on the issue: "FYI, winexe targets will not wait on the console, they will immediately return on the console. This is the same as most windows subsystem applications."----------------- 9. [New comment] ipy.exe / pyc.py fails to create working WPF .exe on Windows Server 2008-64, .NET 4.0 http://ironpython.codeplex.com/workitem/29028 User slide_o_mix has commented on the issue: "Please attach a test to reproduce."----------------- 10. [New comment] When compiling an EXE pyc.py should set STA thread for winexe's and provide control of STA/MTA http://ironpython.codeplex.com/workitem/19409 User slide_o_mix has commented on the issue: "The second item about setting console application is fixed already."----------------- 11. [New comment] When compiling an EXE pyc.py should set STA thread for winexe's and provide control of STA/MTA http://ironpython.codeplex.com/workitem/19409 User slide_o_mix has commented on the issue: "Fixed in 5bc4722"----------------- 12. [New comment] Compiling with pyc.py for asp.net http://ironpython.codeplex.com/workitem/26361 User slide_o_mix has commented on the issue: "Please attach a test"----------------- 13. [Status update] IronPython desktop CLR debugging tests fail randomly with signed binaries http://ironpython.codeplex.com/workitem/23963 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce"----------------- 14. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has commented on the issue: "Should have added this yesterday, but was tired. Failing system is running Windows 7 x64. The above appears to be a 32 bit IronPython, I don't think IronPython comes in 64 bit flavours. IronPython is not installed on C:\, rather on G:\. The above traceback looks like it's trying to load a DLL which is missing, hence why I mention the G:\ thing. Even if it is missing a file, a fatal segfault is not the correct way to handle it. Niall "----------------- 15. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has commented on the issue: "Good news: the 64 bit version works as expected: G:\BEurtle\BEXML>ipy64 IronPython 2.7.2rc1 (2.7.0.40) on .NET 4.0.30319.261 (64-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import uuid >>> Obviously this is a 32 bit on 64 bit issue. Niall "----------------- 16. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User jdhardy has commented on the issue: "Looks like a mucked-up ctypes call. Should be easy enough to fix. ipy64.exe is the 64-bit (actually AnyCPU) version of IronPython."----------------- 17. [Status update] ImportError: No module named strop http://ironpython.codeplex.com/workitem/23856 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "strop is deprecated and should not be used directly."----------------- 18. [Status update] SystemError: Attempted to read or write protected memory (While importing xmlrpclib) http://ironpython.codeplex.com/workitem/17332 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This works on 2.7.2rc1"----------------- 19. [New comment] when compiling a .aspx.py file to dll by using clr.CompileModules() , the module in the dll created can't be imported http://ironpython.codeplex.com/workitem/26387 User slide_o_mix has commented on the issue: "Please attach a test so that this can be reproduced."----------------- 20. [Status update] when compiling a .aspx.py file to dll by using clr.CompileModules() , the module in the dll created can't be imported http://ironpython.codeplex.com/workitem/26387 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Duplicate of 26361"----------------- 21. [New comment] Support providing .NET configuration file for launching ipy.exe's app domain (was Error loading mixed mode DLL) http://ironpython.codeplex.com/workitem/26165 User slide_o_mix has commented on the issue: "http://reedcopsey.com/2011/09/15/setting-uselegacyv2runtimeactivationpolicy-at-runtime/"----------------- 22. [New comment] Visual Studio warning C4945 when embedding IronPython 2.6RC2 as a scripting engine http://ironpython.codeplex.com/workitem/25165 User slide_o_mix has commented on the issue: "I am unable to reproduce this scenario on IP2.7, please try 2.7.1 or 2.7.2 and update if you still see the issue."----------------- 23. [Status update] Visual Studio warning C4945 when embedding IronPython 2.6RC2 as a scripting engine http://ironpython.codeplex.com/workitem/25165 User slide_o_mix has updated the issue: Status has changed from Active to Closed. ----------------- 24. [New comment] Bad error message when accessing namespace member which doesn't exist http://ironpython.codeplex.com/workitem/25476 User slide_o_mix has commented on the issue: "This could possibly be solved by doing the following in PythonOps.cs public static Exception AttributeErrorForMissingAttribute(object o, string name) { PythonType dt = o as PythonType; if (dt != null) return PythonOps.AttributeErrorForMissingAttribute(dt.Name, name); dt = PythonType.GetPythonType(o.GetType()); if (dt != null) return PythonOps.AttributeErrorForMissingAttribute(dt.Name, name); return AttributeErrorForReadonlyAttribute(PythonTypeOps.GetName(o), name); } I don't know how this would affect other things though, so I will not commit it."----------------- 25. [New comment] Incorrect error message thrown when an argument is passed to a C# method expecting a dictionary http://ironpython.codeplex.com/workitem/18379 User slide_o_mix has commented on the issue: "Is this fixed, or not?"----------------- 26. [New comment] Ironpython 2.7.1 on Windows 7 64bit Machines http://ironpython.codeplex.com/workitem/31918 User slide_o_mix has commented on the issue: "I asked one of my coworkers to help translate the error message. It says: "IronPython Console has stopped work, windows is checking the soluation of this problem?. ?Don?t process exception: System.IO.FileLoadException: can not load file or program collection Microsoft.Dynamic,Version=1.1.0.20,Culture=newtral,PublicKeyToken=7f709c5b713576e1? or its one dependent option. Access is denied. "" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Mar 7 18:19:44 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 7 Mar 2012 17:19:44 +0000 Subject: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? In-Reply-To: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD185D@ruby.vipac.com.au> References: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD185D@ruby.vipac.com.au> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D1AB48@TK5EX14MBXC294.redmond.corp.microsoft.com> http://dlr.codeplex.com/wikipage?title=Docs%20and%20specs&referringTitle=Documentation has these 2 copies of the hosting spec: http://www.codeplex.com/Download?ProjectName=dlr&DownloadId=127513 [doc] http://www.codeplex.com/Download?ProjectName=dlr&DownloadId=127516 [pdf] Which should cover most of what you want. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Nick Aschberger Sent: Tuesday, March 06, 2012 7:24 PM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? Hi All, I have added in IronPython references to my project via nuget, and things are working swimmingly. However, as I'm ramping up on using IronPython, I'm finding a need inside visual studio to hit good 'ol F12, and jump to the definition of a fn or class to have a bit of a read. I'm talking specifically about the CLR objects such as engine, ScriptScope, etc. However, there is no XML commentary in the referenced DLL, so there is nothing to read there. No problem - I figured there would be a class reference or other documentation around to explain to me what each function is for. But I can't find one. Perhaps due to weak google-fu. There is nothing installed, nothing online. Now there must be something out there, otherwise no-one would know what any of the functions actually do. :) So where can I get this? Thanks in advance, Nick Aschberger -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Mar 7 18:31:55 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 7 Mar 2012 09:31:55 -0800 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: Please use the RC1 files if you can. The normal WP build uses the same project files as everything else - just set the configuration to WP7Debug (or maybe Silverlight3Debug, I can't remember if I actually renamed it). You can also build everything by opening a Visual Studio command prompt, navigating to the root, and running `msbuild`. The resulting files will be in bin. - Jeff On Wed, Mar 7, 2012 at 5:01 AM, Cesar Mello wrote: > Hi, > > For the repro sample, do you prefer to have references to the RC1 binaries, > or should I add the IronPython projects to compile from source and aid > debugging? > > A second question: what solution and projects are being used for the Windows > Phone build? > > Thanks > Mello > > > On Tue, Mar 6, 2012 at 4:43 PM, Cesar Mello wrote: >> >> Hi Jeff, >> >>> >>> Looking at it briefly I can't see an obvious workaround (I'm not sure >>> what interactions MaybeNotImplementedAttribute will have); can you >>> open an issue and attach a minimal repro if possible? >>> >> >> Sure! I'll open this issue at home later, because the Windows Phone use >> case is for a pet project in my spare time just for fun. That said, we are >> using IronPython at work with .NET 4, but I don't want to mix personal stuff >> with professional duties. You know. :-) >> >> >>> >>> Also, thank you for looking at WP stuff. It needs people to hammer on >>> it to make sure that it works and find its limitations. >>> >> >> Nice! It's a pleasure to help. I just don't have enough knowledge about >> the codebase and even Python is a new thing to me, but my objective is to >> learn. ?Hacking IronPython seems to be the best way to learn and have fun at >> the same time. (I've seen quite a nice performance from PyPy so I imagine >> there is a lot of room for optimizations in the long run too). >> >> Thanks a lot for the help! >> >> Best regards >> Mello >> >> >> > From jdhardy at gmail.com Wed Mar 7 18:37:37 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 7 Mar 2012 09:37:37 -0800 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: Message-ID: On Wed, Mar 7, 2012 at 5:17 AM, Cesar Mello wrote: > Hi, > > Must I grant fulltrust permissions to the IronPython assemblies? Sorry for > the basic question, but will the scripts still be restricted in this case? You shouldn't have to, but we don't do any testing in restricted AppDomains and so I'm afraid it may have inadvertantly been broken. I've cc'd Dino; he might be able to help you a little more as this is an area I'm not familiar with. - Jeff From dinov at microsoft.com Wed Mar 7 18:41:47 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 7 Mar 2012 17:41:47 +0000 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D1AC4C@TK5EX14MBXC294.redmond.corp.microsoft.com> Jeff wrote: > You shouldn't have to, but we don't do any testing in restricted AppDomains and > so I'm afraid it may have inadvertantly been broken. > I've cc'd Dino; he might be able to help you a little more as this is an area I'm not > familiar with. We have a test :) It's in EngineTest.cs - ScenarioPartialTrust. It does a reasonable amount of things, but could certainly be better. From jdhardy at gmail.com Wed Mar 7 18:52:40 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 7 Mar 2012 09:52:40 -0800 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54D1AC4C@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54D1AC4C@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: On Wed, Mar 7, 2012 at 9:41 AM, Dino Viehland wrote: > Jeff wrote: >> You shouldn't have to, but we don't do any testing in restricted AppDomains and >> so I'm afraid it may have inadvertantly been broken. >> I've cc'd Dino; he might be able to help you a little more as this is an area I'm not >> familiar with. > > We have a test :) ?It's in EngineTest.cs - ScenarioPartialTrust. ?It does a reasonable > amount of things, but could certainly be better. Gah. I need to do a pass over the tests to make sure those are actually being run. - Jeff From jdhardy at gmail.com Wed Mar 7 18:56:44 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 7 Mar 2012 09:56:44 -0800 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: Message-ID: On Wed, Mar 7, 2012 at 5:17 AM, Cesar Mello wrote: > Hi, > > Must I grant fulltrust permissions to the IronPython assemblies? Sorry for > the basic question, but will the scripts still be restricted in this case? > > Thank you a lot. This is a bit urgent for me, because it's the last step > before I can finish the prototype with IronPython and let it be accepted for > embedding in our product. Are these similar to what you are seeing? http://ironpython.codeplex.com/workitem/24475 http://ironpython.codeplex.com/workitem/24101 Also, I did used to run IronPython in partial trust web sites, but that was a while ago. - Jeff From dinov at microsoft.com Wed Mar 7 18:34:00 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 7 Mar 2012 17:34:00 +0000 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> Nope, ideally IronPython's assemblies are not trusted. In general IronPython's assemblies are "security transparent" which means they don't affect any security decisions made by the CLR. If you gave them full trust then the user could do something like file('C:\\bad_file.txt', 'w+'). The security transparency means that IronPython can contain a bunch of code for accessing files and stuff but that code doesn't need to be audited for security because we don't have any permissions of our own. You might want to try doing something like: AppDomainSetup info = new AppDomainSetup(); info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; info.ApplicationName = "Test"; Evidence evidence = new Evidence(); evidence.AddHost(new Zone(SecurityZone.Internet)); System.Security.PermissionSet permSet = SecurityManager.GetStandardSandbox(evidence); AppDomain newDomain = AppDomain.CreateDomain("test", evidence, info, permSet, null); // create runtime in partial trust... ScriptRuntime runtime = Python.CreateRuntime(newDomain); Which will run the code in the internet zone which should be a safe set of permissions - you might need to add in your path access to this, but we use this setup in a test case so it definitely works. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Cesar Mello Sent: Wednesday, March 07, 2012 5:17 AM To: ironpython-users at python.org Subject: Re: [Ironpython-users] Importing modules in a restricted AppDomain Hi, Must I grant fulltrust permissions to the IronPython assemblies? Sorry for the basic question, but will the scripts still be restricted in this case? Thank you a lot. This is a bit urgent for me, because it's the last step before I can finish the prototype with IronPython and let it be accepted for embedding in our product. Best regards! Mello On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello > wrote: Please ignore my previous question. Sucessfully added FileIOPermission with PathDiscovery and it worked: var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath(); permissionSet.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, pythonLibsPath)); Now I'm facing some problem with Emit permissions. Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't work. I'm using .NET 4 in this project at work. Sorry if the subject is too general and off-topic. Best regards Mello Message: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name, Boolean emitSymbolInfo) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable, PortableExecutableKinds peKind, ImageFileMachine machine) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable) at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String nameSuffix, Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean emitSymbols, AssemblyGen& assembly) at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type parent, Boolean preserveName, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 lambda, Boolean emitDebugSymbols) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello > wrote: Hi! Is there a way to load modules without giving permission to the AppDomain to read .py files from disk? I need to run user code with limited permissions. They should be able to do some simple calculations. But when I try to import a module like 'decimal', filesystem access permission is required. Thank you a lot for the attention! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 7 19:45:22 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 7 Mar 2012 15:45:22 -0300 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: Thanks! I think I missed that one because I use the Express editions of Visual Studio at home. But now I see all the platforms are OK. Best regards Mello On Wed, Mar 7, 2012 at 2:31 PM, Jeff Hardy wrote: > Please use the RC1 files if you can. > > The normal WP build uses the same project files as everything else - > just set the configuration to WP7Debug (or maybe Silverlight3Debug, I > can't remember if I actually renamed it). > > You can also build everything by opening a Visual Studio command > prompt, navigating to the root, and running `msbuild`. The resulting > files will be in bin. > > - Jeff > > On Wed, Mar 7, 2012 at 5:01 AM, Cesar Mello wrote: > > Hi, > > > > For the repro sample, do you prefer to have references to the RC1 > binaries, > > or should I add the IronPython projects to compile from source and aid > > debugging? > > > > A second question: what solution and projects are being used for the > Windows > > Phone build? > > > > Thanks > > Mello > > > > > > On Tue, Mar 6, 2012 at 4:43 PM, Cesar Mello wrote: > >> > >> Hi Jeff, > >> > >>> > >>> Looking at it briefly I can't see an obvious workaround (I'm not sure > >>> what interactions MaybeNotImplementedAttribute will have); can you > >>> open an issue and attach a minimal repro if possible? > >>> > >> > >> Sure! I'll open this issue at home later, because the Windows Phone use > >> case is for a pet project in my spare time just for fun. That said, we > are > >> using IronPython at work with .NET 4, but I don't want to mix personal > stuff > >> with professional duties. You know. :-) > >> > >> > >>> > >>> Also, thank you for looking at WP stuff. It needs people to hammer on > >>> it to make sure that it works and find its limitations. > >>> > >> > >> Nice! It's a pleasure to help. I just don't have enough knowledge about > >> the codebase and even Python is a new thing to me, but my objective is > to > >> learn. Hacking IronPython seems to be the best way to learn and have > fun at > >> the same time. (I've seen quite a nice performance from PyPy so I > imagine > >> there is a lot of room for optimizations in the long run too). > >> > >> Thanks a lot for the help! > >> > >> Best regards > >> Mello > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 7 20:37:53 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 7 Mar 2012 16:37:53 -0300 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: Thanks a lot for the help guys. I'm trying to walk on my own, but just for a quick feedback I've used the code suggested and now when I run "import decimal" I get a MethodAccessException. I presumed it was safe to add all the Reflection permissions and then I get an unhandled ArgumentNullException (second stack trace). There is a bunch of internal SecurityExceptions that are handled in the meantime though. I'll try to debug this using the Console in a restricted AppDomain, so please don't bother to answer me if I am doing some silly mistake. Thanks and best regards! Mello Stack trace 1 (MethodAccessException) Attempt by method 'Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(System.Reflection.MethodInfo, System.Type, System.Object)' to access method 'IronPython.Compiler.Ast.UncollectableCompilationMode.NextSite>(System.Dynamic.DynamicMetaObjectBinder)' failed. at System.Delegate.BindToMethodInfo(Object target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags) at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method, Boolean throwOnBindFailure) at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo methodInfo, Type delegateType, Object target) at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo methodInfo, Type delegateType) at IronPython.Compiler.Ast.UncollectableCompilationMode.DelegateCache.MakeDelegateType(Type retType, Expression[] args) at IronPython.Compiler.Ast.UncollectableCompilationMode.ReduceDynamic(DynamicMetaObjectBinder binder, Type retType, Expression arg0, Expression arg1) at IronPython.Compiler.Ast.DynamicGetMemberExpression.Reduce() at System.Linq.Expressions.Expression.ReduceAndCheck() at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryBody(TryExpression node, LabelTarget ehLabel) at Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryCatch(TryExpression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitTry(TryExpression node) at System.Linq.Expressions.TryExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.Rewrite(Expression expr) at Microsoft.Scripting.Ast.LightExceptionConvertingExpression.Reduce() at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileLabelExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(LightLambdaExpression node) at Microsoft.Scripting.Ast.LightExpression`1.Compile(Int32 compilationThreshold) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at System.Func`7.Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 -------------------------------------------------- After adding Reflection permissions; at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) at System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext context) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Wed, Mar 7, 2012 at 2:34 PM, Dino Viehland wrote: > Nope, ideally IronPython?s assemblies are not trusted. In general > IronPython?s assemblies are ?security transparent? which means they don?t > affect any security decisions made by the CLR. If you gave them full trust > then the user could do something like file(?C:\\bad_file.txt?, ?w+?). The > security transparency means that IronPython can contain a bunch of code for > accessing files and stuff but that code doesn?t need to be audited for > security because we don?t have any permissions of our own.**** > > ** ** > > You might want to try doing something like:**** > > ** ** > > AppDomainSetup info = new AppDomainSetup();**** > > info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;* > *** > > info.ApplicationName = "Test";**** > > **** > > Evidence evidence = new Evidence();**** > > evidence.AddHost(new Zone(SecurityZone.Internet));**** > > ** ** > > System.Security.PermissionSet permSet = > SecurityManager.GetStandardSandbox(evidence);**** > > AppDomain newDomain = AppDomain.CreateDomain("test", evidence, > info, permSet, null);**** > > **** > > // create runtime in partial trust...**** > > ScriptRuntime runtime = Python.CreateRuntime(newDomain);**** > > ** ** > > Which will run the code in the internet zone which should be a safe set of > permissions ? you might need to add in your path access to this, but we use > this setup in a test case so it definitely works.**** > > ** ** > > *From:* ironpython-users-bounces+dinov=microsoft.com at python.org [mailto: > ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Cesar > Mello > *Sent:* Wednesday, March 07, 2012 5:17 AM > *To:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Importing modules in a restricted > AppDomain**** > > ** ** > > Hi,**** > > ** ** > > Must I grant fulltrust permissions to the IronPython assemblies? Sorry for > the basic question, but will the scripts still be restricted in this case? > **** > > ** ** > > Thank you a lot. This is a bit urgent for me, because it's the last step > before I can finish the prototype with IronPython and let it be accepted > for embedding in our product.**** > > ** ** > > Best regards!**** > > Mello**** > > ** ** > > ** ** > > On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello wrote:**** > > Please ignore my previous question. Sucessfully added FileIOPermission > with PathDiscovery and it worked:**** > > ** ** > > var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath();**** > > permissionSet.AddPermission(new > FileIOPermission(FileIOPermissionAccess.PathDiscovery | > FileIOPermissionAccess.Read, pythonLibsPath));**** > > ** ** > > ** ** > > Now I'm facing some problem with Emit permissions. > Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't > work.**** > > ** ** > > I'm using .NET 4 in this project at work. Sorry if the subject is too > general and off-topic.**** > > ** ** > > Best regards**** > > Mello**** > > ** ** > > Message: Request for the permission of type > 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.**** > > ** ** > > at System.Security.CodeAccessSecurityEngine.Check(Object demand, > StackCrawlMark& stackMark, Boolean isPermSet)**** > > at System.Security.CodeAccessPermission.Demand()**** > > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)**** > > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)**** > > at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String > name, Boolean emitSymbolInfo)**** > > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable, > PortableExecutableKinds peKind, ImageFileMachine machine)**** > > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable)**** > > at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String > nameSuffix, Boolean emitSymbols)**** > > at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean > emitSymbols, AssemblyGen& assembly)**** > > at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean > emitSymbols)**** > > at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type > parent, Boolean preserveName, Boolean emitDebugSymbols)**** > > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols)** > ** > > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols)** > ** > > at > Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 > lambda, Boolean emitDebugSymbols)**** > > at IronPython.Compiler.RuntimeScriptCode.Compile()**** > > at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled()**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String > name, String fullName, String str)**** > > at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, > String name, String fullName, List path, Func`5 defaultLoader)**** > > 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.Modules.Builtin.__import__(CodeContext context, String > name, Object globals, Object locals, Object fromlist, Int32 level)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 > arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)**** > > at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, > String fullName, PythonTuple from, Int32 level)**** > > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 > arg0, T1 arg1)**** > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)**** > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope)**** > > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)* > *** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > ** ** > > ** ** > > On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello wrote:**** > > Hi!**** > > ** ** > > Is there a way to load modules without giving permission to the AppDomain > to read .py files from disk?**** > > ** ** > > I need to run user code with limited permissions. They should be able to > do some simple calculations. But when I try to import a module like > 'decimal', filesystem access permission is required. **** > > ** ** > > Thank you a lot for the attention!**** > > ** ** > > Best regards**** > > Mello**** > > ** ** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Mar 7 20:47:00 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 7 Mar 2012 19:47:00 +0000 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D1B1B0@TK5EX14MBXC294.redmond.corp.microsoft.com> After adding the reflection permissions I wonder what the exception is. Instead of doing Engine.Execute(string, ScriptScope) can you instead call ExecuteAndWrap(string, ScriptScope, out ObjectHandle)? In general when you're working with the remote domain you'll want to use the *Wrap versions to avoid serializing results back into the local domain (which can fail). I'm not sure if we're trying to serialize an exception object here or the result of your execution, but either way one of those is failing. You should be able to check and see if the handles are null, and can also pass them back into the remote domain for formatting (using either ObjectOperations.Format or ExceptionOperations.FormatException) and just get a string back. From: Cesar Mello [mailto:cmello at gmail.com] Sent: Wednesday, March 07, 2012 11:38 AM To: Dino Viehland Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Importing modules in a restricted AppDomain Thanks a lot for the help guys. I'm trying to walk on my own, but just for a quick feedback I've used the code suggested and now when I run "import decimal" I get a MethodAccessException. I presumed it was safe to add all the Reflection permissions and then I get an unhandled ArgumentNullException (second stack trace). There is a bunch of internal SecurityExceptions that are handled in the meantime though. I'll try to debug this using the Console in a restricted AppDomain, so please don't bother to answer me if I am doing some silly mistake. Thanks and best regards! Mello Stack trace 1 (MethodAccessException) Attempt by method 'Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(System.Reflection.MethodInfo, System.Type, System.Object)' to access method 'IronPython.Compiler.Ast.UncollectableCompilationMode.NextSite>(System.Dynamic.DynamicMetaObjectBinder)' failed. at System.Delegate.BindToMethodInfo(Object target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags) at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method, Boolean throwOnBindFailure) at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo methodInfo, Type delegateType, Object target) at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo methodInfo, Type delegateType) at IronPython.Compiler.Ast.UncollectableCompilationMode.DelegateCache.MakeDelegateType(Type retType, Expression[] args) at IronPython.Compiler.Ast.UncollectableCompilationMode.ReduceDynamic(DynamicMetaObjectBinder binder, Type retType, Expression arg0, Expression arg1) at IronPython.Compiler.Ast.DynamicGetMemberExpression.Reduce() at System.Linq.Expressions.Expression.ReduceAndCheck() at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryBody(TryExpression node, LabelTarget ehLabel) at Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryCatch(TryExpression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitTry(TryExpression node) at System.Linq.Expressions.TryExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.Rewrite(Expression expr) at Microsoft.Scripting.Ast.LightExceptionConvertingExpression.Reduce() at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileLabelExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(LightLambdaExpression node) at Microsoft.Scripting.Ast.LightExpression`1.Compile(Int32 compilationThreshold) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at System.Func`7.Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 -------------------------------------------------- After adding Reflection permissions; at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) at System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext context) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Wed, Mar 7, 2012 at 2:34 PM, Dino Viehland > wrote: Nope, ideally IronPython's assemblies are not trusted. In general IronPython's assemblies are "security transparent" which means they don't affect any security decisions made by the CLR. If you gave them full trust then the user could do something like file('C:\\bad_file.txt', 'w+'). The security transparency means that IronPython can contain a bunch of code for accessing files and stuff but that code doesn't need to be audited for security because we don't have any permissions of our own. You might want to try doing something like: AppDomainSetup info = new AppDomainSetup(); info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; info.ApplicationName = "Test"; Evidence evidence = new Evidence(); evidence.AddHost(new Zone(SecurityZone.Internet)); System.Security.PermissionSet permSet = SecurityManager.GetStandardSandbox(evidence); AppDomain newDomain = AppDomain.CreateDomain("test", evidence, info, permSet, null); // create runtime in partial trust... ScriptRuntime runtime = Python.CreateRuntime(newDomain); Which will run the code in the internet zone which should be a safe set of permissions - you might need to add in your path access to this, but we use this setup in a test case so it definitely works. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Cesar Mello Sent: Wednesday, March 07, 2012 5:17 AM To: ironpython-users at python.org Subject: Re: [Ironpython-users] Importing modules in a restricted AppDomain Hi, Must I grant fulltrust permissions to the IronPython assemblies? Sorry for the basic question, but will the scripts still be restricted in this case? Thank you a lot. This is a bit urgent for me, because it's the last step before I can finish the prototype with IronPython and let it be accepted for embedding in our product. Best regards! Mello On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello > wrote: Please ignore my previous question. Sucessfully added FileIOPermission with PathDiscovery and it worked: var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath(); permissionSet.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, pythonLibsPath)); Now I'm facing some problem with Emit permissions. Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't work. I'm using .NET 4 in this project at work. Sorry if the subject is too general and off-topic. Best regards Mello Message: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name, Boolean emitSymbolInfo) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable, PortableExecutableKinds peKind, ImageFileMachine machine) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable) at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String nameSuffix, Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean emitSymbols, AssemblyGen& assembly) at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type parent, Boolean preserveName, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 lambda, Boolean emitDebugSymbols) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello > wrote: Hi! Is there a way to load modules without giving permission to the AppDomain to read .py files from disk? I need to run user code with limited permissions. They should be able to do some simple calculations. But when I try to import a module like 'decimal', filesystem access permission is required. Thank you a lot for the attention! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 7 21:11:52 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 7 Mar 2012 17:11:52 -0300 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54D1B1B0@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54D1B1B0@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: OK I changed from: m_engine.Execute("import decimal"); to ExecuteAndWrap, and the objectOperations.Format returns: Please notice I'm just importing the standard decimal module. Breaking into the first SecurityException I get the stack trace below. Thanks a lot! Best regards Mello mscorlib.dll!System.Security.CodeAccessSecurityEngine.ThrowSecurityException(System.Reflection.RuntimeAssembly asm, System.Security.PermissionSet granted, System.Security.PermissionSet refused, System.RuntimeMethodHandleInternal rmh, System.Security.Permissions.SecurityAction action, object demand, System.Security.IPermission permThatFailed) + 0x103 bytes mscorlib.dll!System.Security.CodeAccessSecurityEngine.CheckSetHelper(System.Security.PermissionSet grants, System.Security.PermissionSet refused, System.Security.PermissionSet demands, System.RuntimeMethodHandleInternal rmh, object assemblyOrString, System.Security.Permissions.SecurityAction action, bool throwException) + 0x160 bytes [Native to Managed Transition] [Managed to Native Transition] IronPython.dll!IronPython.Runtime.WeakRefTracker.CallbackInfo.CallbackInfo(object callback, object weakRef) + 0x5c bytes IronPython.dll!IronPython.Runtime.WeakRefTracker.ChainCallback(object callback, object weakRef) + 0x71 bytes IronPython.dll!IronPython.Runtime.WeakRefTracker.WeakRefTracker(object callback, object weakRef) + 0x8d bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.WeakRefHelpers.InitializeWeakRef(object self, object target, object callback) + 0xe1 bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.ref(object object, object callback) + 0x46 bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.ref(object object) + 0x35 bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.__new__(IronPython.Runtime.CodeContext context, IronPython.Runtime.Types.PythonType cls, object object) + 0x1df bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x23a bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) + 0x1e4 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2) + 0x63a bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x3b3 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) + 0x1e4 bytes IronPython.dll!IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x10f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run3(IronPython.Runtime.PythonFunction arg0, object arg1, object arg2) + 0x1b7 bytes IronPython.dll!IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(IronPython.Runtime.PythonFunction function, object arg0, object arg1) + 0xa8 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,IronPython.Runtime.PythonFunction,object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x2fb bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, IronPython.Runtime.PythonFunction arg2, object arg3) + 0x1e4 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, IronPython.Runtime.PythonFunction arg1, object arg2) + 0x63a bytes IronPython.dll!IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite.CallTarget(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object inst) + 0x102 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1) + 0x5f3 bytes IronPython.dll!IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object type) + 0x10f bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1) + 0x5f3 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x2fb bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run3(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2) + 0x1b7 bytes IronPython.dll!IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xbd bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run5(IronPython.Runtime.PythonFunction arg0, object arg1, object arg2, object arg3, object arg4) + 0x21a bytes IronPython.dll!IronPython.Compiler.PythonCallTargets.OriginalCallTarget4(IronPython.Runtime.PythonFunction function, object arg0, object arg1, object arg2, object arg3) + 0xc4 bytes IronPython.dll!IronPython.Runtime.PythonFunction.FunctionCaller.Call4(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object func, object arg0, string arg1, IronPython.Runtime.PythonTuple arg2, IronPython.Runtime.PythonDictionary arg3) + 0x11f bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute6(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2, string arg3, IronPython.Runtime.PythonTuple arg4, IronPython.Runtime.PythonDictionary arg5) + 0x70f bytes IronPython.dll!IronPython.Runtime.Types.PythonType.NewSite.Call(IronPython.Runtime.CodeContext context, object typeOrInstance, string arg0, IronPython.Runtime.PythonTuple arg1, IronPython.Runtime.PythonDictionary arg2) + 0x95 bytes IronPython.dll!IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object type, string arg0, IronPython.Runtime.PythonTuple arg1, IronPython.Runtime.PythonDictionary arg2) + 0xf3 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute5(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, string arg2, IronPython.Runtime.PythonTuple arg3, IronPython.Runtime.PythonDictionary arg4) + 0x6c8 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.MakeClass(IronPython.Runtime.CodeContext context, string name, object[] bases, string selfNames, IronPython.Runtime.PythonDictionary vars) + 0x5ac bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.MakeClass(IronPython.Runtime.FunctionCode funcCode, System.Func body, IronPython.Runtime.CodeContext parentContext, string name, object[] bases, string selfNames) + 0xf1 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,IronPython.Runtime.CodeContext,string,object[],string,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x483 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportBottom(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x64 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run2(IronPython.Runtime.CodeContext arg0, IronPython.Runtime.FunctionCode arg1) + 0x18f bytes IronPython.dll!IronPython.Compiler.PythonScriptCode.RunWorker(IronPython.Runtime.CodeContext ctx) + 0x9e bytes IronPython.dll!IronPython.Compiler.PythonScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0xb9 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x33f bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute(Microsoft.Scripting.Runtime.Scope scope, Microsoft.Scripting.ErrorSink errorSink) + 0xf4 bytes Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute(Microsoft.Scripting.Runtime.Scope scope) + 0x3f bytes Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptSource.Execute(Microsoft.Scripting.Hosting.ScriptScope scope) + 0x76 bytes Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptEngine.Execute(string expression, Microsoft.Scripting.Hosting.ScriptScope scope) + 0x53 bytes Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptEngine.ExecuteAndWrap(string expression, Microsoft.Scripting.Hosting.ScriptScope scope, out System.Runtime.Remoting.ObjectHandle exception) + 0x64 bytes [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg, int methodPtr, bool fExecuteInContext) + 0x429 bytes mscorlib.dll!System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x107 bytes mscorlib.dll!System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x16c bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(object[] args) + 0x1ba bytes [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x113 bytes mscorlib.dll!System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(System.Runtime.Remoting.Messaging.IMessage msg) + 0x167 bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(byte[] reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage smuggledMcm, out System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) + 0xc8 bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(object[] args) + 0x92 bytes [Appdomain Transition] mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatch(byte[] reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage smuggledMcm, out System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) + 0xa0 bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x13b bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink ms, System.Runtime.Remoting.Messaging.IMessage reqMsg, System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks, System.Threading.Thread currentThread, System.Runtime.Remoting.Contexts.Context currentContext, bool bSkippingContextChain) + 0x9e bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType) + 0x525 bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0x5fa bytes > Elipse.Epm.Scripting.dll!Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(Microsoft.Scripting.Hosting.ScriptScope scope) Line 181 + 0x3d bytes C# On Wed, Mar 7, 2012 at 4:47 PM, Dino Viehland wrote: > After adding the reflection permissions I wonder what the exception is. > Instead of doing Engine.Execute(string, ScriptScope) can you instead call > ExecuteAndWrap(string, ScriptScope, out ObjectHandle)? In general when > you?re working with the remote domain you?ll want to use the *Wrap versions > to avoid serializing results back into the local domain (which can fail). > **** > > ** ** > > I?m not sure if we?re trying to serialize an exception object here or the > result of your execution, but either way one of those is failing. You > should be able to check and see if the handles are null, and can also pass > them back into the remote domain for formatting (using either > ObjectOperations.Format or ExceptionOperations.FormatException) and just > get a string back.**** > > ** ** > > *From:* Cesar Mello [mailto:cmello at gmail.com] > *Sent:* Wednesday, March 07, 2012 11:38 AM > *To:* Dino Viehland > *Cc:* ironpython-users at python.org > > *Subject:* Re: [Ironpython-users] Importing modules in a restricted > AppDomain**** > > ** ** > > Thanks a lot for the help guys. I'm trying to walk on my own, but just for > a quick feedback I've used the code suggested and now when I run "import > decimal" I get a MethodAccessException. I presumed it was safe to add all > the Reflection permissions and then I get an unhandled > ArgumentNullException (second stack trace). There is a bunch of internal > SecurityExceptions that are handled in the meantime though. I'll try to > debug this using the Console in a restricted AppDomain, so please don't > bother to answer me if I am doing some silly mistake.**** > > ** ** > > Thanks and best regards!**** > > Mello**** > > ** ** > > Stack trace 1 (MethodAccessException)**** > > ** ** > > Attempt by method > 'Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(System.Reflection.MethodInfo, > System.Type, System.Object)' to access method > 'IronPython.Compiler.Ast.UncollectableCompilationMode.NextSite>(System.Dynamic.DynamicMetaObjectBinder)' > failed.**** > > ** ** > > at System.Delegate.BindToMethodInfo(Object target, IRuntimeMethodInfo > method, RuntimeType methodType, DelegateBindingFlags flags)**** > > at System.Delegate.CreateDelegate(Type type, Object firstArgument, > MethodInfo method, Boolean throwOnBindFailure)**** > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo > methodInfo, Type delegateType, Object target)**** > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo > methodInfo, Type delegateType)**** > > at > IronPython.Compiler.Ast.UncollectableCompilationMode.DelegateCache.MakeDelegateType(Type > retType, Expression[] args)**** > > at > IronPython.Compiler.Ast.UncollectableCompilationMode.ReduceDynamic(DynamicMetaObjectBinder > binder, Type retType, Expression arg0, Expression arg1)**** > > at IronPython.Compiler.Ast.DynamicGetMemberExpression.Reduce()**** > > at System.Linq.Expressions.Expression.ReduceAndCheck()**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryBody(TryExpression > node, LabelTarget ehLabel)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryCatch(TryExpression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitTry(TryExpression node) > **** > > at System.Linq.Expressions.TryExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at Microsoft.Scripting.Ast.LightExceptionRewriter.Rewrite(Expression > expr)**** > > at Microsoft.Scripting.Ast.LightExceptionConvertingExpression.Reduce()* > *** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileLabelExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(LightLambdaExpression > node)**** > > at Microsoft.Scripting.Ast.LightExpression`1.Compile(Int32 > compilationThreshold)**** > > at IronPython.Compiler.RuntimeScriptCode.Compile()**** > > at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled()**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String > name, String fullName, String str)**** > > at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, > String name, String fullName, List path, Func`5 defaultLoader)**** > > 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.Modules.Builtin.__import__(CodeContext context, String > name, Object globals, Object locals, Object fromlist, Int32 level)**** > > at System.Func`7.Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 > arg6)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 > arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)**** > > at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, > String fullName, PythonTuple from, Int32 level)**** > > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level)**** > > at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 > arg0, T1 arg1)**** > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)**** > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope)**** > > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)* > *** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > ** ** > > ** ** > > ** ** > > --------------------------------------------------**** > > After adding Reflection permissions;**** > > ** ** > > at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] > methodInstantiation)**** > > at > System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext > context)**** > > ** ** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > > On Wed, Mar 7, 2012 at 2:34 PM, Dino Viehland wrote: > **** > > Nope, ideally IronPython?s assemblies are not trusted. In general > IronPython?s assemblies are ?security transparent? which means they don?t > affect any security decisions made by the CLR. If you gave them full trust > then the user could do something like file(?C:\\bad_file.txt?, ?w+?). The > security transparency means that IronPython can contain a bunch of code for > accessing files and stuff but that code doesn?t need to be audited for > security because we don?t have any permissions of our own.**** > > **** > > You might want to try doing something like:**** > > **** > > AppDomainSetup info = new AppDomainSetup();**** > > info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;* > *** > > info.ApplicationName = "Test";**** > > **** > > Evidence evidence = new Evidence();**** > > evidence.AddHost(new Zone(SecurityZone.Internet));**** > > **** > > System.Security.PermissionSet permSet = > SecurityManager.GetStandardSandbox(evidence);**** > > AppDomain newDomain = AppDomain.CreateDomain("test", evidence, > info, permSet, null);**** > > **** > > // create runtime in partial trust...**** > > ScriptRuntime runtime = Python.CreateRuntime(newDomain);**** > > **** > > Which will run the code in the internet zone which should be a safe set of > permissions ? you might need to add in your path access to this, but we use > this setup in a test case so it definitely works.**** > > **** > > *From:* ironpython-users-bounces+dinov=microsoft.com at python.org [mailto: > ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Cesar > Mello > *Sent:* Wednesday, March 07, 2012 5:17 AM > *To:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Importing modules in a restricted > AppDomain**** > > **** > > Hi,**** > > **** > > Must I grant fulltrust permissions to the IronPython assemblies? Sorry for > the basic question, but will the scripts still be restricted in this case? > **** > > **** > > Thank you a lot. This is a bit urgent for me, because it's the last step > before I can finish the prototype with IronPython and let it be accepted > for embedding in our product.**** > > **** > > Best regards!**** > > Mello**** > > **** > > **** > > On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello wrote:**** > > Please ignore my previous question. Sucessfully added FileIOPermission > with PathDiscovery and it worked:**** > > **** > > var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath();**** > > permissionSet.AddPermission(new > FileIOPermission(FileIOPermissionAccess.PathDiscovery | > FileIOPermissionAccess.Read, pythonLibsPath));**** > > **** > > **** > > Now I'm facing some problem with Emit permissions. > Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't > work.**** > > **** > > I'm using .NET 4 in this project at work. Sorry if the subject is too > general and off-topic.**** > > **** > > Best regards**** > > Mello**** > > **** > > Message: Request for the permission of type > 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.**** > > **** > > at System.Security.CodeAccessSecurityEngine.Check(Object demand, > StackCrawlMark& stackMark, Boolean isPermSet)**** > > at System.Security.CodeAccessPermission.Demand()**** > > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)**** > > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)**** > > at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String > name, Boolean emitSymbolInfo)**** > > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable, > PortableExecutableKinds peKind, ImageFileMachine machine)**** > > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable)**** > > at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String > nameSuffix, Boolean emitSymbols)**** > > at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean > emitSymbols, AssemblyGen& assembly)**** > > at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean > emitSymbols)**** > > at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type > parent, Boolean preserveName, Boolean emitDebugSymbols)**** > > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols)** > ** > > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols)** > ** > > at > Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 > lambda, Boolean emitDebugSymbols)**** > > at IronPython.Compiler.RuntimeScriptCode.Compile()**** > > at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled()**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String > name, String fullName, String str)**** > > at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, > String name, String fullName, List path, Func`5 defaultLoader)**** > > 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.Modules.Builtin.__import__(CodeContext context, String > name, Object globals, Object locals, Object fromlist, Int32 level)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 > arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)**** > > at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, > String fullName, PythonTuple from, Int32 level)**** > > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 > arg0, T1 arg1)**** > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)**** > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope)**** > > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)* > *** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > **** > > **** > > On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello wrote:**** > > Hi!**** > > **** > > Is there a way to load modules without giving permission to the AppDomain > to read .py files from disk?**** > > **** > > I need to run user code with limited permissions. They should be able to > do some simple calculations. But when I try to import a module like > 'decimal', filesystem access permission is required. **** > > **** > > Thank you a lot for the attention!**** > > **** > > Best regards**** > > Mello**** > > **** > > **** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Mar 7 21:30:56 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 7 Mar 2012 20:30:56 +0000 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54D1B1B0@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D1B32A@TK5EX14MBXC294.redmond.corp.microsoft.com> Ok, that looks like it's a bug. We're using GC handles to implement weakref.ref and that is raising the exception on the desktop CLR. In Silverlight we don't use GCHandle's but we also don't get as good of a match w/ CPython's finalization semantics. I'm not quite sure where the usage of weakref.ref is coming from but it's probably decimal.py imports the copy module and that's probably what breaks it. But it looks like decimal isn't using copy (at least in my normal 2.7 std lib) so in theory you could just remove that import from the std lib module and things might work for you from there (until someone else implements copy). To fix Ipy we probably want Microsoft.Dynamic's WeakHandle class to handle the SecurityException and fallback to its Silverlight version of the code (or simply use the Silverlight version and not have quite as good compatibility, or figure out some other way to get that compatibility). From: ironpython-users-bounces+dinov=exchange.microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] On Behalf Of Cesar Mello Sent: Wednesday, March 07, 2012 12:12 PM To: Dino Viehland Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Importing modules in a restricted AppDomain OK I changed from: m_engine.Execute("import decimal"); to ExecuteAndWrap, and the objectOperations.Format returns: Please notice I'm just importing the standard decimal module. Breaking into the first SecurityException I get the stack trace below. Thanks a lot! Best regards Mello mscorlib.dll!System.Security.CodeAccessSecurityEngine.ThrowSecurityException(System.Reflection.RuntimeAssembly asm, System.Security.PermissionSet granted, System.Security.PermissionSet refused, System.RuntimeMethodHandleInternal rmh, System.Security.Permissions.SecurityAction action, object demand, System.Security.IPermission permThatFailed) + 0x103 bytes mscorlib.dll!System.Security.CodeAccessSecurityEngine.CheckSetHelper(System.Security.PermissionSet grants, System.Security.PermissionSet refused, System.Security.PermissionSet demands, System.RuntimeMethodHandleInternal rmh, object assemblyOrString, System.Security.Permissions.SecurityAction action, bool throwException) + 0x160 bytes [Native to Managed Transition] [Managed to Native Transition] IronPython.dll!IronPython.Runtime.WeakRefTracker.CallbackInfo.CallbackInfo(object callback, object weakRef) + 0x5c bytes IronPython.dll!IronPython.Runtime.WeakRefTracker.ChainCallback(object callback, object weakRef) + 0x71 bytes IronPython.dll!IronPython.Runtime.WeakRefTracker.WeakRefTracker(object callback, object weakRef) + 0x8d bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.WeakRefHelpers.InitializeWeakRef(object self, object target, object callback) + 0xe1 bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.ref(object object, object callback) + 0x46 bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.ref(object object) + 0x35 bytes IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.__new__(IronPython.Runtime.CodeContext context, IronPython.Runtime.Types.PythonType cls, object object) + 0x1df bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x23a bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) + 0x1e4 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2) + 0x63a bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x3b3 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) + 0x1e4 bytes IronPython.dll!IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x10f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run3(IronPython.Runtime.PythonFunction arg0, object arg1, object arg2) + 0x1b7 bytes IronPython.dll!IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(IronPython.Runtime.PythonFunction function, object arg0, object arg1) + 0xa8 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,IronPython.Runtime.PythonFunction,object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x2fb bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, IronPython.Runtime.PythonFunction arg2, object arg3) + 0x1e4 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, IronPython.Runtime.PythonFunction arg1, object arg2) + 0x63a bytes IronPython.dll!IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite.CallTarget(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object inst) + 0x102 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1) + 0x5f3 bytes IronPython.dll!IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object type) + 0x10f bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1) + 0x5f3 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x2fb bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run3(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2) + 0x1b7 bytes IronPython.dll!IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xbd bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run5(IronPython.Runtime.PythonFunction arg0, object arg1, object arg2, object arg3, object arg4) + 0x21a bytes IronPython.dll!IronPython.Compiler.PythonCallTargets.OriginalCallTarget4(IronPython.Runtime.PythonFunction function, object arg0, object arg1, object arg2, object arg3) + 0xc4 bytes IronPython.dll!IronPython.Runtime.PythonFunction.FunctionCaller.Call4(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object func, object arg0, string arg1, IronPython.Runtime.PythonTuple arg2, IronPython.Runtime.PythonDictionary arg3) + 0x11f bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute6(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2, string arg3, IronPython.Runtime.PythonTuple arg4, IronPython.Runtime.PythonDictionary arg5) + 0x70f bytes IronPython.dll!IronPython.Runtime.Types.PythonType.NewSite.Call(IronPython.Runtime.CodeContext context, object typeOrInstance, string arg0, IronPython.Runtime.PythonTuple arg1, IronPython.Runtime.PythonDictionary arg2) + 0x95 bytes IronPython.dll!IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext context, object type, string arg0, IronPython.Runtime.PythonTuple arg1, IronPython.Runtime.PythonDictionary arg2) + 0xf3 bytes System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute5(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, string arg2, IronPython.Runtime.PythonTuple arg3, IronPython.Runtime.PythonDictionary arg4) + 0x6c8 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.MakeClass(IronPython.Runtime.CodeContext context, string name, object[] bases, string selfNames, IronPython.Runtime.PythonDictionary vars) + 0x5ac bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.MakeClass(IronPython.Runtime.FunctionCode funcCode, System.Func body, IronPython.Runtime.CodeContext parentContext, string name, object[] bases, string selfNames) + 0xf1 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,IronPython.Runtime.CodeContext,string,object[],string,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x483 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportBottom(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x64 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode arg0) + 0x15e bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x1c8 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) + 0x288 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, out Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) + 0x61 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, string name, string path) + 0x65 bytes IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext context, string name, string path) + 0x1b0 bytes IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext context, string name, string fullName, string str) + 0x13e bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func defaultLoader) + 0x29a bytes IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 bytes IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) + 0x1ff bytes IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) + 0x962 bytes IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) + 0x1a5 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x45c bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) + 0x280 bytes IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) + 0x178 bytes IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext context, string fullName, int level) + 0x3f bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0x212 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) + 0xf0 bytes Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run2(IronPython.Runtime.CodeContext arg0, IronPython.Runtime.FunctionCode arg1) + 0x18f bytes IronPython.dll!IronPython.Compiler.PythonScriptCode.RunWorker(IronPython.Runtime.CodeContext ctx) + 0x9e bytes IronPython.dll!IronPython.Compiler.PythonScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0xb9 bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) + 0x33f bytes IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope scope) + 0x32 bytes Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute(Microsoft.Scripting.Runtime.Scope scope, Microsoft.Scripting.ErrorSink errorSink) + 0xf4 bytes Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute(Microsoft.Scripting.Runtime.Scope scope) + 0x3f bytes Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptSource.Execute(Microsoft.Scripting.Hosting.ScriptScope scope) + 0x76 bytes Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptEngine.Execute(string expression, Microsoft.Scripting.Hosting.ScriptScope scope) + 0x53 bytes Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptEngine.ExecuteAndWrap(string expression, Microsoft.Scripting.Hosting.ScriptScope scope, out System.Runtime.Remoting.ObjectHandle exception) + 0x64 bytes [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg, int methodPtr, bool fExecuteInContext) + 0x429 bytes mscorlib.dll!System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x107 bytes mscorlib.dll!System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x16c bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(object[] args) + 0x1ba bytes [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x113 bytes mscorlib.dll!System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(System.Runtime.Remoting.Messaging.IMessage msg) + 0x167 bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(byte[] reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage smuggledMcm, out System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) + 0xc8 bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(object[] args) + 0x92 bytes [Appdomain Transition] mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatch(byte[] reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage smuggledMcm, out System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) + 0xa0 bytes mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x13b bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink ms, System.Runtime.Remoting.Messaging.IMessage reqMsg, System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks, System.Threading.Thread currentThread, System.Runtime.Remoting.Contexts.Context currentContext, bool bSkippingContextChain) + 0x9e bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType) + 0x525 bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0x5fa bytes > Elipse.Epm.Scripting.dll!Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(Microsoft.Scripting.Hosting.ScriptScope scope) Line 181 + 0x3d bytes C# On Wed, Mar 7, 2012 at 4:47 PM, Dino Viehland > wrote: After adding the reflection permissions I wonder what the exception is. Instead of doing Engine.Execute(string, ScriptScope) can you instead call ExecuteAndWrap(string, ScriptScope, out ObjectHandle)? In general when you're working with the remote domain you'll want to use the *Wrap versions to avoid serializing results back into the local domain (which can fail). I'm not sure if we're trying to serialize an exception object here or the result of your execution, but either way one of those is failing. You should be able to check and see if the handles are null, and can also pass them back into the remote domain for formatting (using either ObjectOperations.Format or ExceptionOperations.FormatException) and just get a string back. From: Cesar Mello [mailto:cmello at gmail.com] Sent: Wednesday, March 07, 2012 11:38 AM To: Dino Viehland Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Importing modules in a restricted AppDomain Thanks a lot for the help guys. I'm trying to walk on my own, but just for a quick feedback I've used the code suggested and now when I run "import decimal" I get a MethodAccessException. I presumed it was safe to add all the Reflection permissions and then I get an unhandled ArgumentNullException (second stack trace). There is a bunch of internal SecurityExceptions that are handled in the meantime though. I'll try to debug this using the Console in a restricted AppDomain, so please don't bother to answer me if I am doing some silly mistake. Thanks and best regards! Mello Stack trace 1 (MethodAccessException) Attempt by method 'Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(System.Reflection.MethodInfo, System.Type, System.Object)' to access method 'IronPython.Compiler.Ast.UncollectableCompilationMode.NextSite>(System.Dynamic.DynamicMetaObjectBinder)' failed. at System.Delegate.BindToMethodInfo(Object target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags) at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method, Boolean throwOnBindFailure) at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo methodInfo, Type delegateType, Object target) at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo methodInfo, Type delegateType) at IronPython.Compiler.Ast.UncollectableCompilationMode.DelegateCache.MakeDelegateType(Type retType, Expression[] args) at IronPython.Compiler.Ast.UncollectableCompilationMode.ReduceDynamic(DynamicMetaObjectBinder binder, Type retType, Expression arg0, Expression arg1) at IronPython.Compiler.Ast.DynamicGetMemberExpression.Reduce() at System.Linq.Expressions.Expression.ReduceAndCheck() at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression node) at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression node) at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryBody(TryExpression node, LabelTarget ehLabel) at Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryCatch(TryExpression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.VisitTry(TryExpression node) at System.Linq.Expressions.TryExpression.Accept(ExpressionVisitor visitor) at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node) at Microsoft.Scripting.Ast.LightExceptionRewriter.Rewrite(Expression expr) at Microsoft.Scripting.Ast.LightExceptionConvertingExpression.Reduce() at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression node) at Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression expr, Boolean asVoid) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileLabelExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(LightLambdaExpression node) at Microsoft.Scripting.Ast.LightExpression`1.Compile(Int32 compilationThreshold) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at System.Func`7.Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 -------------------------------------------------- After adding Reflection permissions; at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) at System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext context) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Wed, Mar 7, 2012 at 2:34 PM, Dino Viehland > wrote: Nope, ideally IronPython's assemblies are not trusted. In general IronPython's assemblies are "security transparent" which means they don't affect any security decisions made by the CLR. If you gave them full trust then the user could do something like file('C:\\bad_file.txt', 'w+'). The security transparency means that IronPython can contain a bunch of code for accessing files and stuff but that code doesn't need to be audited for security because we don't have any permissions of our own. You might want to try doing something like: AppDomainSetup info = new AppDomainSetup(); info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; info.ApplicationName = "Test"; Evidence evidence = new Evidence(); evidence.AddHost(new Zone(SecurityZone.Internet)); System.Security.PermissionSet permSet = SecurityManager.GetStandardSandbox(evidence); AppDomain newDomain = AppDomain.CreateDomain("test", evidence, info, permSet, null); // create runtime in partial trust... ScriptRuntime runtime = Python.CreateRuntime(newDomain); Which will run the code in the internet zone which should be a safe set of permissions - you might need to add in your path access to this, but we use this setup in a test case so it definitely works. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Cesar Mello Sent: Wednesday, March 07, 2012 5:17 AM To: ironpython-users at python.org Subject: Re: [Ironpython-users] Importing modules in a restricted AppDomain Hi, Must I grant fulltrust permissions to the IronPython assemblies? Sorry for the basic question, but will the scripts still be restricted in this case? Thank you a lot. This is a bit urgent for me, because it's the last step before I can finish the prototype with IronPython and let it be accepted for embedding in our product. Best regards! Mello On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello > wrote: Please ignore my previous question. Sucessfully added FileIOPermission with PathDiscovery and it worked: var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath(); permissionSet.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, pythonLibsPath)); Now I'm facing some problem with Emit permissions. Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't work. I'm using .NET 4 in this project at work. Sorry if the subject is too general and off-topic. Best regards Mello Message: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark) at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name, Boolean emitSymbolInfo) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable, PortableExecutableKinds peKind, ImageFileMachine machine) at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, String outDir, String outFileExtension, Boolean isDebuggable) at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String nameSuffix, Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean emitSymbols, AssemblyGen& assembly) at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean emitSymbols) at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type parent, Boolean preserveName, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols) at Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 lambda, Boolean emitDebugSymbols) at IronPython.Compiler.RuntimeScriptCode.Compile() at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled() at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String name, String fullName, String str) at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, String name, String fullName, List path, Func`5 defaultLoader) 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.Modules.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, String fullName, PythonTuple from, Int32 level) at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext context, String fullName, Int32 level) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, ScriptScope scope) at Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope scope) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 174 at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression expression, Object clientHandle) in D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line 82 On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello > wrote: Hi! Is there a way to load modules without giving permission to the AppDomain to read .py files from disk? I need to run user code with limited permissions. They should be able to do some simple calculations. But when I try to import a module like 'decimal', filesystem access permission is required. Thank you a lot for the attention! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 7 22:10:52 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 7 Mar 2012 18:10:52 -0300 Subject: [Ironpython-users] Importing modules in a restricted AppDomain In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54D1B32A@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54D1ABDD@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54D1B1B0@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54D1B32A@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: OK thanks a lot Dino! Commenting the copy import from decimal.py still doesn't work, maybe it's failing in other places too. But removing the whole import of decimal.py all the other things we currently use work perfectly, so it's ok for now! I'll try to reproduce things in a smaller sample and create work items in small pieces so we can see one at a time. Thanks a lot for the help. Best regards Mello On Wed, Mar 7, 2012 at 5:30 PM, Dino Viehland wrote: > Ok, that looks like it?s a bug. We?re using GC handles to implement > weakref.ref and that is raising the exception on the desktop CLR. In > Silverlight we don?t use GCHandle?s but we also don?t get as good of a > match w/ CPython?s finalization semantics. **** > > ** ** > > I?m not quite sure where the usage of weakref.ref is coming from but it?s > probably decimal.py imports the copy module and that?s probably what breaks > it. But it looks like decimal isn?t using copy (at least in my normal 2.7 > std lib) so in theory you could just remove that import from the std lib > module and things might work for you from there (until someone else > implements copy).**** > > ** ** > > To fix Ipy we probably want Microsoft.Dynamic?s WeakHandle class to handle > the SecurityException and fallback to its Silverlight version of the code > (or simply use the Silverlight version and not have quite as good > compatibility, or figure out some other way to get that compatibility).*** > * > > ** ** > > *From:* ironpython-users-bounces+dinov=exchange.microsoft.com at python.org[mailto: > ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] *On > Behalf Of *Cesar Mello > *Sent:* Wednesday, March 07, 2012 12:12 PM > *To:* Dino Viehland > *Cc:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Importing modules in a restricted > AppDomain**** > > ** ** > > OK I changed from:**** > > ** ** > > m_engine.Execute("import decimal");**** > > ** ** > > to ExecuteAndWrap, and the objectOperations.Format returns:**** > > ** ** > > [System.Security.SecurityException: Request failed....]>**** > > ** ** > > Please notice I'm just importing the standard decimal module. Breaking > into the first SecurityException I get the stack trace below.**** > > ** ** > > Thanks a lot!**** > > ** ** > > Best regards**** > > Mello**** > > ** ** > > mscorlib.dll!System.Security.CodeAccessSecurityEngine.ThrowSecurityException(System.Reflection.RuntimeAssembly > asm, System.Security.PermissionSet granted, System.Security.PermissionSet > refused, System.RuntimeMethodHandleInternal rmh, > System.Security.Permissions.SecurityAction action, object demand, > System.Security.IPermission permThatFailed) + 0x103 bytes **** > > mscorlib.dll!System.Security.CodeAccessSecurityEngine.CheckSetHelper(System.Security.PermissionSet > grants, System.Security.PermissionSet refused, > System.Security.PermissionSet demands, System.RuntimeMethodHandleInternal > rmh, object assemblyOrString, System.Security.Permissions.SecurityAction > action, bool throwException) + 0x160 bytes **** > > [Native to Managed Transition] **** > > [Managed to Native Transition] **** > > IronPython.dll!IronPython.Runtime.WeakRefTracker.CallbackInfo.CallbackInfo(object > callback, object weakRef) + 0x5c bytes **** > > IronPython.dll!IronPython.Runtime.WeakRefTracker.ChainCallback(object > callback, object weakRef) + 0x71 bytes **** > > IronPython.dll!IronPython.Runtime.WeakRefTracker.WeakRefTracker(object > callback, object weakRef) + 0x8d bytes **** > > IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.WeakRefHelpers.InitializeWeakRef(object > self, object target, object callback) + 0xe1 bytes **** > > IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.ref(object > object, object callback) + 0x46 bytes **** > > IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.ref(object > object) + 0x35 bytes **** > > IronPython.Modules.dll!IronPython.Modules.PythonWeakRef.ref.__new__(IronPython.Runtime.CodeContext > context, IronPython.Runtime.Types.PythonType cls, object object) + 0x1df > bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x23a bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) + > 0x1e4 bytes **** > > System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2) + > 0x63a bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x3b3 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) + > 0x1e4 bytes **** > > IronPython.dll!IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x10f bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run3(IronPython.Runtime.PythonFunction > arg0, object arg1, object arg2) + 0x1b7 bytes **** > > IronPython.dll!IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(IronPython.Runtime.PythonFunction > function, object arg0, object arg1) + 0xa8 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,IronPython.Runtime.PythonFunction,object,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x2fb bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, > IronPython.Runtime.PythonFunction arg2, object arg3) + 0x1e4 bytes **** > > System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext arg0, > IronPython.Runtime.PythonFunction arg1, object arg2) + 0x63a bytes **** > > IronPython.dll!IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite.CallTarget(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext context, object inst) + 0x102 bytes > **** > > System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext arg0, object arg1) + 0x5f3 bytes ** > ** > > IronPython.dll!IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext context, object type) + 0x10f bytes > **** > > System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext arg0, object arg1) + 0x5f3 bytes ** > ** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x2fb bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run3(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2) + 0x1b7 bytes **** > > IronPython.dll!IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xbd bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run5(IronPython.Runtime.PythonFunction > arg0, object arg1, object arg2, object arg3, object arg4) + 0x21a bytes > **** > > IronPython.dll!IronPython.Compiler.PythonCallTargets.OriginalCallTarget4(IronPython.Runtime.PythonFunction > function, object arg0, object arg1, object arg2, object arg3) + 0xc4 bytes > **** > > IronPython.dll!IronPython.Runtime.PythonFunction.FunctionCaller.Call4(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext context, object func, object arg0, > string arg1, IronPython.Runtime.PythonTuple arg2, > IronPython.Runtime.PythonDictionary arg3) + 0x11f bytes **** > > System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute6(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2, string > arg3, IronPython.Runtime.PythonTuple arg4, > IronPython.Runtime.PythonDictionary arg5) + 0x70f bytes **** > > IronPython.dll!IronPython.Runtime.Types.PythonType.NewSite.Call(IronPython.Runtime.CodeContext > context, object typeOrInstance, string arg0, IronPython.Runtime.PythonTuple > arg1, IronPython.Runtime.PythonDictionary arg2) + 0x95 bytes **** > > IronPython.dll!IronPython.Runtime.Types.PythonType.FastTypeSite.CallTarget(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext context, object type, string arg0, > IronPython.Runtime.PythonTuple arg1, IronPython.Runtime.PythonDictionary > arg2) + 0xf3 bytes **** > > System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute5(System.Runtime.CompilerServices.CallSite > site, IronPython.Runtime.CodeContext arg0, object arg1, string arg2, > IronPython.Runtime.PythonTuple arg3, IronPython.Runtime.PythonDictionary > arg4) + 0x6c8 bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.MakeClass(IronPython.Runtime.CodeContext > context, string name, object[] bases, string selfNames, > IronPython.Runtime.PythonDictionary vars) + 0x5ac bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.MakeClass(IronPython.Runtime.FunctionCode > funcCode, > System.Func > body, IronPython.Runtime.CodeContext parentContext, string name, object[] > bases, string selfNames) + 0xf1 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction,IronPython.Runtime.CodeContext,string,object[],string,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x483 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode > arg0) + 0x15e bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope > scope) + 0x1c8 bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0x32 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string > fileName, IronPython.Runtime.ModuleContext moduleContext, > Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions > options) + 0x288 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options, out > Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options) + 0x61 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext > context, Microsoft.Scripting.SourceUnit sourceCode, string name, string > path) + 0x65 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext > context, string name, string path) + 0x1b0 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext > context, string name, string fullName, string str) + 0x13e bytes ** > ** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path, > System.Func > defaultLoader) + 0x29a bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 > bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext > context, string name) + 0x1ff bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext > context, object globals, string modName, bool bottom, int level) + 0x962 > bytes **** > > IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext > context, string name, object globals, object locals, object fromlist, int > level) + 0x1a5 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x45c bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, > IronPython.Runtime.PythonDictionary arg4, > IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple > arg6) + 0x280 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext > context, string fullName, IronPython.Runtime.PythonTuple from, int level) + > 0x178 bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext > context, string fullName, int level) + 0x3f bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x212 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode > arg0) + 0x15e bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope > scope) + 0x1c8 bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0x32 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string > fileName, IronPython.Runtime.ModuleContext moduleContext, > Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions > options) + 0x288 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options, out > Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options) + 0x61 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext > context, Microsoft.Scripting.SourceUnit sourceCode, string name, string > path) + 0x65 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext > context, string name, string path) + 0x1b0 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext > context, string name, string fullName, string str) + 0x13e bytes ** > ** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path, > System.Func > defaultLoader) + 0x29a bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 > bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext > context, string name) + 0x1ff bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext > context, object globals, string modName, bool bottom, int level) + 0x962 > bytes **** > > IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext > context, string name, object globals, object locals, object fromlist, int > level) + 0x1a5 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x45c bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, > IronPython.Runtime.PythonDictionary arg4, > IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple > arg6) + 0x280 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext > context, string fullName, IronPython.Runtime.PythonTuple from, int level) + > 0x178 bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext > context, string fullName, int level) + 0x3f bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x212 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode > arg0) + 0x15e bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope > scope) + 0x1c8 bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0x32 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string > fileName, IronPython.Runtime.ModuleContext moduleContext, > Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions > options) + 0x288 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options, out > Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options) + 0x61 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext > context, Microsoft.Scripting.SourceUnit sourceCode, string name, string > path) + 0x65 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext > context, string name, string path) + 0x1b0 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext > context, string name, string fullName, string str) + 0x13e bytes ** > ** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path, > System.Func > defaultLoader) + 0x29a bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 > bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext > context, string name) + 0x1ff bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext > context, object globals, string modName, bool bottom, int level) + 0x962 > bytes **** > > IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext > context, string name, object globals, object locals, object fromlist, int > level) + 0x1a5 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x45c bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, > IronPython.Runtime.PythonDictionary arg4, > IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple > arg6) + 0x280 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext > context, string fullName, IronPython.Runtime.PythonTuple from, int level) + > 0x178 bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext > context, string fullName, int level) + 0x3f bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x212 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode > arg0) + 0x15e bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope > scope) + 0x1c8 bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0x32 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string > fileName, IronPython.Runtime.ModuleContext moduleContext, > Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions > options) + 0x288 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options, out > Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options) + 0x61 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext > context, Microsoft.Scripting.SourceUnit sourceCode, string name, string > path) + 0x65 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext > context, string name, string path) + 0x1b0 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext > context, string name, string fullName, string str) + 0x13e bytes ** > ** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path, > System.Func > defaultLoader) + 0x29a bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 > bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext > context, string name) + 0x1ff bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext > context, object globals, string modName, bool bottom, int level) + 0x962 > bytes **** > > IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext > context, string name, object globals, object locals, object fromlist, int > level) + 0x1a5 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x45c bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, > IronPython.Runtime.PythonDictionary arg4, > IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple > arg6) + 0x280 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext > context, string fullName, IronPython.Runtime.PythonTuple from, int level) + > 0x178 bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportBottom(IronPython.Runtime.CodeContext > context, string fullName, int level) + 0x64 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x212 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1(IronPython.Runtime.FunctionCode > arg0) + 0x15e bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope > scope) + 0x1c8 bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0x32 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.InitializeModule(string > fileName, IronPython.Runtime.ModuleContext moduleContext, > Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions > options) + 0x288 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options, out > Microsoft.Scripting.ScriptCode scriptCode) + 0x1b6 bytes **** > > IronPython.dll!IronPython.Runtime.PythonContext.CompileModule(string > fileName, string moduleName, Microsoft.Scripting.SourceUnit sourceCode, > IronPython.Runtime.ModuleOptions options) + 0x61 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromSourceUnit(IronPython.Runtime.CodeContext > context, Microsoft.Scripting.SourceUnit sourceCode, string name, string > path) + 0x65 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadModuleFromSource(IronPython.Runtime.CodeContext > context, string name, string path) + 0x1b0 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.LoadFromDisk(IronPython.Runtime.CodeContext > context, string name, string fullName, string str) + 0x13e bytes ** > ** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path, > System.Func > defaultLoader) + 0x29a bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext > context, string name, string fullName, IronPython.Runtime.List path) + 0xc4 > bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext > context, string name) + 0x1ff bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext > context, object globals, string modName, bool bottom, int level) + 0x962 > bytes **** > > IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext > context, string name, object globals, object locals, object fromlist, int > level) + 0x1a5 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x45c bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7(System.Runtime.CompilerServices.CallSite > arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, > IronPython.Runtime.PythonDictionary arg4, > IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple > arg6) + 0x280 bytes **** > > IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext > context, string fullName, IronPython.Runtime.PythonTuple from, int level) + > 0x178 bytes **** > > IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportTop(IronPython.Runtime.CodeContext > context, string fullName, int level) + 0x3f bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0x212 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame > frame) + 0xf0 bytes **** > > Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run2(IronPython.Runtime.CodeContext > arg0, IronPython.Runtime.FunctionCode arg1) + 0x18f bytes **** > > IronPython.dll!IronPython.Compiler.PythonScriptCode.RunWorker(IronPython.Runtime.CodeContext > ctx) + 0x9e bytes **** > > IronPython.dll!IronPython.Compiler.PythonScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0xb9 bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope > scope) + 0x33f bytes **** > > IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run(Microsoft.Scripting.Runtime.Scope > scope) + 0x32 bytes **** > > Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute(Microsoft.Scripting.Runtime.Scope > scope, Microsoft.Scripting.ErrorSink errorSink) + 0xf4 bytes **** > > Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute(Microsoft.Scripting.Runtime.Scope > scope) + 0x3f bytes **** > > Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptSource.Execute(Microsoft.Scripting.Hosting.ScriptScope > scope) + 0x76 bytes **** > > Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptEngine.Execute(string > expression, Microsoft.Scripting.Hosting.ScriptScope scope) + 0x53 bytes > **** > > Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptEngine.ExecuteAndWrap(string > expression, Microsoft.Scripting.Hosting.ScriptScope scope, out > System.Runtime.Remoting.ObjectHandle exception) + 0x64 bytes **** > > [Native to Managed Transition] **** > > [Managed to Native Transition] **** > > mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage > msg, int methodPtr, bool fExecuteInContext) + 0x429 bytes **** > > mscorlib.dll!System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage > reqMsg) + 0x107 bytes **** > > mscorlib.dll!System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage > reqMsg) + 0x16c bytes **** > > mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(object[] > args) + 0x1ba bytes **** > > [Native to Managed Transition] **** > > [Managed to Native Transition] **** > > mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage > reqMsg) + 0x113 bytes **** > > mscorlib.dll!System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(System.Runtime.Remoting.Messaging.IMessage > msg) + 0x167 bytes **** > > mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(byte[] > reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage > smuggledMcm, out > System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) > + 0xc8 bytes **** > > mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(object[] > args) + 0x92 bytes **** > > [Appdomain Transition] **** > > mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatch(byte[] > reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage > smuggledMcm, out > System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) > + 0xa0 bytes **** > > mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage > reqMsg) + 0x13b bytes **** > > mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink > ms, System.Runtime.Remoting.Messaging.IMessage reqMsg, > System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks, > System.Threading.Thread currentThread, > System.Runtime.Remoting.Contexts.Context currentContext, bool > bSkippingContextChain) + 0x9e bytes **** > > mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage > reqMcmMsg, bool useDispatchMessage, int callType) + 0x525 bytes ** > ** > > mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref > System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0x5fa bytes > **** > > > Elipse.Epm.Scripting.dll!Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(Microsoft.Scripting.Hosting.ScriptScope > scope) Line 181 + 0x3d bytes C#**** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > > ** ** > > On Wed, Mar 7, 2012 at 4:47 PM, Dino Viehland wrote: > **** > > After adding the reflection permissions I wonder what the exception is. > Instead of doing Engine.Execute(string, ScriptScope) can you instead call > ExecuteAndWrap(string, ScriptScope, out ObjectHandle)? In general when > you?re working with the remote domain you?ll want to use the *Wrap versions > to avoid serializing results back into the local domain (which can fail). > **** > > **** > > I?m not sure if we?re trying to serialize an exception object here or the > result of your execution, but either way one of those is failing. You > should be able to check and see if the handles are null, and can also pass > them back into the remote domain for formatting (using either > ObjectOperations.Format or ExceptionOperations.FormatException) and just > get a string back.**** > > **** > > *From:* Cesar Mello [mailto:cmello at gmail.com] > *Sent:* Wednesday, March 07, 2012 11:38 AM > *To:* Dino Viehland > *Cc:* ironpython-users at python.org**** > > > *Subject:* Re: [Ironpython-users] Importing modules in a restricted > AppDomain**** > > **** > > Thanks a lot for the help guys. I'm trying to walk on my own, but just for > a quick feedback I've used the code suggested and now when I run "import > decimal" I get a MethodAccessException. I presumed it was safe to add all > the Reflection permissions and then I get an unhandled > ArgumentNullException (second stack trace). There is a bunch of internal > SecurityExceptions that are handled in the meantime though. I'll try to > debug this using the Console in a restricted AppDomain, so please don't > bother to answer me if I am doing some silly mistake.**** > > **** > > Thanks and best regards!**** > > Mello**** > > **** > > Stack trace 1 (MethodAccessException)**** > > **** > > Attempt by method > 'Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(System.Reflection.MethodInfo, > System.Type, System.Object)' to access method > 'IronPython.Compiler.Ast.UncollectableCompilationMode.NextSite>(System.Dynamic.DynamicMetaObjectBinder)' > failed.**** > > **** > > at System.Delegate.BindToMethodInfo(Object target, IRuntimeMethodInfo > method, RuntimeType methodType, DelegateBindingFlags flags)**** > > at System.Delegate.CreateDelegate(Type type, Object firstArgument, > MethodInfo method, Boolean throwOnBindFailure)**** > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo > methodInfo, Type delegateType, Object target)**** > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateDelegate(MethodInfo > methodInfo, Type delegateType)**** > > at > IronPython.Compiler.Ast.UncollectableCompilationMode.DelegateCache.MakeDelegateType(Type > retType, Expression[] args)**** > > at > IronPython.Compiler.Ast.UncollectableCompilationMode.ReduceDynamic(DynamicMetaObjectBinder > binder, Type retType, Expression arg0, Expression arg1)**** > > at IronPython.Compiler.Ast.DynamicGetMemberExpression.Reduce()**** > > at System.Linq.Expressions.Expression.ReduceAndCheck()**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.Expression.VisitChildren(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitExtension(Expression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitExtension(Expression > node)**** > > at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor) > **** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at System.Linq.Expressions.ExpressionVisitor.VisitBlock(BlockExpression > node)**** > > at System.Linq.Expressions.BlockExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryBody(TryExpression > node, LabelTarget ehLabel)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.RewriteTryCatch(TryExpression > node)**** > > at > Microsoft.Scripting.Ast.LightExceptionRewriter.VisitTry(TryExpression node) > **** > > at System.Linq.Expressions.TryExpression.Accept(ExpressionVisitor > visitor)**** > > at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)**** > > at Microsoft.Scripting.Ast.LightExceptionRewriter.Rewrite(Expression > expr)**** > > at Microsoft.Scripting.Ast.LightExceptionConvertingExpression.Reduce()* > *** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileExtensionExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileTryExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileAsVoid(Expression expr) > **** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockStart(BlockExpression > node)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileBlockExpression(Expression > expr, Boolean asVoid)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileLabelExpression(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression > expr)**** > > at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression > expr)**** > > at > Microsoft.Scripting.Interpreter.LightCompiler.CompileTop(LightLambdaExpression > node)**** > > at Microsoft.Scripting.Ast.LightExpression`1.Compile(Int32 > compilationThreshold)**** > > at IronPython.Compiler.RuntimeScriptCode.Compile()**** > > at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled()**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String > name, String fullName, String str)**** > > at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, > String name, String fullName, List path, Func`5 defaultLoader)**** > > 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.Modules.Builtin.__import__(CodeContext context, String > name, Object globals, Object locals, Object fromlist, Int32 level)**** > > at System.Func`7.Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 > arg6)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 > arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)**** > > at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, > String fullName, PythonTuple from, Int32 level)**** > > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level)**** > > at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 > arg0, T1 arg1)**** > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)**** > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope)**** > > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)* > *** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > **** > > **** > > **** > > --------------------------------------------------**** > > After adding Reflection permissions;**** > > **** > > at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] > methodInstantiation)**** > > at > System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext > context)**** > > **** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > **** > > **** > > **** > > **** > > **** > > On Wed, Mar 7, 2012 at 2:34 PM, Dino Viehland wrote: > **** > > Nope, ideally IronPython?s assemblies are not trusted. In general > IronPython?s assemblies are ?security transparent? which means they don?t > affect any security decisions made by the CLR. If you gave them full trust > then the user could do something like file(?C:\\bad_file.txt?, ?w+?). The > security transparency means that IronPython can contain a bunch of code for > accessing files and stuff but that code doesn?t need to be audited for > security because we don?t have any permissions of our own.**** > > **** > > You might want to try doing something like:**** > > **** > > AppDomainSetup info = new AppDomainSetup();**** > > info.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;* > *** > > info.ApplicationName = "Test";**** > > **** > > Evidence evidence = new Evidence();**** > > evidence.AddHost(new Zone(SecurityZone.Internet));**** > > **** > > System.Security.PermissionSet permSet = > SecurityManager.GetStandardSandbox(evidence);**** > > AppDomain newDomain = AppDomain.CreateDomain("test", evidence, > info, permSet, null);**** > > **** > > // create runtime in partial trust...**** > > ScriptRuntime runtime = Python.CreateRuntime(newDomain);**** > > **** > > Which will run the code in the internet zone which should be a safe set of > permissions ? you might need to add in your path access to this, but we use > this setup in a test case so it definitely works.**** > > **** > > *From:* ironpython-users-bounces+dinov=microsoft.com at python.org [mailto: > ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Cesar > Mello > *Sent:* Wednesday, March 07, 2012 5:17 AM > *To:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Importing modules in a restricted > AppDomain**** > > **** > > Hi,**** > > **** > > Must I grant fulltrust permissions to the IronPython assemblies? Sorry for > the basic question, but will the scripts still be restricted in this case? > **** > > **** > > Thank you a lot. This is a bit urgent for me, because it's the last step > before I can finish the prototype with IronPython and let it be accepted > for embedding in our product.**** > > **** > > Best regards!**** > > Mello**** > > **** > > **** > > On Mon, Mar 5, 2012 at 4:26 PM, Cesar Mello wrote:**** > > Please ignore my previous question. Sucessfully added FileIOPermission > with PathDiscovery and it worked:**** > > **** > > var pythonLibsPath = ExpressionEvaluator.GetPythonLibsPath();**** > > permissionSet.AddPermission(new > FileIOPermission(FileIOPermissionAccess.PathDiscovery | > FileIOPermissionAccess.Read, pythonLibsPath));**** > > **** > > **** > > Now I'm facing some problem with Emit permissions. > Added ReflectionPermission(PermissionState.Unrestricted) but still doesn't > work.**** > > **** > > I'm using .NET 4 in this project at work. Sorry if the subject is too > general and off-topic.**** > > **** > > Best regards**** > > Mello**** > > **** > > Message: Request for the permission of type > 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.**** > > **** > > at System.Security.CodeAccessSecurityEngine.Check(Object demand, > StackCrawlMark& stackMark, Boolean isPermSet)**** > > at System.Security.CodeAccessPermission.Demand()**** > > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)**** > > at > System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String > name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)**** > > at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String > name, Boolean emitSymbolInfo)**** > > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable, > PortableExecutableKinds peKind, ImageFileMachine machine)**** > > at Microsoft.Scripting.Generation.AssemblyGen..ctor(AssemblyName name, > String outDir, String outFileExtension, Boolean isDebuggable)**** > > at Microsoft.Scripting.Generation.Snippets.CreateNewAssembly(String > nameSuffix, Boolean emitSymbols)**** > > at Microsoft.Scripting.Generation.Snippets.GetOrCreateAssembly(Boolean > emitSymbols, AssemblyGen& assembly)**** > > at Microsoft.Scripting.Generation.Snippets.GetAssembly(Boolean > emitSymbols)**** > > at Microsoft.Scripting.Generation.Snippets.DefineType(String name, Type > parent, Boolean preserveName, Boolean emitDebugSymbols)**** > > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod(LambdaExpression > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols)** > ** > > at > Microsoft.Scripting.Generation.CompilerHelpers.CompileToMethod[T](Expression`1 > lambda, DebugInfoGenerator debugInfoGenerator, Boolean emitDebugSymbols)** > ** > > at > Microsoft.Scripting.Generation.CompilerHelpers.Compile[T](Expression`1 > lambda, Boolean emitDebugSymbols)**** > > at IronPython.Compiler.RuntimeScriptCode.Compile()**** > > at IronPython.Compiler.RuntimeScriptCode.EnsureCompiled()**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, 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.LoadFromDisk(CodeContext context, String > name, String fullName, String str)**** > > at IronPython.Runtime.Importer.ImportFromPathHook(CodeContext context, > String name, String fullName, List path, Func`5 defaultLoader)**** > > 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.Modules.Builtin.__import__(CodeContext context, String > name, Object globals, Object locals, Object fromlist, Int32 level)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at > Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 > arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)**** > > at IronPython.Runtime.Importer.ImportLightThrow(CodeContext context, > String fullName, PythonTuple from, Int32 level)**** > > at IronPython.Runtime.Operations.PythonOps.ImportTop(CodeContext > context, String fullName, Int32 level)**** > > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame)**** > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 > arg0, T1 arg1)**** > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)**** > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)**** > > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink)**** > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope)**** > > at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)* > *** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression, > ScriptScope scope)**** > > at > Elipse.Epm.Scripting.ExpressionEvaluator.ImportStandardModules(ScriptScope > scope) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 174**** > > at Elipse.Epm.Scripting.ExpressionEvaluator.AddExpression(Expression > expression, Object clientHandle) in > D:\proj\epm_5527\Source\EpmCommon\Elipse.Epm.Scripting\ExpressionEvaluator.cs:line > 82**** > > **** > > **** > > On Mon, Mar 5, 2012 at 3:18 PM, Cesar Mello wrote:**** > > Hi!**** > > **** > > Is there a way to load modules without giving permission to the AppDomain > to read .py files from disk?**** > > **** > > I need to run user code with limited permissions. They should be able to > do some simple calculations. But when I try to import a module like > 'decimal', filesystem access permission is required. **** > > **** > > Thank you a lot for the attention!**** > > **** > > Best regards**** > > Mello**** > > **** > > **** > > **** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Mar 7 23:54:35 2012 From: slide.o.mix at gmail.com (Slide) Date: Wed, 7 Mar 2012 15:54:35 -0700 Subject: [Ironpython-users] setuptools Message-ID: Just as an FYI, I committed some fixes today that should allow setuptools to be used with IronPython. I was able to bootstrap setuptools correctly with these fixes. https://github.com/IronLanguages/main/commit/f975d2f68412fd761939d19f0bfbb44fffea0fcc -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicka at Vipac.com.au Wed Mar 7 23:33:13 2012 From: nicka at Vipac.com.au (Nick Aschberger) Date: Thu, 8 Mar 2012 09:33:13 +1100 Subject: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54D1AB48@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD185D@ruby.vipac.com.au> <6C7ABA8B4E309440B857D74348836F2E54D1AB48@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1963@ruby.vipac.com.au> Thanks Dino! Don't know why I couldn't find it! Cheers Nick From: Dino Viehland [mailto:dinov at microsoft.com] Sent: Thursday, 8 March 2012 3:50 AM To: Nick Aschberger; ironpython-users at python.org Subject: RE: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? http://dlr.codeplex.com/wikipage?title=Docs%20and%20specs&referringTitle =Documentation has these 2 copies of the hosting spec: http://www.codeplex.com/Download?ProjectName=dlr&DownloadId=127513 [doc] http://www.codeplex.com/Download?ProjectName=dlr&DownloadId=127516 [pdf] Which should cover most of what you want. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Nick Aschberger Sent: Tuesday, March 06, 2012 7:24 PM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? Hi All, I have added in IronPython references to my project via nuget, and things are working swimmingly. However, as I'm ramping up on using IronPython, I'm finding a need inside visual studio to hit good 'ol F12, and jump to the definition of a fn or class to have a bit of a read. I'm talking specifically about the CLR objects such as engine, ScriptScope, etc. However, there is no XML commentary in the referenced DLL, so there is nothing to read there. No problem - I figured there would be a class reference or other documentation around to explain to me what each function is for. But I can't find one. Perhaps due to weak google-fu. There is nothing installed, nothing online. Now there must be something out there, otherwise no-one would know what any of the functions actually do. J So where can I get this? Thanks in advance, Nick Aschberger -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Mar 7 23:59:26 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 7 Mar 2012 14:59:26 -0800 Subject: [Ironpython-users] setuptools In-Reply-To: References: Message-ID: On Wed, Mar 7, 2012 at 2:54 PM, Slide wrote: > Just as an FYI, I?committed?some fixes today that should allow setuptools to > be used with IronPython. I was able to bootstrap setuptools correctly with > these fixes. Can you try it with distribute (http://pypi.python.org/pypi/distribute) as well? I gave pip a spin a little while back and it seemed to work fine after I made some changes to tarfile. I just can't remember if I ever pushed those changes... - Jeff From jdhardy at gmail.com Thu Mar 8 00:00:41 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 7 Mar 2012 15:00:41 -0800 Subject: [Ironpython-users] IronPython via nuget - how do I get the class reference documentation? In-Reply-To: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1963@ruby.vipac.com.au> References: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD185D@ruby.vipac.com.au> <6C7ABA8B4E309440B857D74348836F2E54D1AB48@TK5EX14MBXC294.redmond.corp.microsoft.com> <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1963@ruby.vipac.com.au> Message-ID: On Wed, Mar 7, 2012 at 2:33 PM, Nick Aschberger wrote: > Thanks Dino! > > > > Don?t know why I couldn?t find it! Well, probably because it's not intuitively named and in a non-obvious location, not to mention inside a PDF? I can't say I blame you... Hopefully that will change soon. :) - Jeff From cmello at gmail.com Thu Mar 8 05:42:58 2012 From: cmello at gmail.com (Cesar Mello) Date: Thu, 8 Mar 2012 01:42:58 -0300 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: Opened issue 32374 for this. Best regards Mello On Tue, Mar 6, 2012 at 2:25 PM, Jeff Hardy wrote: > On Tue, Mar 6, 2012 at 2:45 AM, Cesar Mello wrote: > > Hi Jeff, > > But I reached the same corner: expressions like 2 + 2 work, but 2 + 2.5 > > doesn't. Do I have to setup runtime options specific to WP7.1? I've > pasted > > the stack trace below. I've heard somewhere there is a pure interpreted > mode > > but I don't remember where... > > IronPython isn't fully interpreted yet (IronRuby is, I believe). > That's why the iOS port doesn't work at all, and WP has issues as > well. Keep in mind these are "previews" for a reason - they've hardly > been tested at all (clearly, if adding int + float doesn't even > work...). > > This case, though, the interpreter is not affected. According to MSDN > ( > http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.returntype(v=vs.95).aspx > ), > ReturnParameter is not supported (present, but not supported. FFS). In > this case a '#ifdef WP75' is used to separate WP workarounds from real > code. > > Looking at it briefly I can't see an obvious workaround (I'm not sure > what interactions MaybeNotImplementedAttribute will have); can you > open an issue and attach a minimal repro if possible? > > Also, thank you for looking at WP stuff. It needs people to hammer on > it to make sure that it works and find its limitations. > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Thu Mar 8 08:27:08 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Thu, 8 Mar 2012 07:27:08 +0000 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: Message-ID: <727D8E16AE957149B447FE368139F2B50D7628C3@SERVER10> Hi, Cesar, Just as a side note: If the Express Editions are too limited, sometimes SharpDevelop or MonoDevelop do the trick. E. G. they can handle "Solution Folders" and multi-language projects. A disadvantage is that, currently, none of them handles Managed C++ and C++/CLI. Gr??e, Markus Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org [mailto:ironpython-users-bounces+m.schaber=3s-software.com at python.org] Im Auftrag von Cesar Mello Gesendet: Mittwoch, 7. M?rz 2012 19:45 An: Jeff Hardy Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] IronPython on Windows Phone Thanks! I think I missed that one because I use the Express editions of Visual Studio at home. But now I see all the platforms are OK. Best regards Mello On Wed, Mar 7, 2012 at 2:31 PM, Jeff Hardy > wrote: Please use the RC1 files if you can. The normal WP build uses the same project files as everything else - just set the configuration to WP7Debug (or maybe Silverlight3Debug, I can't remember if I actually renamed it). You can also build everything by opening a Visual Studio command prompt, navigating to the root, and running `msbuild`. The resulting files will be in bin. - Jeff On Wed, Mar 7, 2012 at 5:01 AM, Cesar Mello > wrote: > Hi, > > For the repro sample, do you prefer to have references to the RC1 binaries, > or should I add the IronPython projects to compile from source and aid > debugging? > > A second question: what solution and projects are being used for the Windows > Phone build? > > Thanks > Mello > > > On Tue, Mar 6, 2012 at 4:43 PM, Cesar Mello > wrote: >> >> Hi Jeff, >> >>> >>> Looking at it briefly I can't see an obvious workaround (I'm not sure >>> what interactions MaybeNotImplementedAttribute will have); can you >>> open an issue and attach a minimal repro if possible? >>> >> >> Sure! I'll open this issue at home later, because the Windows Phone use >> case is for a pet project in my spare time just for fun. That said, we are >> using IronPython at work with .NET 4, but I don't want to mix personal stuff >> with professional duties. You know. :-) >> >> >>> >>> Also, thank you for looking at WP stuff. It needs people to hammer on >>> it to make sure that it works and find its limitations. >>> >> >> Nice! It's a pleasure to help. I just don't have enough knowledge about >> the codebase and even Python is a new thing to me, but my objective is to >> learn. Hacking IronPython seems to be the best way to learn and have fun at >> the same time. (I've seen quite a nice performance from PyPy so I imagine >> there is a lot of room for optimizations in the long run too). >> >> Thanks a lot for the help! >> >> Best regards >> Mello >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Thu Mar 8 12:39:10 2012 From: cmello at gmail.com (Cesar Mello) Date: Thu, 8 Mar 2012 08:39:10 -0300 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: <727D8E16AE957149B447FE368139F2B50D7628C3@SERVER10> References: <727D8E16AE957149B447FE368139F2B50D7628C3@SERVER10> Message-ID: Hi Markus, Thank you for the advice! I'll try the latest version of MonoDevelop in a while. My only success debugging IronPython code on WP7 was using my own projects made from scratch with some tweaks. I'm not sure if this is a limitation of the Express editions or my mistake: I can open the IronPython solution in VS Express for Phone and build the projects using the WP7Debug configuration. But if I add a new Windows Phone application project to this solution for debugging, when I Add References to the IronPython projects I get a messageBox saying: Microsoft Visual Studio 2010 Express for Windows Phone Unable to add the selected project reference. The project reference must be another Silverlight for Windows Phone project that is the same or lower version. Any suggestions are welcome. :-) Thanks a lot! Best regards Mello On Thu, Mar 8, 2012 at 4:27 AM, Markus Schaber wrote: > Hi, Cesar,**** > > ** ** > > Just as a side note: If the Express Editions are too limited, sometimes > SharpDevelop or MonoDevelop do the trick. E. G. they can handle ?Solution > Folders? and multi-language projects. A disadvantage is that, currently, > none of them handles Managed C++ and C++/CLI.**** > > ** ** > > Gr??e,**** > > Markus**** > > ** ** > > *Von:* ironpython-users-bounces+m.schaber=3s-software.com at python.org[mailto: > ironpython-users-bounces+m.schaber=3s-software.com at python.org] *Im > Auftrag von *Cesar Mello > *Gesendet:* Mittwoch, 7. M?rz 2012 19:45 > *An:* Jeff Hardy > *Cc:* ironpython-users at python.org > *Betreff:* Re: [Ironpython-users] IronPython on Windows Phone**** > > ** ** > > Thanks! I think I missed that one because I use the Express editions of > Visual Studio at home.**** > > ** ** > > But now I see all the platforms are OK.**** > > ** ** > > Best regards**** > > Mello**** > > ** ** > > On Wed, Mar 7, 2012 at 2:31 PM, Jeff Hardy wrote:**** > > Please use the RC1 files if you can. > > The normal WP build uses the same project files as everything else - > just set the configuration to WP7Debug (or maybe Silverlight3Debug, I > can't remember if I actually renamed it). > > You can also build everything by opening a Visual Studio command > prompt, navigating to the root, and running `msbuild`. The resulting > files will be in bin. > > - Jeff**** > > > On Wed, Mar 7, 2012 at 5:01 AM, Cesar Mello wrote: > > Hi, > > > > For the repro sample, do you prefer to have references to the RC1 > binaries, > > or should I add the IronPython projects to compile from source and aid > > debugging? > > > > A second question: what solution and projects are being used for the > Windows > > Phone build? > > > > Thanks > > Mello > > > > > > On Tue, Mar 6, 2012 at 4:43 PM, Cesar Mello wrote: > >> > >> Hi Jeff, > >> > >>> > >>> Looking at it briefly I can't see an obvious workaround (I'm not sure > >>> what interactions MaybeNotImplementedAttribute will have); can you > >>> open an issue and attach a minimal repro if possible? > >>> > >> > >> Sure! I'll open this issue at home later, because the Windows Phone use > >> case is for a pet project in my spare time just for fun. That said, we > are > >> using IronPython at work with .NET 4, but I don't want to mix personal > stuff > >> with professional duties. You know. :-) > >> > >> > >>> > >>> Also, thank you for looking at WP stuff. It needs people to hammer on > >>> it to make sure that it works and find its limitations. > >>> > >> > >> Nice! It's a pleasure to help. I just don't have enough knowledge about > >> the codebase and even Python is a new thing to me, but my objective is > to > >> learn. Hacking IronPython seems to be the best way to learn and have > fun at > >> the same time. (I've seen quite a nice performance from PyPy so I > imagine > >> there is a lot of room for optimizations in the long run too). > >> > >> Thanks a lot for the help! > >> > >> Best regards > >> Mello > >> > >> > >> > >**** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Mar 8 15:48:43 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 8 Mar 2012 06:48:43 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/7/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Include RST docs in source control, ship HTML docs 2. [New comment] Support providing .NET configuration file for launching ipy.exe's app domain (was Error loading mixed mode DLL) 3. [New comment] Request: change default to "server gc" for multithread performance 4. [Status update] Creating a low-permission version of PythonEngine fails post 2.0.0 5. [New comment] ImportError: No module named setuptools.command.easy_install 6. [New comment] zipimport does not correctly import submodules 7. [New comment] zlib fails to compress an empty string 8. [New comment] zlib fails to compress an empty string 9. [New issue] ModuleFinder not finding imports 10. [New comment] ModuleFinder not finding imports 11. [New comment] ModuleFinder not finding imports 12. [New issue] Patch for pyc.py 13. [New comment] Patch for pyc.py 14. [New comment] Patch for pyc.py 15. [New comment] Patch for pyc.py 16. [New comment] Patch for pyc.py 17. [New issue] Arithmetic expression mixing int and float literals is not working in Windows Phone 18. [New comment] Arithmetic expression mixing int and float literals is not working in Windows Phone ---------------------------------------------- ISSUES 1. [New comment] Include RST docs in source control, ship HTML docs http://ironpython.codeplex.com/workitem/25113 User jdhardy has commented on the issue: "I think so. The whole documentation system needs to be overhauled, so leave this one open."----------------- 2. [New comment] Support providing .NET configuration file for launching ipy.exe's app domain (was Error loading mixed mode DLL) http://ironpython.codeplex.com/workitem/26165 User jdhardy has commented on the issue: "Looks like #31383 was a dup for this one, but it got fixed instead. Either way, this is fixed in 2.7.2."----------------- 3. [New comment] Request: change default to "server gc" for multithread performance http://ironpython.codeplex.com/workitem/25712 User jdhardy has commented on the issue: "I wonder if this is still the case on .NET 4. Either way, I assume MS has their reasons for the defaults, and users can just change it themselves. It could perhaps be an install-time option, but that's as far as I would go."----------------- 4. [Status update] Creating a low-permission version of PythonEngine fails post 2.0.0 http://ironpython.codeplex.com/workitem/24475 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "Duplicate of [workitem:24101]."----------------- 5. [New comment] ImportError: No module named setuptools.command.easy_install http://ironpython.codeplex.com/workitem/22659 User slide_o_mix has commented on the issue: "Fixed in f975d2f"----------------- 6. [New comment] zipimport does not correctly import submodules http://ironpython.codeplex.com/workitem/32274 User slide_o_mix has commented on the issue: "Fixed in f975d2f"----------------- 7. [New comment] zlib fails to compress an empty string http://ironpython.codeplex.com/workitem/31976 User slide_o_mix has commented on the issue: "This looks like something weird going on inside the zlib library being used. The normal zlib doesn't fail (I am trying to replicate this scenario with normal zlib to look for implementation differences.)"----------------- 8. [New comment] zlib fails to compress an empty string http://ironpython.codeplex.com/workitem/31976 User slide_o_mix has commented on the issue: "This looks to be because the zlib.net implementation is returning Z_DATA_ERROR instead of Z_BUF_ERROR in a couple locations. I've only found two so far, there could be more."----------------- 9. [New issue] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User ned14 has proposed the issue: "I have a simple script which imports a few bits and pieces as it's a unit test. I then have another python script load that script using ModuleFinder, determine its imports and feed the entire lot to ipy64.exe pyc.py to build a standalone binary. This works fine in CPython, but IronPython sees only the module specified to ModuleFinder().run_script(). Is this expected? For now I can work around the problem by telling CPython to use the customised runtime libraries supplied with IronPython for package resolution, and CPython's ModuleFinder() appears to return the right stuff. Indeed then the only problem remaining is that the standalone executable doesn't bundle _codecs by the looks of things, which causes: Traceback (most recent call last): File "G:\BEurtle\BEXML\tests\TestParseBErepoWithLib.py", line 32, in test issue.status File "libBEXML\issue", line 149, in __getattr__ File "libBEXML\parsers\be_dir", line 113, in load File "codecs", line 884, in open LookupError: unknown encoding: UTF-8 I'm not sure if that's my bug or your bug yet, so if I can't fix it I'll report that separately. Niall"----------------- 10. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User slide_o_mix has commented on the issue: "Please attach a test to reproduce the issue."----------------- 11. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User ned14 has commented on the issue: "Feed any small python program into the attached script. It will iterate the imports and assemble them into a standalone EXE. Run it under CPython and it prints all the imports, as expected. Run it under IronPython and you get main.py, and nothing else. "----------------- 12. [New issue] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User ned14 has proposed the issue: "Here's a patch for pyc.py adding a /files: parameter: --- G:\Program Files\IronPython 2.7.2 RC1\Tools\Scripts\pyc.py 2012-03-07 18:58:45.000000000 -0000 +++ G:\BEurtle\BEXML\ironpython\pyc.py 2012-03-07 21:16:01.000000000 -0000 @@ -20,12 +20,13 @@ Options: /out:output_file Output file name (default is main_file.) /target:dll Compile only into dll. Default /target:exe Generate console executable stub for startup in addition to dll. /target:winexe Generate windows executable stub for startup in addition to dll. + /files:input_file Read to read files from, one per line. /? /h This message EXE/WinEXE specific options: /main:main_file.py Main file of the project (module to be executed first) /platform:x86 Compile for x86 only /platform:x64 Compile for x64 only @@ -209,12 +210,16 @@ elif arg.startswith("/embed"): embed = True elif arg.startswith("/standalone"): standalone = True + + elif arg.startswith("/files:"): + with open(arg[7:], 'r') as ih: + files+=[x[:-1] for x in ih.readlines()] elif arg in ["/?", "-?", "/h", "-h"]: print __doc__ sys.exit(0) else: You may also find the answer I posted to Stackoverflow at http://stackoverflow.com/questions/1578010/ironpython-2-6-py-exe/9609120#9609120 of interest. Niall"----------------- 13. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "Generally speaking, its better to fork the git repo to your own, make the mod, push and then issue a pull request. This patch will not apply to master."----------------- 14. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User ned14 has commented on the issue: "Even for such a tiny patch? Seems overkill."----------------- 15. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "We're much less likely to get to it in this format. Especially since its now manual work because it doesn't match the master branch much at all."----------------- 16. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "Fyi, I'm not saying I won't apply it, just giving the recommended approach and the easier one for me :-)"----------------- 17. [New issue] Arithmetic expression mixing int and float literals is not working in Windows Phone http://ironpython.codeplex.com/workitem/32374 User cmello has proposed the issue: "The expression 2 + 2 is successfully evaluated, but 2 + 2.5 crashes the app. The expression 2.5 + 2.5 is evaluated successfully. Please see the attached sample."----------------- 18. [New comment] Arithmetic expression mixing int and float literals is not working in Windows Phone http://ironpython.codeplex.com/workitem/32374 User cmello has commented on the issue: "The exception thrown is ArgumentNullException. Stack trace: at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNull(Object value, String paramName) at Microsoft.Scripting.Utils.CollectionUtils.FindIndex[T](IList`1 collection, Predicate`1 predicate) at Microsoft.Scripting.Utils.ExceptionUtils.SetData(Exception e, Object key, Object value) at Microsoft.Scripting.Interpreter.InterpretedFrame.SaveTraceToException(Exception exception) at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](FunctionCode arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run() at Microsoft.Scripting.SourceUnit.Execute() at Microsoft.Scripting.Hosting.ScriptSource.Execute() at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression) at PhoneFloatDivision.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName) " ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Thu Mar 8 23:15:24 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 8 Mar 2012 22:15:24 +0000 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: References: <727D8E16AE957149B447FE368139F2B50D7628C3@SERVER10> Message-ID: <9597F4A19BFDB342B6E90963100C33082F98C000@BY2PRD0310MB354.namprd03.prod.outlook.com> I would build IronPython WP7 binaries first and then add references to the resulting dlls, not to projects. Have a separate solution for you WinPhone app. Tomas From: ironpython-users-bounces+tomas.matousek=microsoft.com at python.org [mailto:ironpython-users-bounces+tomas.matousek=microsoft.com at python.org] On Behalf Of Cesar Mello Sent: Thursday, March 08, 2012 3:39 AM To: Markus Schaber Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] IronPython on Windows Phone Hi Markus, Thank you for the advice! I'll try the latest version of MonoDevelop in a while. My only success debugging IronPython code on WP7 was using my own projects made from scratch with some tweaks. I'm not sure if this is a limitation of the Express editions or my mistake: I can open the IronPython solution in VS Express for Phone and build the projects using the WP7Debug configuration. But if I add a new Windows Phone application project to this solution for debugging, when I Add References to the IronPython projects I get a messageBox saying: Microsoft Visual Studio 2010 Express for Windows Phone Unable to add the selected project reference. The project reference must be another Silverlight for Windows Phone project that is the same or lower version. Any suggestions are welcome. :-) Thanks a lot! Best regards Mello On Thu, Mar 8, 2012 at 4:27 AM, Markus Schaber > wrote: Hi, Cesar, Just as a side note: If the Express Editions are too limited, sometimes SharpDevelop or MonoDevelop do the trick. E. G. they can handle "Solution Folders" and multi-language projects. A disadvantage is that, currently, none of them handles Managed C++ and C++/CLI. Gr??e, Markus Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org [mailto:ironpython-users-bounces+m.schaber=3s-software.com at python.org] Im Auftrag von Cesar Mello Gesendet: Mittwoch, 7. M?rz 2012 19:45 An: Jeff Hardy Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] IronPython on Windows Phone Thanks! I think I missed that one because I use the Express editions of Visual Studio at home. But now I see all the platforms are OK. Best regards Mello On Wed, Mar 7, 2012 at 2:31 PM, Jeff Hardy > wrote: Please use the RC1 files if you can. The normal WP build uses the same project files as everything else - just set the configuration to WP7Debug (or maybe Silverlight3Debug, I can't remember if I actually renamed it). You can also build everything by opening a Visual Studio command prompt, navigating to the root, and running `msbuild`. The resulting files will be in bin. - Jeff On Wed, Mar 7, 2012 at 5:01 AM, Cesar Mello > wrote: > Hi, > > For the repro sample, do you prefer to have references to the RC1 binaries, > or should I add the IronPython projects to compile from source and aid > debugging? > > A second question: what solution and projects are being used for the Windows > Phone build? > > Thanks > Mello > > > On Tue, Mar 6, 2012 at 4:43 PM, Cesar Mello > wrote: >> >> Hi Jeff, >> >>> >>> Looking at it briefly I can't see an obvious workaround (I'm not sure >>> what interactions MaybeNotImplementedAttribute will have); can you >>> open an issue and attach a minimal repro if possible? >>> >> >> Sure! I'll open this issue at home later, because the Windows Phone use >> case is for a pet project in my spare time just for fun. That said, we are >> using IronPython at work with .NET 4, but I don't want to mix personal stuff >> with professional duties. You know. :-) >> >> >>> >>> Also, thank you for looking at WP stuff. It needs people to hammer on >>> it to make sure that it works and find its limitations. >>> >> >> Nice! It's a pleasure to help. I just don't have enough knowledge about >> the codebase and even Python is a new thing to me, but my objective is to >> learn. Hacking IronPython seems to be the best way to learn and have fun at >> the same time. (I've seen quite a nice performance from PyPy so I imagine >> there is a lot of room for optimizations in the long run too). >> >> Thanks a lot for the help! >> >> Best regards >> Mello >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Mar 9 00:16:07 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 8 Mar 2012 15:16:07 -0800 Subject: [Ironpython-users] IronPython on Windows Phone In-Reply-To: <9597F4A19BFDB342B6E90963100C33082F98C000@BY2PRD0310MB354.namprd03.prod.outlook.com> References: <727D8E16AE957149B447FE368139F2B50D7628C3@SERVER10> <9597F4A19BFDB342B6E90963100C33082F98C000@BY2PRD0310MB354.namprd03.prod.outlook.com> Message-ID: On Thu, Mar 8, 2012 at 2:15 PM, Tomas Matousek wrote: > I would build IronPython WP7 binaries first and then add references to the > resulting dlls, not to projects. Have a separate solution for you WinPhone > app. And one should be able to build those binaries from the command line as well, even with express. Run msbuild and then look in bin/WP7Debug. - Jeff From slide.o.mix at gmail.com Fri Mar 9 04:42:48 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 8 Mar 2012 20:42:48 -0700 Subject: [Ironpython-users] exceptions Message-ID: I'm at the point again where I need to implement a custom exception in a C# module. This exception actually appears like a tuple (if you do err[0] is gives you part of the error info). What is the best way to do something like this? Looking at the exception implementation, it seems like its all tied in with the runtime and not extendable in this way, am I completely wrong? Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Fri Mar 9 05:51:15 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 9 Mar 2012 01:51:15 -0300 Subject: [Ironpython-users] Issue tracking Message-ID: Hi! Please I would like to know the process for issue tracking. Some doubts: 1) Confirm the official issue tracker is http://ironpython.codeplex.com/workitem/list/basic and not github; 2) Who assigns issues/how/when; 3) Who changes status to Resolved and when; 4) How issues are validated; 5) Who changes status to Fixed. For example the issue I registered at http://ironpython.codeplex.com/workitem/32342 seems to be OK; at the company I work, issues must be validated by someone who did not work in the fix; so who should test and approve the fix? 6) It seems the integration of issue tracking and commits and builds is done through comments "fix nnnn"; Thank you a lot for the attention. If my English seems acceptable and there is interest I volunteer to summarize these things and make it visible to newcomers like me. Thank you. Best regards! Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Mar 9 12:22:11 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 9 Mar 2012 03:22:11 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/8/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] Ironpython 2.7.1 on Windows 7 64bit Machines 2. [New comment] zlib fails to compress an empty string 3. [New issue] Separate compiling and linking in pyc.py 4. [New comment] Incompat: Cannot use re module on bytearray objects 5. [New comment] Incompat: Cannot use re module on bytearray objects 6. [New comment] Patch for pyc.py 7. [New comment] Patch for pyc.py 8. [New comment] Patch for pyc.py 9. [New comment] Patch for pyc.py 10. [New comment] Fatal app exit on import uuid ---------------------------------------------- ISSUES 1. [Status update] Ironpython 2.7.1 on Windows 7 64bit Machines http://ironpython.codeplex.com/workitem/31918 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "I installed a Simplified Chinese VM and then installed IronPython 2.7.1 and had no issues."----------------- 2. [New comment] zlib fails to compress an empty string http://ironpython.codeplex.com/workitem/31976 User slide_o_mix has commented on the issue: "Fixed in 47023a0 "----------------- 3. [New issue] Separate compiling and linking in pyc.py http://ironpython.codeplex.com/workitem/32384 User ned14 has proposed the issue: "Is there any chance of being able to separate the compiling and linking processes? So, you'd compile all the python standard library into a single DLL. You'd then link that into your current compiland. This would be far, far faster than the present method. And if SharpDevelop can do it, it is surely possible."----------------- 4. [New comment] Incompat: Cannot use re module on bytearray objects http://ironpython.codeplex.com/workitem/21362 User slide_o_mix has commented on the issue: "Fixed in 7f4d969"----------------- 5. [New comment] Incompat: Cannot use re module on bytearray objects http://ironpython.codeplex.com/workitem/21362 User slide_o_mix has commented on the issue: "Fixed in 7f4d969"----------------- 6. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "I actually decided to implement this a bit differently. I am implementing response files. You will be able to specify @respfile on the command line and it can contain either command line args or files."----------------- 7. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User ned14 has commented on the issue: "Response files are a good idea. Mine was just a quick fix to solve command line limits. Is there any chance of being able to separate the compiling and linking processes? So, you'd compile all the python standard library into a single DLL. You'd then link that into your current compiland. This would be far, far faster than the present method. And if SharpDevelop can do it, it is surely possible. Niall "----------------- 8. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "Please open a separate issue for that."----------------- 9. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "Please try this version which implements response files and let me know if it works for you. If so, I'll commit and push."----------------- 10. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User jdhardy has commented on the issue: "I can't reproduce this on my Win7 x64 box - import uuid works just fine. Is there anything else about your setup that's odd?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Mar 10 02:04:42 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 9 Mar 2012 17:04:42 -0800 Subject: [Ironpython-users] Issue tracking In-Reply-To: References: Message-ID: On Thu, Mar 8, 2012 at 8:51 PM, Cesar Mello wrote: > Hi! > > Please I would like to know the process for issue tracking. Some doubts: > > 1) Confirm the official issue tracker > is?http://ironpython.codeplex.com/workitem/list/basic?and not github; Yep. It has all of the history, and I actually prefer it to the github one, although it has it's frustrating points. > > 2) Who assigns issues/how/when; Generally they don't get assigned; nobody has any real authority (a few people have all of the passwords, but that's it). If you have write access to the bug tracker, you can assign them to yourself. Anyone who wants write access to the tracker just has to ask; unless there's a good reason not to you'll get it. > > 3) Who changes status to Resolved and when; There isn't a Resolved; there is Fixed and closed, though. Whoever commits the fix should set the bug to Fixed. If you have commit access, you also have issue tracker access. If it's a pull request whoever merges it should also 'Fixed' the bug. > > 4) How issues are validated; If there's an easy repro attached, someone with tracker access can check it and set it to Active. If you don't have access, feel free to check it anyway and leave a comment. Do this enough times and you'll get write access without even asking :) > > 5) Who changes status to Fixed. I covered this above, but it's a good spot to mention Closed. Bugs get Closed for two reason: not a valid bug, or the fix has already been released. Basically, good bugs go: Proposed -> (someone validates) -> Actives -> (someone fixes) -> Fixed -> (release made) -> Closed. > > For example the issue I registered > at?http://ironpython.codeplex.com/workitem/32342 seems to be OK; at the > company I work, issues must be validated by someone who did not work in the > fix; so who should test and approve the fix? We're not that strict, mainly due to lack of manpower. If you're not sure about a fix, do a pull request; it'll get reviewed that way. I also review all recent commits periodically just to make sure quality stays high. I have no problem with one person opening an issue, making the fix, committing, and marking Fixed. If someone have commit access, I trust them to be responsible. > > 6) It seems the integration of issue tracking and commits and builds is done > through comments "fix nnnn"; Yep, it's manual. That would be one advantage to switching to the github issue tracker, but it's not worth work required to get there. > > Thank you a lot for the attention. If my English seems acceptable and there > is interest I volunteer to summarize these things and make it visible to > newcomers like me. Your english is better than some native speakers that I know, so feel free to start a page on the github wiki; everyone should be able to edit it. > > Thank you. Best regards! No, thank you for your interest. I always want to see more people helping out. - Jeff From no_reply at codeplex.com Sat Mar 10 17:46:33 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 10 Mar 2012 08:46:33 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 3/9/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] Add Option To Pyc To Modify Stub EXE to load DLL from EXEs Path 2. [Status update] Hosting: Import a module on a ScriptScope 3. [Status update] Enable running Python scripts on Windows Phone 7 4. [Status update] Console exit behavior on OSX/Mono in 2.7A1 5. [Status update] Pyc bug: parameter /target will be ignored if it appears before /main 6. [Status update] Booleans get converted to ints by str.format 7. [Status update] Better error message when trying to load downloaded DLLs 8. [Status update] Nuget needs to be updated with IronPython 2.7+ 9. [Status update] Improve Release build process 10. [Status update] Better handling of binding failure due to .Net version 11. [Status update] IPy version string somewhat misleading. 12. [Status update] Converting large float to int produces Int64 (which is not int or long) 13. [Status update] Some path ops are not done through PlatformAdaptationLayer in IronPython.Runtime.Importer 14. [Status update] sys.version is incomplete in user created engine, creating problems in platform.py 15. [Status update] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path 16. [Status update] Console color choice is bad for bright consoles 17. [Status update] 2.7.1 Missing Prompts with -i parameter? 18. [Status update] Type error from string input to class inheriting int 19. [Status update] IronPython Android Support 20. [New comment] Patch for pyc.py 21. [New comment] Patch for pyc.py 22. [New issue] -X:TabCompletion source missing PythonOptionsParser.cs 23. [New comment] -X:TabCompletion source missing PythonOptionsParser.cs 24. [Status update] -X:TabCompletion source missing PythonOptionsParser.cs 25. [Status update] current working directory lost in compiled script 26. [New comment] Separate compiling and linking in pyc.py 27. [Status update] Importer doesn't support .pth files 28. [Status update] Implement zipimport module 29. [Status update] Implement _sqlite3 module 30. [New comment] Default read size of _ssl.SSLType(...).read() is 1024, not the max value of Int32 31. [New comment] Default read size of _ssl.SSLType(...).read() is 1024, not the max value of Int32 32. [Status update] zipimport does not correctly import submodules 33. [New comment] Cleanup "Windows Form Tutorial"; making it more Pythonic 34. [Status update] Support providing .NET configuration file for launching ipy.exe's app domain (was Error loading mixed mode DLL) 35. [Status update] Connot convert directly from System.Decimal to decimal.Decimal 36. [Status update] "platform" instructions on 2.7.2b1 37. [New comment] Fatal app exit on import uuid 38. [New comment] Fatal app exit on import uuid 39. [New comment] Fatal app exit on import uuid 40. [New comment] Fatal app exit on import uuid 41. [New comment] Fatal app exit on import uuid 42. [New comment] Fatal app exit on import uuid 43. [Status update] When compiling an EXE pyc.py should set STA thread for winexe's and provide control of STA/MTA 44. [Status update] Pyc generates a *.dll regardless of "/target:..." usage 45. [New comment] Arithmetic expression mixing int and float literals is not working in Windows Phone ---------------------------------------------- ISSUES 1. [Status update] Add Option To Pyc To Modify Stub EXE to load DLL from EXEs Path http://ironpython.codeplex.com/workitem/21987 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 2. [Status update] Hosting: Import a module on a ScriptScope http://ironpython.codeplex.com/workitem/26505 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 3. [Status update] Enable running Python scripts on Windows Phone 7 http://ironpython.codeplex.com/workitem/26534 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 4. [Status update] Console exit behavior on OSX/Mono in 2.7A1 http://ironpython.codeplex.com/workitem/28248 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 5. [Status update] Pyc bug: parameter /target will be ignored if it appears before /main http://ironpython.codeplex.com/workitem/29696 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 6. [Status update] Booleans get converted to ints by str.format http://ironpython.codeplex.com/workitem/30412 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 7. [Status update] Better error message when trying to load downloaded DLLs http://ironpython.codeplex.com/workitem/31006 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 8. [Status update] Nuget needs to be updated with IronPython 2.7+ http://ironpython.codeplex.com/workitem/31126 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 9. [Status update] Improve Release build process http://ironpython.codeplex.com/workitem/31144 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 10. [Status update] Better handling of binding failure due to .Net version http://ironpython.codeplex.com/workitem/31383 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 11. [Status update] IPy version string somewhat misleading. http://ironpython.codeplex.com/workitem/31420 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 12. [Status update] Converting large float to int produces Int64 (which is not int or long) http://ironpython.codeplex.com/workitem/31549 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 13. [Status update] Some path ops are not done through PlatformAdaptationLayer in IronPython.Runtime.Importer http://ironpython.codeplex.com/workitem/31603 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 14. [Status update] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 15. [Status update] Misleading error message with clr.AddReferenceToFileAndPath on a UNC path http://ironpython.codeplex.com/workitem/31749 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 16. [Status update] Console color choice is bad for bright consoles http://ironpython.codeplex.com/workitem/31872 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 17. [Status update] 2.7.1 Missing Prompts with -i parameter? http://ironpython.codeplex.com/workitem/31908 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 18. [Status update] Type error from string input to class inheriting int http://ironpython.codeplex.com/workitem/32024 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 19. [Status update] IronPython Android Support http://ironpython.codeplex.com/workitem/32232 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 20. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User ned14 has commented on the issue: "Did you mean to attach a new pyc.py for me to try? I'd say it'll be Tuesday before I can try it anyway."----------------- 21. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User ned14 has commented on the issue: "Sorry, I see the pyc.py. I really must say that codeplex has a dreadfully unintuitive UI :( Thanks for the new version, I'll get back to you on Tuesday."----------------- 22. [New issue] -X:TabCompletion source missing PythonOptionsParser.cs http://ironpython.codeplex.com/workitem/32392 User harejohn has proposed the issue: "PythonOptionsParser.cs is missing the "-X:TabCompletion" source but somehow the 2.7.1 executable has the code enabled. Looks like someone forgot to upload the latest version to the source code repository."----------------- 23. [New comment] -X:TabCompletion source missing PythonOptionsParser.cs http://ironpython.codeplex.com/workitem/32392 User jdhardy has commented on the issue: "The code to parse those options is in OptionsParser (in Runtime\Microsoft.Dynamic\Hosting\Shell\OptionsParser.cs), which is the ultimate base class of PythonOptionsParser."----------------- 24. [Status update] -X:TabCompletion source missing PythonOptionsParser.cs http://ironpython.codeplex.com/workitem/32392 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "Not a bug."----------------- 25. [Status update] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32045 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 26. [New comment] Separate compiling and linking in pyc.py http://ironpython.codeplex.com/workitem/32384 User jdhardy has commented on the issue: "I think what's really needed is the ability to embed arbitrary DLLs into the standalone package. Right now the list is basically hardcoded. Mimicking csc's /reference switches is probably the way to go."----------------- 27. [Status update] Importer doesn't support .pth files http://ironpython.codeplex.com/workitem/1607 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 28. [Status update] Implement zipimport module http://ironpython.codeplex.com/workitem/391 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 29. [Status update] Implement _sqlite3 module http://ironpython.codeplex.com/workitem/21410 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 30. [New comment] Default read size of _ssl.SSLType(...).read() is 1024, not the max value of Int32 http://ironpython.codeplex.com/workitem/24282 User slide_o_mix has commented on the issue: "I get a different error on the temp.write(SSL_REQUEST) line. "----------------- 31. [New comment] Default read size of _ssl.SSLType(...).read() is 1024, not the max value of Int32 http://ironpython.codeplex.com/workitem/24282 User slide_o_mix has commented on the issue: "my error could be related to [workitem:24281]"----------------- 32. [Status update] zipimport does not correctly import submodules http://ironpython.codeplex.com/workitem/32274 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2."----------------- 33. [New comment] Cleanup "Windows Form Tutorial"; making it more Pythonic http://ironpython.codeplex.com/workitem/19488 User slide_o_mix has commented on the issue: "Fixed in 11ff4fb"----------------- 34. [Status update] Support providing .NET configuration file for launching ipy.exe's app domain (was Error loading mixed mode DLL) http://ironpython.codeplex.com/workitem/26165 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 35. [Status update] Connot convert directly from System.Decimal to decimal.Decimal http://ironpython.codeplex.com/workitem/18220 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 36. [Status update] "platform" instructions on 2.7.2b1 http://ironpython.codeplex.com/workitem/32322 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 37. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User slide_o_mix has commented on the issue: "I also cannot reproduce this issue. Are you running under a limited account or anything like that?"----------------- 38. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has commented on the issue: "No, there's nothing unusual about my Win7 x64 box. My user is the normal semi-administrator type, so it priv escalates when it needs to. The Win7 install is actually nearly fresh. My old Win7 install died a few months ago, so this one is a complete reformat and reinstall. It has MS Office, VS2010, MS Security Essentials and actually not a lot more. It's an old Intel Core 2 Quad box, but surely that makes no difference except for lack of SSE4? Did you try installing IronPython onto a different drive letter? As I mentioned, that might be the cause as it appears to not be finding a DLL. Niall "----------------- 39. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User slide_o_mix has commented on the issue: "My IronPython is installed (I didn't use the installer, I just extracted the binaries) to a non-C: drive. I'll try using the installer and see if that makes any difference."----------------- 40. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User slide_o_mix has commented on the issue: "I just installed in a VM to a drive I named G:\ (additional hdd in the VM). I was able to import uuid with no issues using both ipy.exe and ipy64.exe."----------------- 41. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has commented on the issue: "Is is worth forcing a rebuild of all .NET assemblies do you think? I mean, would that affect IronPython's assemblies? Niall "----------------- 42. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User jdhardy has commented on the issue: "Do you have IronPython 2.7.1 installed but are running 2.7.2rc1 from the zip file, by any chance?"----------------- 43. [Status update] When compiling an EXE pyc.py should set STA thread for winexe's and provide control of STA/MTA http://ironpython.codeplex.com/workitem/19409 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 44. [Status update] Pyc generates a *.dll regardless of "/target:..." usage http://ironpython.codeplex.com/workitem/19456 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 45. [New comment] Arithmetic expression mixing int and float literals is not working in Windows Phone http://ironpython.codeplex.com/workitem/32374 User jdhardy has commented on the issue: "The error given is not the root cause; it's a side effect of a bug in how unhandled exception are handled. Fixing that and another issue, the root cause is: System.InvalidProgramException occurred Message=InvalidProgramException StackTrace: at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, Int32 arg0) at CallSite.Target() at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, Object arg0, Object arg1) at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](FunctionCode arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run() at Microsoft.Scripting.SourceUnit.Execute() at Microsoft.Scripting.Hosting.ScriptSource.Execute() at Microsoft.Scripting.Hosting.ScriptEngine.Execute(String expression) at PhoneFloatDivision.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName) Code generation bugs are not fun to fix." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Mar 11 13:05:07 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 11 Mar 2012 05:05:07 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/10/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] Get rid of __future__.py generation scripts and replace with a real __future__.py in TFS 2. [Status update] IRONPYTHONPATH not respected for pyc.py compiled assemblies 3. [Status update] missing python modules in version 2.7 release 4. [Status update] Add option to pyc.py to embed IronPython assemblies 5. [New comment] Patch for pyc.py 6. [New issue] Monodroid Import Not Working 7. [New comment] Separate compiling and linking in pyc.py 8. [New comment] Implement rest of datetime module 9. [Status update] test sax blocking:no XML parsers available 10. [New comment] Implement timedelta.total_seconds() 11. [Status update] Implement timedelta.total_seconds() 12. [New comment] Fatal app exit on import uuid 13. [New comment] IronPython 2.7B1 non-default install location not working 14. [Status update] IronPython Visual Studio templates are not installing ---------------------------------------------- ISSUES 1. [Status update] Get rid of __future__.py generation scripts and replace with a real __future__.py in TFS http://ironpython.codeplex.com/workitem/23969 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "This seems to have been fixed a long time ago."----------------- 2. [Status update] IRONPYTHONPATH not respected for pyc.py compiled assemblies http://ironpython.codeplex.com/workitem/26706 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Fixed in IronPython 2.7.2."----------------- 3. [Status update] missing python modules in version 2.7 release http://ironpython.codeplex.com/workitem/30348 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "csv is available. pyexpat is tracked by [workitem:20023]"----------------- 4. [Status update] Add option to pyc.py to embed IronPython assemblies http://ironpython.codeplex.com/workitem/32288 User jdhardy has updated the issue: Status has changed from Fixed to Closed with the following comment, "Fixed in IronPython 2.7.2."----------------- 5. [New comment] Patch for pyc.py http://ironpython.codeplex.com/workitem/32372 User slide_o_mix has commented on the issue: "Fixed in 06bf2cf"----------------- 6. [New issue] Monodroid Import Not Working http://ironpython.codeplex.com/workitem/32393 User d10sfan has proposed the issue: "Trying to use ironpython with monodroid. I was able to get a string to work (just a print test sort of thing) but when I try to use a file or even do a import of anything with the string method, it always gets errors. Attached is my c# code. If I try to run it, I get a message saying that import has too few arguments."----------------- 7. [New comment] Separate compiling and linking in pyc.py http://ironpython.codeplex.com/workitem/32384 User slide_o_mix has commented on the issue: "Should be easy enough. I'll try and do it next week."----------------- 8. [New comment] Implement rest of datetime module http://ironpython.codeplex.com/workitem/17470 User jdhardy has commented on the issue: "The only ones left that need to be implemented are: datetime.timedelta.__rdiv__ datetime.timedelta.__rfloordiv__"----------------- 9. [Status update] test sax blocking:no XML parsers available http://ironpython.codeplex.com/workitem/23897 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Duplicate of [workitem:20023]"----------------- 10. [New comment] Implement timedelta.total_seconds() http://ironpython.codeplex.com/workitem/32342 User jdhardy has commented on the issue: "Fixed in 0d9cad9."----------------- 11. [Status update] Implement timedelta.total_seconds() http://ironpython.codeplex.com/workitem/32342 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "Released in IronPython 2.7.2"----------------- 12. [New comment] Fatal app exit on import uuid http://ironpython.codeplex.com/workitem/32355 User ned14 has commented on the issue: "No, 2.7.1 was uninstalled and 2.7.2 RC1 was installed instead. However, remember the problem appeared on both versions."----------------- 13. [New comment] IronPython 2.7B1 non-default install location not working http://ironpython.codeplex.com/workitem/29950 User jdhardy has commented on the issue: "Need to see if this is still an issue."----------------- 14. [Status update] IronPython Visual Studio templates are not installing http://ironpython.codeplex.com/workitem/30283 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "IronPython Tools are no longer supported." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Mar 12 05:52:31 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 11 Mar 2012 21:52:31 -0700 Subject: [Ironpython-users] IronPython 2.7.2 Released Message-ID: On behalf of the IronPython team, I'm happy to announce the final release IronPython 2.7.2 (http://ironpython.codeplex.com/releases/view/74478). This release includes everything from IronPython 2.7 and 2.7.1 as well. Like all IronPython 2.7-series releases, .NET 4 is required to install it. Installing this release will replace any existing IronPython 2.7-series installation. Unlike previous releases, the assemblies for all supported platforms are included in the installer as well as the zip package, in the "Platforms" directory. IronPython 2.7.2 includes support for .NET 3.5, .NET 4, Silverlight 4, and Silverlight 5, and preliminary releases for Mono for Android 4.0 and Windows Phone 7.5. For 2.7.2, the mobile platforms are previews; they have known issues, and expect them to change for 2.7.3. The biggest improvements in IronPython 2.7.2 are: support for loading libraries from zip archives (the zipimport module); the sqlite3 module; many improvements to the pyc.py compiler, such as the ability generate standalone executables by embedding the IronPython assemblies; and numerous other bug fixes. IronPython 2.7.2 is also available for embedding via NuGet. The main package is IronPython, and the standard library is in IronPython.StdLib. A huge thanks to everyone who helped make this release possible; this wouldn't have been nearly as big a release without your help! From zgramana at pottsconsultinggroup.com Mon Mar 12 06:02:47 2012 From: zgramana at pottsconsultinggroup.com (Zachary Gramana) Date: Mon, 12 Mar 2012 01:02:47 -0400 Subject: [Ironpython-users] IronPython 2.7.2 Released In-Reply-To: References: Message-ID: <62C692FE-BD4B-4AF2-94D9-1F0C4BDA289C@pottsconsultinggroup.com> Congratulations to everyone! On Mar 12, 2012, at 0:52, Jeff Hardy wrote: > On behalf of the IronPython team, I'm happy to announce the final > release IronPython 2.7.2 > (http://ironpython.codeplex.com/releases/view/74478). This release > includes everything from IronPython 2.7 and 2.7.1 as well. Like all > IronPython 2.7-series releases, .NET 4 is required to install it. > Installing this release will replace any existing IronPython > 2.7-series installation. > > Unlike previous releases, the assemblies for all supported platforms > are included in the installer as well as the zip package, in the > "Platforms" directory. IronPython 2.7.2 includes support for .NET 3.5, > .NET 4, Silverlight 4, and Silverlight 5, and preliminary releases for > Mono for Android 4.0 and Windows Phone 7.5. For 2.7.2, the mobile > platforms are previews; they have known issues, and expect them to > change for 2.7.3. > > The biggest improvements in IronPython 2.7.2 are: > support for loading libraries from zip archives (the zipimport module); > the sqlite3 module; > many improvements to the pyc.py compiler, such as the ability generate > standalone executables by embedding the IronPython assemblies; > and numerous other bug fixes. > > IronPython 2.7.2 is also available for embedding via NuGet. The main > package is IronPython, and the standard library is in > IronPython.StdLib. > > A huge thanks to everyone who helped make this release possible; this > wouldn't have been nearly as big a release without your help! > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From rome at Wintellect.com Mon Mar 12 07:23:11 2012 From: rome at Wintellect.com (Keith Rome) Date: Sun, 11 Mar 2012 23:23:11 -0700 Subject: [Ironpython-users] IronPython 2.7.2 Released In-Reply-To: References: Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3D65C92E@VA3DIAXVS461.RED001.local> Thanks for the great work! Regarding the new zipimport functionality - is it possible to specify an embedded resource name for the path to the zip? For example, if I wanted to distribute a library by just packaging it up within an assembly? Or is it necessary to write the resource out to a file on disk first? Example: Instead of: sys.path.insert(0, '/path/lib.zip') Something like: sys.path.insert(0, 'resource:path.lib.zip') The primary reason behind wanting to deliver via embedded resource is to prevent tinkering/tampering by end users. But there are additional reasons such as simpler deployment under Silverlight and not having to deal with versioning of extra "satellite" external resources when using our scripting runtime environment in multiple projects. All of those issues go away when we can package everything directly within the assembly(s). I am currently using a custom PlatformAdaptationLayer to supply the file contents at runtime and msbuild wildcard inclusion of the libraries and all subfolders to embed them as resources (something that msbuild tolerates, but Visual Studio does not). It would be much cleaner to just use zipimport, as well as much easier to maintain (and the distributed assembly would also be much smaller due to zip compression). Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com -----Original Message----- From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jeff Hardy Sent: Monday, March 12, 2012 12:53 AM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython 2.7.2 Released On behalf of the IronPython team, I'm happy to announce the final release IronPython 2.7.2 (http://ironpython.codeplex.com/releases/view/74478). This release includes everything from IronPython 2.7 and 2.7.1 as well. Like all IronPython 2.7-series releases, .NET 4 is required to install it. Installing this release will replace any existing IronPython 2.7-series installation. Unlike previous releases, the assemblies for all supported platforms are included in the installer as well as the zip package, in the "Platforms" directory. IronPython 2.7.2 includes support for .NET 3.5, .NET 4, Silverlight 4, and Silverlight 5, and preliminary releases for Mono for Android 4.0 and Windows Phone 7.5. For 2.7.2, the mobile platforms are previews; they have known issues, and expect them to change for 2.7.3. The biggest improvements in IronPython 2.7.2 are: support for loading libraries from zip archives (the zipimport module); the sqlite3 module; many improvements to the pyc.py compiler, such as the ability generate standalone executables by embedding the IronPython assemblies; and numerous other bug fixes. IronPython 2.7.2 is also available for embedding via NuGet. The main package is IronPython, and the standard library is in IronPython.StdLib. A huge thanks to everyone who helped make this release possible; this wouldn't have been nearly as big a release without your help! _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users From nicka at Vipac.com.au Mon Mar 12 12:34:58 2012 From: nicka at Vipac.com.au (Nick Aschberger) Date: Mon, 12 Mar 2012 22:34:58 +1100 Subject: [Ironpython-users] IronPython hosting - providing syntax highlighting (and intellisense?!) to customers Message-ID: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1D00@ruby.vipac.com.au> Hi All, We are intending to use IronPython to provide a simple expression engine to our customers. This will give them the ability to calculate some of their own results from data stored in the database. Being a software project, I say "simple expression" but I can easily see it migrating towards a "complex expression" when customers get more familiar with python. Now, I can just give them a text area to stick some text in, and maybe some tools to help build this text but... it seems like I should be able to do better than this, and it seems like something that others would have solved. I'd really like the UI that the customer uses to compose an expression to have python syntax highlighting to help them. Furthermore, if we make .NET objects/functions available to the python script, it would be fantastic if the user had some kind of intellisense available to help them when interacting with the types we would make available to the scripts to use. Any advice, or experience with this? Cheers Nick Aschberger -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Mon Mar 12 15:02:52 2012 From: slide.o.mix at gmail.com (Slide) Date: Mon, 12 Mar 2012 07:02:52 -0700 Subject: [Ironpython-users] IronPython 2.7.2 Released In-Reply-To: <7737799D90E55E4BB9C9F7E40D161E110E3D65C92E@VA3DIAXVS461.RED001.local> References: <7737799D90E55E4BB9C9F7E40D161E110E3D65C92E@VA3DIAXVS461.RED001.local> Message-ID: This is a great idea, this functionality does not currently exist, could you please file a new issue at http://ironpython.codeplex.com? Thanks, slide On Sun, Mar 11, 2012 at 11:23 PM, Keith Rome wrote: > Thanks for the great work! > > Regarding the new zipimport functionality - is it possible to specify an > embedded resource name for the path to the zip? For example, if I wanted to > distribute a library by just packaging it up within an assembly? Or is it > necessary to write the resource out to a file on disk first? > > Example: > Instead of: sys.path.insert(0, '/path/lib.zip') > Something like: sys.path.insert(0, 'resource:path.lib.zip') > > The primary reason behind wanting to deliver via embedded resource is to > prevent tinkering/tampering by end users. But there are additional reasons > such as simpler deployment under Silverlight and not having to deal with > versioning of extra "satellite" external resources when using our scripting > runtime environment in multiple projects. All of those issues go away when > we can package everything directly within the assembly(s). > > I am currently using a custom PlatformAdaptationLayer to supply the file > contents at runtime and msbuild wildcard inclusion of the libraries and all > subfolders to embed them as resources (something that msbuild tolerates, > but Visual Studio does not). It would be much cleaner to just use > zipimport, as well as much easier to maintain (and the distributed assembly > would also be much smaller due to zip compression). > > > Keith Rome > Senior Consultant and Architect > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS > Wintellect | 770.617.4016 | krome at wintellect.com > www.wintellect.com > > -----Original Message----- > From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto: > ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of > Jeff Hardy > Sent: Monday, March 12, 2012 12:53 AM > To: ironpython-users at python.org > Subject: [Ironpython-users] IronPython 2.7.2 Released > > On behalf of the IronPython team, I'm happy to announce the final > release IronPython 2.7.2 > (http://ironpython.codeplex.com/releases/view/74478). This release > includes everything from IronPython 2.7 and 2.7.1 as well. Like all > IronPython 2.7-series releases, .NET 4 is required to install it. > Installing this release will replace any existing IronPython > 2.7-series installation. > > Unlike previous releases, the assemblies for all supported platforms > are included in the installer as well as the zip package, in the > "Platforms" directory. IronPython 2.7.2 includes support for .NET 3.5, > .NET 4, Silverlight 4, and Silverlight 5, and preliminary releases for > Mono for Android 4.0 and Windows Phone 7.5. For 2.7.2, the mobile > platforms are previews; they have known issues, and expect them to > change for 2.7.3. > > The biggest improvements in IronPython 2.7.2 are: > support for loading libraries from zip archives (the zipimport module); > the sqlite3 module; > many improvements to the pyc.py compiler, such as the ability generate > standalone executables by embedding the IronPython assemblies; > and numerous other bug fixes. > > IronPython 2.7.2 is also available for embedding via NuGet. The main > package is IronPython, and the standard library is in > IronPython.StdLib. > > A huge thanks to everyone who helped make this release possible; this > wouldn't have been nearly as big a release without your help! > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Mon Mar 12 16:36:12 2012 From: rome at Wintellect.com (Keith Rome) Date: Mon, 12 Mar 2012 08:36:12 -0700 Subject: [Ironpython-users] IronPython hosting - providing syntax highlighting (and intellisense?!) to customers In-Reply-To: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1D00@ruby.vipac.com.au> References: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1D00@ruby.vipac.com.au> Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3D65C9F3@VA3DIAXVS461.RED001.local> At risk of sounding like an advertisement, I strongly recommend the ActiPro SyntaxEditor controls. We have used the WPF and Silverlight versions with great success. It supports all of the features you mention (syntax highlighting, Intellisense, code completion scopes) and many more. They have a functional demo application with source code that exhibits all of those features. Performance is great (be sure to enable ambient background parsing). We even have it wired up so that after parsing/lexing, we take the python source and run it through the IronPython compiler using a custom ErrorListener, which is used to collect compilation errors that are then fed into the ParseData output. And since we have a ParseErrorTagger and custom SquiggleTooltipProvider installed into the parser, we get those nice red squiggles directly under compiler errors in the source text itself, along with detailed tooltips. Sorry if I get carried away, but it's extremely cool stuff! Our python editing environment is very slick; while it does not quite have the features of Visual Studio's editor, it comes really close (we even support breakpoints and stepping)... and it fully embeds in our WPF / Silverlight products. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Nick Aschberger Sent: Monday, March 12, 2012 7:35 AM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython hosting - providing syntax highlighting (and intellisense?!) to customers Hi All, We are intending to use IronPython to provide a simple expression engine to our customers. This will give them the ability to calculate some of their own results from data stored in the database. Being a software project, I say "simple expression" but I can easily see it migrating towards a "complex expression" when customers get more familiar with python. Now, I can just give them a text area to stick some text in, and maybe some tools to help build this text but... it seems like I should be able to do better than this, and it seems like something that others would have solved. I'd really like the UI that the customer uses to compose an expression to have python syntax highlighting to help them. Furthermore, if we make .NET objects/functions available to the python script, it would be fantastic if the user had some kind of intellisense available to help them when interacting with the types we would make available to the scripts to use. Any advice, or experience with this? Cheers Nick Aschberger -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Mon Mar 12 16:53:32 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 12 Mar 2012 08:53:32 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/11/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] StackOverflowException when trying to execute IronPython code on x86 Vista Arabic ---------------------------------------------- ISSUES 1. [Status update] StackOverflowException when trying to execute IronPython code on x86 Vista Arabic http://ironpython.codeplex.com/workitem/24094 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at mcneel.com Mon Mar 12 17:03:08 2012 From: steve at mcneel.com (Steve Baer) Date: Mon, 12 Mar 2012 09:03:08 -0700 Subject: [Ironpython-users] IronPython hosting - providingsyntax highlighting (and intellisense?!) to customers In-Reply-To: <7737799D90E55E4BB9C9F7E40D161E110E3D65C9F3@VA3DIAXVS461.RED001.local> References: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1D00@ruby.vipac.com.au> <7737799D90E55E4BB9C9F7E40D161E110E3D65C9F3@VA3DIAXVS461.RED001.local> Message-ID: <843606A93FBB416ABF7612B0E1C4F5FB@mcneel.com> We use the code editor component that the SharpDevelop guys wrote. In general it works great, but there was plenty of work involved in getting it set up to work how you would expect for editing IronPython scripts. I probably would have tried Keith?s ActiPro had I known about it when I started writing the python editor for Rhino. -Steve Steve Baer Robert McNeel & Associates www.rhino3d.com python.rhino3d.com From: Keith Rome Sent: Monday, March 12, 2012 8:36 AM To: Nick Aschberger ; ironpython-users at python.org Subject: Re: [Ironpython-users] IronPython hosting - providingsyntax highlighting (and intellisense?!) to customers At risk of sounding like an advertisement, I strongly recommend the ActiPro SyntaxEditor controls. We have used the WPF and Silverlight versions with great success. It supports all of the features you mention (syntax highlighting, Intellisense, code completion scopes) and many more. They have a functional demo application with source code that exhibits all of those features. Performance is great (be sure to enable ambient background parsing). We even have it wired up so that after parsing/lexing, we take the python source and run it through the IronPython compiler using a custom ErrorListener, which is used to collect compilation errors that are then fed into the ParseData output. And since we have a ParseErrorTagger and custom SquiggleTooltipProvider installed into the parser, we get those nice red squiggles directly under compiler errors in the source text itself, along with detailed tooltips. Sorry if I get carried away, but it?s extremely cool stuff! Our python editing environment is very slick; while it does not quite have the features of Visual Studio?s editor, it comes really close (we even support breakpoints and stepping)? and it fully embeds in our WPF / Silverlight products. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | mailto:rome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Nick Aschberger Sent: Monday, March 12, 2012 7:35 AM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython hosting - providing syntax highlighting (and intellisense?!) to customers Hi All, We are intending to use IronPython to provide a simple expression engine to our customers. This will give them the ability to calculate some of their own results from data stored in the database. Being a software project, I say ?simple expression? but I can easily see it migrating towards a ?complex expression? when customers get more familiar with python. Now, I can just give them a text area to stick some text in, and maybe some tools to help build this text but? it seems like I should be able to do better than this, and it seems like something that others would have solved. I?d really like the UI that the customer uses to compose an expression to have python syntax highlighting to help them. Furthermore, if we make .NET objects/functions available to the python script, it would be fantastic if the user had some kind of intellisense available to help them when interacting with the types we would make available to the scripts to use. Any advice, or experience with this? Cheers Nick Aschberger -------------------------------------------------------------------------------- _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.munch at curie.fr Mon Mar 12 18:19:54 2012 From: daniel.munch at curie.fr (Daniel Munch) Date: Mon, 12 Mar 2012 18:19:54 +0100 Subject: [Ironpython-users] sys.version_info in 2.7.2 Message-ID: <4F5E303A.1080502@curie.fr> Hi, congratulations for the new IronPython release 2.7.2. I just updated from RC1 and unfortunatly it seems like there's some change of behaviour concerning sys.version_info. I got some 3rd party scripts which are stumbling over the line "sys.version_info < (2, 4): " which happily returns 'False' on RC1, but a NotImplemented Exception in 2.7.2. Could anybody please verify this? I just signed up to the mailing list just for this problem, so I don't now if for bug reports it's better to directly file an issue on Codeplex. Anyway, thanks for the good work so far, I really enjoy using IronPython in my every day work. Best Regards Daniel From nicka at Vipac.com.au Tue Mar 13 00:07:12 2012 From: nicka at Vipac.com.au (Nick Aschberger) Date: Tue, 13 Mar 2012 10:07:12 +1100 Subject: [Ironpython-users] IronPython hosting - providing syntaxhighlighting (and intellisense?!) to customers In-Reply-To: <7737799D90E55E4BB9C9F7E40D161E110E3D65C9F3@VA3DIAXVS461.RED001.local> References: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1D00@ruby.vipac.com.au> <7737799D90E55E4BB9C9F7E40D161E110E3D65C9F3@VA3DIAXVS461.RED001.local> Message-ID: <87AA9E2A041F3549ABF0A7A9E76CF0C901AD1D53@ruby.vipac.com.au> Thanks! I'll look into it. Cheers Nick From: Keith Rome [mailto:rome at Wintellect.com] Sent: Tuesday, 13 March 2012 2:06 AM To: Nick Aschberger; ironpython-users at python.org Subject: RE: [Ironpython-users] IronPython hosting - providing syntaxhighlighting (and intellisense?!) to customers At risk of sounding like an advertisement, I strongly recommend the ActiPro SyntaxEditor controls. We have used the WPF and Silverlight versions with great success. It supports all of the features you mention (syntax highlighting, Intellisense, code completion scopes) and many more. They have a functional demo application with source code that exhibits all of those features. Performance is great (be sure to enable ambient background parsing). We even have it wired up so that after parsing/lexing, we take the python source and run it through the IronPython compiler using a custom ErrorListener, which is used to collect compilation errors that are then fed into the ParseData output. And since we have a ParseErrorTagger and custom SquiggleTooltipProvider installed into the parser, we get those nice red squiggles directly under compiler errors in the source text itself, along with detailed tooltips. Sorry if I get carried away, but it's extremely cool stuff! Our python editing environment is very slick; while it does not quite have the features of Visual Studio's editor, it comes really close (we even support breakpoints and stepping)... and it fully embeds in our WPF / Silverlight products. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Nick Aschberger Sent: Monday, March 12, 2012 7:35 AM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython hosting - providing syntax highlighting (and intellisense?!) to customers Hi All, We are intending to use IronPython to provide a simple expression engine to our customers. This will give them the ability to calculate some of their own results from data stored in the database. Being a software project, I say "simple expression" but I can easily see it migrating towards a "complex expression" when customers get more familiar with python. Now, I can just give them a text area to stick some text in, and maybe some tools to help build this text but... it seems like I should be able to do better than this, and it seems like something that others would have solved. I'd really like the UI that the customer uses to compose an expression to have python syntax highlighting to help them. Furthermore, if we make .NET objects/functions available to the python script, it would be fantastic if the user had some kind of intellisense available to help them when interacting with the types we would make available to the scripts to use. Any advice, or experience with this? Cheers Nick Aschberger -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue Mar 13 04:45:44 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 12 Mar 2012 20:45:44 -0700 Subject: [Ironpython-users] sys.version_info in 2.7.2 In-Reply-To: <4F5E303A.1080502@curie.fr> References: <4F5E303A.1080502@curie.fr> Message-ID: On Mon, Mar 12, 2012 at 10:19 AM, Daniel Munch wrote: > Hi, > > congratulations for the new IronPython release 2.7.2. I just updated from > RC1 and unfortunatly it seems like there's some change of behaviour > concerning sys.version_info. I got some 3rd party scripts which are > stumbling over the line "sys.version_info < (2, 4): " which happily returns > 'False' on RC1, but a NotImplemented Exception in 2.7.2. Could anybody > please verify this? I just signed up to the mailing list just for this > problem, so I don't now if for bug reports it's better to directly file an > issue on Codeplex. First off, bugs are best on codeplex, because we can track them more easily. However, drawing attention to them on the list isn't a bad idea. Second, I think I know what caused this. (2,4) > sys.version_info works just fine. I made a last-minute fix that clearly broke stuff in a big way (it looks like https://github.com/IronLanguages/main/commit/f8cce37420838b8197f31eedb1e04ae3a2e102ac is the culprit). I'll check it out and spin an updated release as soon as I figure it out. - Jeff From slide.o.mix at gmail.com Tue Mar 13 05:10:17 2012 From: slide.o.mix at gmail.com (Slide) Date: Mon, 12 Mar 2012 21:10:17 -0700 Subject: [Ironpython-users] sys.version_info in 2.7.2 In-Reply-To: References: <4F5E303A.1080502@curie.fr> Message-ID: FYI, I filed an issue on this today as I ran into it while trying to get Trac working with IronPython. http://ironpython.codeplex.com/workitem/32400 slide On Mon, Mar 12, 2012 at 8:45 PM, Jeff Hardy wrote: > On Mon, Mar 12, 2012 at 10:19 AM, Daniel Munch > wrote: > > Hi, > > > > congratulations for the new IronPython release 2.7.2. I just updated from > > RC1 and unfortunatly it seems like there's some change of behaviour > > concerning sys.version_info. I got some 3rd party scripts which are > > stumbling over the line "sys.version_info < (2, 4): " which happily > returns > > 'False' on RC1, but a NotImplemented Exception in 2.7.2. Could anybody > > please verify this? I just signed up to the mailing list just for this > > problem, so I don't now if for bug reports it's better to directly file > an > > issue on Codeplex. > > First off, bugs are best on codeplex, because we can track them more > easily. However, drawing attention to them on the list isn't a bad > idea. > > Second, I think I know what caused this. (2,4) > sys.version_info > works just fine. I made a last-minute fix that clearly broke stuff in > a big way (it looks like > > https://github.com/IronLanguages/main/commit/f8cce37420838b8197f31eedb1e04ae3a2e102ac > is the culprit). I'll check it out and spin an updated release as soon > as I figure it out. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue Mar 13 07:56:00 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 12 Mar 2012 23:56:00 -0700 Subject: [Ironpython-users] IronPython 2.7.2.1 Released Message-ID: Because of issue #34002 that Daniel Munch and Alex Earl reported earlier today, IronPython 2.7.2.1 has replaced IronPython 2.7.2. Upgrading is recommended. - Jeff From slide.o.mix at gmail.com Tue Mar 13 08:04:28 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 13 Mar 2012 00:04:28 -0700 Subject: [Ironpython-users] setuptools In-Reply-To: References: Message-ID: It does not seem to work with distribute (it exits with a StackOverflowException). I'll dig into it a little more. slide On Wed, Mar 7, 2012 at 3:59 PM, Jeff Hardy wrote: > On Wed, Mar 7, 2012 at 2:54 PM, Slide wrote: > > Just as an FYI, I committed some fixes today that should allow > setuptools to > > be used with IronPython. I was able to bootstrap setuptools correctly > with > > these fixes. > > Can you try it with distribute (http://pypi.python.org/pypi/distribute) > as well? > > I gave pip a spin a little while back and it seemed to work fine after > I made some changes to tarfile. I just can't remember if I ever pushed > those changes... > > - Jeff > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cold_fusion at fastmail.fm Tue Mar 13 10:29:27 2012 From: cold_fusion at fastmail.fm (cold_fusion at fastmail.fm) Date: Tue, 13 Mar 2012 11:29:27 +0200 Subject: [Ironpython-users] Considering IronPython for a new project Message-ID: <1331630967.17063.140661048492365@webmail.messagingengine.com> Hello, We are considering IronPython for a new automation infrastructure project; it will not be used to write automated tests though. I wasn't aware that MS bailed on the Irons (back at 2010) until a few days ago, this will probably hurt my arguments, let alone other chatter on the web saying that nobody uses these languages aside from the former teams at MS. For now, the most compelling argument to use IPy over C# is convenience (not having to compile and distribute), although at the cost of few other people learning to use it. I know static compilation is over rated, but some think it?s very important, sadly I don?t remember being able to run PyChecker/PyLint/PyFlakes with IronPython, and since it?s going be using a lot of .net libraries I don?t see how I can use CPython to run those. Lastly, I?m concerned about future support, again for what I?ve managed to gather in the last few days. Can anyone please enlighten me on any of my points? Regards. -- http://www.fastmail.fm - A no graphics, no pop-ups email service From no_reply at codeplex.com Tue Mar 13 14:36:25 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 13 Mar 2012 06:36:25 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/12/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] IronPython 1.1: test_urllibnet.py failing 2. [Status update] (CPy) test_import.py fails with StackOverflow exception 3. [Status update] PythonErrorSink moves to IPy 4. [New comment] SyntaxError should be thrown when import 'parentmodule.submodule',but IronPython throw ValueError. 5. [New comment] foo.aspx.py can only has public access 6. [New comment] No connection to HTTPS 7. [Status update] Trivial: tempfile.NamedTemporaryFile(...).close() does not delete the temporary file 8. [Status update] got a different result for the same expression between IronPython and Cpython. 9. [New comment] "from import *" fails, causes KeyError 10. [Status update] Recent change caused a 37% degrade in the CrossLang\XLang Factorial (pytopy) benchmark 11. [Status update] HAPI : ScriptScope.GetVariable doesn't recognize explicit conversions. 12. [Status update] HAPI : ObjectOperations : Calling unbound class method fails 13. [New comment] Cannot install and run Django 14. [New comment] Tracking: Show the power/compatibility of IronPython by showing Trac running on IronPython 15. [Status update] Python code throws an exception when run executed from ScriptSource.Execute() 16. [New comment] Trivial: AttributeError: 'module' object has no attribute 'Incomplete' 17. [New comment] AttributeError: 'struct_time' object has no attribute 'n_fields' 18. [New comment] dir(ctypes.windll.kernel32.ReadProcessMemory) causes StackOverflowException 19. [New comment] dir(ctypes.windll.kernel32.ReadProcessMemory) causes StackOverflowException 20. [New comment] cannot import Sympy 21. [Status update] cannot import Sympy 22. [Status update] Trivial: Documentation Typo/Grammer 23. [Status update] Missing projects - build is broken right after download 24. [Status update] ImportError: No module named winsound 25. [New issue] sys.version_info < tuple doesn't work like CPython 26. [New comment] sys.version_info < tuple doesn't work like CPython 27. [New comment] NullReference bug report 28. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py 29. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py 30. [Status update] sys.version is incomplete in user created engine, creating problems in platform.py ---------------------------------------------- ISSUES 1. [Status update] IronPython 1.1: test_urllibnet.py failing http://ironpython.codeplex.com/workitem/24061 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works on 2.7.2"----------------- 2. [Status update] (CPy) test_import.py fails with StackOverflow exception http://ironpython.codeplex.com/workitem/24044 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Cannot reproduce"----------------- 3. [Status update] PythonErrorSink moves to IPy http://ironpython.codeplex.com/workitem/24036 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "No information on what this means."----------------- 4. [New comment] SyntaxError should be thrown when import 'parentmodule.submodule',but IronPython throw ValueError. http://ironpython.codeplex.com/workitem/23769 User slide_o_mix has commented on the issue: "Actually get a SyntaxError now, but a different error message., >>> import test.bad_coding File "D:\IronPython-2.7.2\Lib\test\bad_coding.py", line ? ^ SyntaxError: unknown encoding type"----------------- 5. [New comment] foo.aspx.py can only has public access http://ironpython.codeplex.com/workitem/25961 User slide_o_mix has commented on the issue: "Please upload a test case."----------------- 6. [New comment] No connection to HTTPS http://ironpython.codeplex.com/workitem/28660 User slide_o_mix has commented on the issue: "Please attach a test case."----------------- 7. [Status update] Trivial: tempfile.NamedTemporaryFile(...).close() does not delete the temporary file http://ironpython.codeplex.com/workitem/23936 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed in previous version"----------------- 8. [Status update] got a different result for the same expression between IronPython and Cpython. http://ironpython.codeplex.com/workitem/23783 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed in previous version."----------------- 9. [New comment] "from import *" fails, causes KeyError http://ironpython.codeplex.com/workitem/31305 User slide_o_mix has commented on the issue: "This still exists on 2.7.2"----------------- 10. [Status update] Recent change caused a 37% degrade in the CrossLang\XLang Factorial (pytopy) benchmark http://ironpython.codeplex.com/workitem/24097 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Not able to reproduce."----------------- 11. [Status update] HAPI : ScriptScope.GetVariable doesn't recognize explicit conversions. http://ironpython.codeplex.com/workitem/24075 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Duplicate of [workitem:24074]"----------------- 12. [Status update] HAPI : ObjectOperations : Calling unbound class method fails http://ironpython.codeplex.com/workitem/24151 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "No way to reproduce."----------------- 13. [New comment] Cannot install and run Django http://ironpython.codeplex.com/workitem/20939 User slide_o_mix has commented on the issue: "I was able to install Django, but still get errors when trying to run a simple site: :1: DeprecationWarning: object.__init__() takes no parameters for type K eyedRef Traceback (most recent call last): File "D:\IronPython-2.7.2\lib\site-packages\django\core\management\__init__.py ", line 438, in execute_manager File "D:\IronPython-2.7.2\lib\site-packages\django\core\management\__init__.py ", line 379, in execute File "D:\IronPython-2.7.2\lib\site-packages\django\core\management\__init__.py ", line 261, in fetch_command File "D:\IronPython-2.7.2\lib\site-packages\django\core\management\__init__.py ", line 67, in load_command_class File "D:\IronPython-2.7.2\lib\site-packages\django\contrib\staticfiles\managem ent\commands\runserver.py", line 4, in File "D:\IronPython-2.7.2\lib\site-packages\django\core\management\commands\ru nserver.py", line 8, in File "D:\IronPython-2.7.2\lib\site-packages\django\core\handlers\wsgi.py", lin e 10, in File "D:\IronPython-2.7.2\lib\site-packages\django\http\__init__.py", line 123 , in File "D:\IronPython-2.7.2\lib\site-packages\django\http\multipartparser.py", l ine 13, in File "D:\IronPython-2.7.2\lib\site-packages\django\utils\text.py", line 134, i n File "D:\IronPython-2.7.2\lib\site-packages\django\utils\functional.py", line 158, in __init__ File "manage.py", line 14, in File "D:\IronPython-2.7.2\lib\site-packages\django\utils\importlib.py", line 3 5, in import_module File "D:\IronPython-2.7.2\lib\site-packages\django\utils\functional.py", line 240, in __wrapper__ File "D:\IronPython-2.7.2\lib\site-packages\django\utils\functional.py", line 180, in __prepare_class__ AssertionError: Cannot call lazy() with both str and unicode return types."----------------- 14. [New comment] Tracking: Show the power/compatibility of IronPython by showing Trac running on IronPython http://ironpython.codeplex.com/workitem/9197 User slide_o_mix has commented on the issue: "See [workitem:32400] for one issue found during install."----------------- 15. [Status update] Python code throws an exception when run executed from ScriptSource.Execute() http://ironpython.codeplex.com/workitem/24062 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "No way to reproduce."----------------- 16. [New comment] Trivial: AttributeError: 'module' object has no attribute 'Incomplete' http://ironpython.codeplex.com/workitem/23808 User slide_o_mix has commented on the issue: "Difference is now as below. IronPython 2.7.2 (2.7.0.40) on .NET 4.0.30319.17020 (64-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import binascii >>> binascii.Incomplete.__doc__ '' >>> binascii.Incomplete >>> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import binascii >>> binascii.Incomplete.__doc__ >>> binascii.Incomplete >>> "----------------- 17. [New comment] AttributeError: 'struct_time' object has no attribute 'n_fields' http://ironpython.codeplex.com/workitem/23861 User slide_o_mix has commented on the issue: "Fixed in 8a41d67"----------------- 18. [New comment] dir(ctypes.windll.kernel32.ReadProcessMemory) causes StackOverflowException http://ironpython.codeplex.com/workitem/28942 User slide_o_mix has commented on the issue: "This still exists on 2.7.2"----------------- 19. [New comment] dir(ctypes.windll.kernel32.ReadProcessMemory) causes StackOverflowException http://ironpython.codeplex.com/workitem/28942 User slide_o_mix has commented on the issue: "It gets stuck in a recursive loop in PythonType.TryGetCustomDir"----------------- 20. [New comment] cannot import Sympy http://ironpython.codeplex.com/workitem/30528 User slide_o_mix has commented on the issue: "This works for me with IP2.7.2 and sympy 0.7.1 IronPython 2.7.2 (2.7.0.40) on .NET 4.0.30319.17020 (64-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import sympy >>>"----------------- 21. [Status update] cannot import Sympy http://ironpython.codeplex.com/workitem/30528 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Works in 2.7.2"----------------- 22. [Status update] Trivial: Documentation Typo/Grammer http://ironpython.codeplex.com/workitem/10084 User slide_o_mix has updated the issue: Status has changed from Active to Closed. ----------------- 23. [Status update] Missing projects - build is broken right after download http://ironpython.codeplex.com/workitem/28658 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "No missing project files in 2.7"----------------- 24. [Status update] ImportError: No module named winsound http://ironpython.codeplex.com/workitem/23879 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Duplicate of 21405"----------------- 25. [New issue] sys.version_info < tuple doesn't work like CPython http://ironpython.codeplex.com/workitem/32400 User slide_o_mix has proposed the issue: "In the Trac installer it has the following code which works in CPython, but not IronPython min_python = (2,4) if sys.version_info < min_python: print "Trac requires Python %d.%d or later" % min_python This evaluates to False on IronPython and True on CPython CPython: >>> import sys >>> min_python = (2,4) >>> if sys.version_info < min_python: ... print "You fail" ... >>> IronPython: IronPython 2.7.2 (2.7.0.40) on .NET 4.0.30319.17020 (64-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> min_python = (2,4) >>> if sys.version_info < min_python: ... print "You fail" ... You fail >>>"----------------- 26. [New comment] sys.version_info < tuple doesn't work like CPython http://ironpython.codeplex.com/workitem/32400 User jdhardy has commented on the issue: "This was introduced in f8cce37 and fixed in 4a76497. Whoops."----------------- 27. [New comment] NullReference bug report http://ironpython.codeplex.com/workitem/31621 User slide_o_mix has commented on the issue: "Please attach a test case."----------------- 28. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User adal has commented on the issue: "This still fails in IronPython 2.7.2. Try running the code sample from above in it."----------------- 29. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User jdhardy has commented on the issue: "Released in IronPython 2.7.2 ** Closed by jdhardy 3/9/2012 11:51 PM"----------------- 30. [Status update] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User adal has updated the issue: Status has changed from Closed to Proposed with the following comment, "This still fails in IronPython 2.7.2. Try running the code sample from above in it. " ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lady_radsu at yahoo.com Wed Mar 14 02:18:16 2012 From: lady_radsu at yahoo.com (surangika ranathunga) Date: Tue, 13 Mar 2012 18:18:16 -0700 (PDT) Subject: [Ironpython-users] (no subject) Message-ID: <1331687896.84267.YahooMailNeo@web122206.mail.ne1.yahoo.com> Hi All, I am using Ironpython (2.7)? to call a python script from my C# console application. The code executes fine. But when I try to terminate the console by clicking 'X' , I get the below error message: --------------------------- Intel(r) Visual Fortran run-time error --------------------------- forrtl: error (200): program aborting due to window-CLOSE event Image????????????? PC??????? Routine??????????? Line??????? Source???????????? linalg.DLL???????? 0B17D91A? Unknown?????????????? Unknown? Unknown linalg.DLL???????? 0B17B0F8? Unknown?????????????? Unknown? Unknown linalg.DLL???????? 0B166B04? Unknown?????????????? Unknown? Unknown linalg.DLL???????? 0B16C608? Unknown?????????????? Unknown? Unknown KERNEL32.dll?????? 7C87655C? Unknown?????????????? Unknown? Unknown KERNEL32.dll?????? 7C80B729? Unknown?????????????? Unknown? Unknown --------------------------- OK?? --------------------------- This is how I call the python code in my C# file: ??? ??? ??? private ObjectOperations ops; ???????????private object method; ??? ??? ??? var lang = Python.CreateLanguageSetup(null); ??????????? lang.Options["Frames"] = ScriptingRuntimeHelpers.True; ??????????? var setup = new ScriptRuntimeSetup(); ??????????? setup.LanguageSetups.Add(lang); ??????????? var runtime = new ScriptRuntime(setup); ??????????? var engine = runtime.GetEngine("py"); ??????????? ScriptScope scope = runtime.CreateScope(); ??????????? ops = engine.Operations; ??? ??? ??? ??? ??? ??? ScriptSource source = engine.CreateScriptSourceFromFile("nlp.py"); ??????????? source.Execute(scope); ????????? ? object[] parameters = new object[1]; ??????????? object klass = scope.GetVariable("nlp"); ??????????? object instance = ops.Invoke(klass); ??????????? method = ops.GetMember(instance, "create_classifier"); ?????????? object output = ops.Invoke(method); What am I doing wrong here? Can somebody help me out? /Sura -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Mar 14 02:32:33 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 13 Mar 2012 18:32:33 -0700 Subject: [Ironpython-users] (no subject) In-Reply-To: <1331687896.84267.YahooMailNeo@web122206.mail.ne1.yahoo.com> References: <1331687896.84267.YahooMailNeo@web122206.mail.ne1.yahoo.com> Message-ID: If you remove IronPython from the app and do the same thing, do you still get the error? I've never seen that error before. On Mar 13, 2012 6:21 PM, "surangika ranathunga" wrote: > Hi All, > I am using Ironpython (2.7) to call a python script from my C# console > application. The code executes fine. But when I try to terminate the > console by clicking 'X' , I get the below error message: > --------------------------- > Intel(r) Visual Fortran run-time error > --------------------------- > forrtl: error (200): program aborting due to window-CLOSE event > > Image PC Routine Line > Source > linalg.DLL 0B17D91A Unknown Unknown Unknown > linalg.DLL 0B17B0F8 Unknown Unknown Unknown > linalg.DLL 0B166B04 Unknown Unknown Unknown > linalg.DLL 0B16C608 Unknown Unknown Unknown > KERNEL32.dll 7C87655C Unknown Unknown Unknown > KERNEL32.dll 7C80B729 Unknown Unknown Unknown > > --------------------------- > OK > --------------------------- > > This is how I call the python code in my C# file: > private ObjectOperations ops; > private object method; > > var lang = Python.CreateLanguageSetup(null); > lang.Options["Frames"] = ScriptingRuntimeHelpers.True; > var setup = new ScriptRuntimeSetup(); > setup.LanguageSetups.Add(lang); > var runtime = new ScriptRuntime(setup); > var engine = runtime.GetEngine("py"); > > ScriptScope scope = runtime.CreateScope(); > ops = engine.Operations; > > ScriptSource source = > engine.CreateScriptSourceFromFile("nlp.py"); > source.Execute(scope); > object[] parameters = new object[1]; > object klass = scope.GetVariable("nlp"); > object instance = ops.Invoke(klass); > method = ops.GetMember(instance, "create_classifier"); > object output = ops.Invoke(method); > > What am I doing wrong here? Can somebody help me out? > /Sura > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Mar 14 04:53:17 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 13 Mar 2012 20:53:17 -0700 Subject: [Ironpython-users] __future__.py Message-ID: Jeff or Dino (or anyone else who might knows), Is there any specific reason we aren't using the __future__.py directly from the stdlib? I ran into an issue today with doctest when it was extracting future flags, nested_scopes was not defined in the __future__.py that is located at Languages/IronPython/IronPython/Lib It IS the correct __future__.py in the External.LCA_RESTRICTED/Languages/IronPython/27/Lib version though. When I copied the version from there to the other location, doctest ran correctly, so I was just wondering if there was something else that required a different __future__.py. Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sven.Thomas at prov.ca Wed Mar 14 17:54:33 2012 From: Sven.Thomas at prov.ca (Sven Thomas) Date: Wed, 14 Mar 2012 11:54:33 -0500 Subject: [Ironpython-users] DataSet --> SQLite In-Reply-To: References: Message-ID: Greetings all, I'm sort of new to IP and brand new on this mailing list. J Here's my situation: I need to build a report of everything missing from our institution's library that isn't accounted for (i.e. we want to find what's been stolen/lost, etc.) That means the librarians will scan every item to build a table in SQLite ("LibTBL") - this portion of the code is already working. To build the report, I need to compare LibTBL (physical items in the library) to the records on the server. My plan is to pull every record from the server (nearly 100k+) into an SQLite table ("ServerTBL") so I can run queries from one table against the other (LibTBL vs. ServerTBL. The end result of this will be a third table that contains only the items on the server that were not scanned in the library. These are the items that are either checked out or missing. What's the best way to go about this? So far I'm using System.Data.SQLite oracle's ADO.NET connector and I'm pulling a table from Oracle to a .Net dataset. I can fill the DataSet with the table from Oracle, but my attempts at using the SQLite data adapter to put into the SQLite db have failed. How would I go about dumping a dataset into an SQLite file? Any help or direction would be greatly appreciated. Thanks, Sven -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Mar 14 18:07:13 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 14 Mar 2012 17:07:13 +0000 Subject: [Ironpython-users] __future__.py In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D51DCC@TK5EX14MBXC293.redmond.corp.microsoft.com> The historic reason is that we supported running both w/ the std lib and without. I don't think that's really a concern so the fake __future__ could be replaced with the real one from the std lib. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Slide Sent: Tuesday, March 13, 2012 8:53 PM To: ironpython-users at python.org Subject: [Ironpython-users] __future__.py Jeff or Dino (or anyone else who might knows), Is there any specific reason we aren't using the __future__.py directly from the stdlib? I ran into an issue today with doctest when it was extracting future flags, nested_scopes was not defined in the __future__.py that is located at Languages/IronPython/IronPython/Lib It IS the correct __future__.py in the External.LCA_RESTRICTED/Languages/IronPython/27/Lib version though. When I copied the version from there to the other location, doctest ran correctly, so I was just wondering if there was something else that required a different __future__.py. Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Mar 14 18:35:05 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 14 Mar 2012 10:35:05 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/13/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] sys.version_info < tuple doesn't work like CPython 2. [New issue] ctypes: wrong value returned for c_char_Array 3. [New comment] NullReference bug report 4. [New comment] NullReference bug report 5. [New comment] NullReference bug report 6. [New comment] Cannot install and run Django 7. [New comment] Could not get dependencies for project reference 'PythonLibrary1' 8. [New comment] Create a FULLY StandAlone ".exe" binary? 9. [New comment] Implement memoryview type ---------------------------------------------- ISSUES 1. [Status update] sys.version_info < tuple doesn't work like CPython http://ironpython.codeplex.com/workitem/32400 User slide_o_mix has updated the issue: Status has changed from Fixed to Closed with the following comment, "Verified as fixed in 2.7.2.1"----------------- 2. [New issue] ctypes: wrong value returned for c_char_Array http://ironpython.codeplex.com/workitem/32401 User ergorion has proposed the issue: "IronPython has an incompatibility regarding ctypes. When accessing an c_char_Array, IronPython immediately returns the value of the array as a string, whereas cpython returns the object; in order to access the string, one needs to dereference the string via .value Example: Imagine the following definition for ctypes: ARNameType = c_char * 255 class ARNameList(Structure): _fields_ = [ # ar.h 329 ('numItems', c_uint), ('nameList', POINTER(ARNameType)), ] The variable result holds such an ARNameList. CPython: >>> result >>> result.nameList <__main__.LP_c_char_Array_255 object at 0x029D69E0> >>> result.nameList[0] <__main__.c_char_Array_255 object at 0x029D6C60> >>> result.nameList[0].value 'Distributed Mapping' IronPython: >>> result >>> result.nameList >>> result.nameList[0] 'Distributed Mapping'"----------------- 3. [New comment] NullReference bug report http://ironpython.codeplex.com/workitem/31621 User jdhardy has commented on the issue: "Doesn't really need a test case; I can see from reading it that it'll break. Easy enough to fix though."----------------- 4. [New comment] NullReference bug report http://ironpython.codeplex.com/workitem/31621 User jdhardy has commented on the issue: "Doesn't really need a test case; I can see from reading it that it'll break. Easy enough to fix though."----------------- 5. [New comment] NullReference bug report http://ironpython.codeplex.com/workitem/31621 User slide_o_mix has commented on the issue: "Yeah, I was going through about 800 issues that day and probably got confused on which one I was looking at. :-)"----------------- 6. [New comment] Cannot install and run Django http://ironpython.codeplex.com/workitem/20939 User jdhardy has commented on the issue: "I have a handful of fixes for Django at https://bitbucket.org/jdhardy/django-ipy-patches; some of them are probably still applicable. In particular, this error is fixed by https://bitbucket.org/jdhardy/django-ipy-patches/changeset/9f88008c5d72#chg-fix-lazy-with-str-and-unicode."----------------- 7. [New comment] Could not get dependencies for project reference 'PythonLibrary1' http://ironpython.codeplex.com/workitem/10245 User slide_o_mix has commented on the issue: "Did you ever resolve this issue?"----------------- 8. [New comment] Create a FULLY StandAlone ".exe" binary? http://ironpython.codeplex.com/workitem/20621 User slide_o_mix has commented on the issue: "You can now create a standalone executable, but it will still require the .NET framework. I don't think generating a COMPLETELY standalone will ever happen."----------------- 9. [New comment] Implement memoryview type http://ironpython.codeplex.com/workitem/28311 User slide_o_mix has commented on the issue: "memoryview is implemented but has some compatibility issues." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Wed Mar 14 23:34:59 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 14 Mar 2012 16:34:59 -0600 Subject: [Ironpython-users] DataSet --> SQLite In-Reply-To: References: Message-ID: I would suggest opening both databases in their native form, then do the comparison using Python code rather than a complex SQL query. It may take a while to run, but should work okay. SQLite select statements are quite fast. Trying to do the whole thing in one swallow may be too much. Better to do lots of querys sequentially and build your result set as you go. On Mar 14, 2012 10:55 AM, "Sven Thomas" wrote: > Greetings all,**** > > ** ** > > I?m sort of new to IP and brand new on this mailing list. J **** > > ** ** > > Here?s my situation: I need to build a report of everything missing from > our institution's library that isn't accounted for (i.e. we want to find > what's been stolen/lost, etc.) That means the librarians will scan every > item to build a table in SQLite ("LibTBL") - this portion of the code is > already working. To build the report, I need to compare LibTBL (physical > items in the library) to the records on the server. > > My plan is to pull every record from the server (nearly 100k+) into an > SQLite table ("ServerTBL") so I can run queries from one table against the > other (LibTBL vs. ServerTBL. The end result of this will be a third table > that contains only the items on the server that were not scanned in the > library. These are the items that are either checked out or missing. > > What's the best way to go about this? So far I?m using System.Data.SQLite > oracle?s ADO.NET connector and I?m pulling a table from Oracle to a .Net > dataset. I can fill the DataSet with the table from Oracle, but my > attempts at using the SQLite data adapter to put into the SQLite db have > failed. How would I go about dumping a dataset into an SQLite file? > > Any help or direction would be greatly appreciated. > > Thanks,**** > > ** ** > > Sven**** > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddewaleffe at gmail.com Thu Mar 15 08:49:36 2012 From: ddewaleffe at gmail.com (Dominique de Waleffe) Date: Thu, 15 Mar 2012 08:49:36 +0100 Subject: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe Message-ID: I am not sure whether this should be expected to work or not, nor if I am using this correctly... I tried to generate a standalone exe for a tool I have (3 modules) but it bombs out at startup with: Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No module named os at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode $functionCode) at IronPython.Compiler.OnDiskScriptCode.Run() at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, String fullName) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) I can reproduce with this simple foo.py module # foo.py import os print "Hello" print "OS:",os.name print "Bye" #end foo.py which I compile with the following: ipy -m pyc /standalone /main:foo.py /target:exe /out:foo or ipy -m pyc /main:foo.py /target:exe /out:foo2 Starting either foo.exe or foo2.exe fails with above error. If I remove the import os and the line that uses on.name, I get an executable that works... Is this a bug or a misunderstanding in what I expect to work? If so what are the correct steps? Thanks for your help D. ############################ # Dominique de Waleffe # ddewaleffe -at- gmail -dot- com # domi -at- dewaleffe -dot- org ############################ -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Mar 15 13:29:00 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 15 Mar 2012 05:29:00 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/14/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] ast module is broken - TypeError: object.__new__() takes no parameters 2. [New issue] ironpython pdb throwing exception (broken in 2.7) 3. [New comment] Iron Python can't execute SPARK-0.6.1 package 4. [Status update] Iron Python can't execute SPARK-0.6.1 package 5. [Status update] Integrate Vendor's IronPython Sample Tests into Rowan Test Suite 6. [Status update] doctest support in cpython regression ---------------------------------------------- ISSUES 1. [New issue] ast module is broken - TypeError: object.__new__() takes no parameters http://ironpython.codeplex.com/workitem/32408 User paweljasinski has proposed the issue: "When trying to use IPython I have discovered that ast module have fundamental problem. It appears to throw the exception whenever a non empty argument is provided. I can only suspect it is a left over from 2.6 -> 2.7 migration. steps to reproduce: import ast ast.Num(5,lineno=0,col_offset=0) And a snapshot of my session: $ /c/Program\ Files/IronPython\ 2.7/ipy.exe IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import ast >>> ast.Num(5, lineno=0, col_offset=0) Traceback (most recent call last): File "", line 1, in TypeError: object.__new__() takes no parameters >>> The ast.Num(5,lineno=0,col_offset=0) is taken out of module documentation and works in cpython"----------------- 2. [New issue] ironpython pdb throwing exception (broken in 2.7) http://ironpython.codeplex.com/workitem/32412 User py_sunil has proposed the issue: "issuing the following command is throwing exception ipy "c:\Ironpython 2.7\Lib\pdb.py" "C:\netipywork\demostringbuilder.py" output -------- C:\IronPython 2.7>ipy "c:\Ironpython 2.7\Lib\pdb.py" "C:\netipywork\demostringbuilder.py" Traceback (most recent call last): File "c:\Ironpython 2.7\Lib\pdb.py", line 1314, in main pdb._runscript(mainpyfile) File "c:\Ironpython 2.7\Lib\pdb.py", line 1233, in _runscript self.run(statement) File "c:\Ironpython 2.7\Lib\bdb.py", line 387, in run exec cmd in globals, locals File "", line 1, in IOError: System.IO.IOException: execfile: specified file doesn't exist at Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value) at Microsoft.Scripting.Interpreter.FuncCallInstruction`2.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at IronPython.Compiler.PythonCallTargets.OriginalCallTarget4(PythonFunction function, Object arg0, Object arg1, Objec t arg2, Object arg3) at IronPython.Runtime.PythonFunction.FunctionCaller`2.Default2Call2(CallSite site, CodeContext context, Object func, T0 arg0, T1 arg1) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 ar g3) at IronPython.Runtime.PythonFunction.FunctionCaller`2.Call2(CallSite site, CodeContext context, Object func, T0 arg0, T1 arg1) at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.PythonFunction.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) at IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(PythonFunction function, Object arg0, Object arg1) at IronPython.Runtime.PythonFunction.FunctionCaller`2.Call2(CallSite site, CodeContext context, Object func, T0 arg0, T1 arg1) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 ar g3) at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > (1)() (Pdb)"----------------- 3. [New comment] Iron Python can't execute SPARK-0.6.1 package http://ironpython.codeplex.com/workitem/13749 User slide_o_mix has commented on the issue: "I was able to run the example from SPARK-0.6.1 with 2.7.2.1 with the following ipy64 main.py main.py Please update if there is a different test case."----------------- 4. [Status update] Iron Python can't execute SPARK-0.6.1 package http://ironpython.codeplex.com/workitem/13749 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works in 2.7.2.1"----------------- 5. [Status update] Integrate Vendor's IronPython Sample Tests into Rowan Test Suite http://ironpython.codeplex.com/workitem/24034 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce outside MS"----------------- 6. [Status update] doctest support in cpython regression http://ironpython.codeplex.com/workitem/23988 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce outside MS" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mchalkley at mail.com Thu Mar 15 13:42:14 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Thu, 15 Mar 2012 08:42:14 -0400 Subject: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe In-Reply-To: References: Message-ID: <167784982.20120315084214@mail.com> An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Thu Mar 15 15:24:20 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 15 Mar 2012 07:24:20 -0700 Subject: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe In-Reply-To: <167784982.20120315084214@mail.com> References: <167784982.20120315084214@mail.com> Message-ID: There is no need to use the CPython stdlib, the IP installer comes with a stdlib that has some mods for it to work better. Check the Lib directory where you installed IP. Also, you can set IRONPYTHONPATH to have it find things. On Mar 15, 2012 5:49 AM, wrote: > Thursday, March 15, 2012, 3:49:36 AM, you wrote: > > > I am not sure whether this should be expected to work or not, nor if I > am using this correctly... > > I tried to generate a standalone exe for a tool I have (3 modules) but it > bombs out at startup with: > > Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No > module named os > at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode > $functionCode) > at IronPython.Compiler.OnDiskScriptCode.Run() > at IronPython.Runtime.PythonContext.InitializeModule(String fileName, > ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) > at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, > String fullName) > at > Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame > frame) > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) > at > Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, > T1 arg1, T2 arg2, T3 arg3) > > I can reproduce with this simple foo.py module > > # foo.py > import os > print "Hello" > print "OS:",os.name > print "Bye" > #end foo.py > > which I compile with the following: > > ipy -m pyc /standalone /main:foo.py /target:exe /out:foo > or > ipy -m pyc /main:foo.py /target:exe /out:foo2 > > Starting either foo.exe or foo2.exe fails with above error. > > If I remove the import os and the line that uses on.name, I get an > executable that works... > > Is this a bug or a misunderstanding in what I expect to work? > If so what are the correct steps? > > Thanks for your help > > D. > > ############################ > # Dominique de Waleffe > # ddewaleffe -at- gmail -dot- com > # domi -at- dewaleffe -dot- org > ############################ > > I'll try to help, since I got a lot of help with something similar > recently. Congratulations - you got further before asking for help than I > did... > > It seems that you don't have the path to your CPython directory in your > environment variables. I thought installing IronPython automatically set > those variables, but maybe CPython got moved or something? In any case, > you can add it like this: > > import sys > sys.path.append(r"c:\python24\lib") > > And if you plan on distributing the exe to another machine that doesn't > have CPython installed, you need to put a copy of all the modules your > script needs in a zip file located in the same directory as the exe and put > the line > > sys.path.append('zipfile.zip') > > in your script before importing those modules... > > Mark > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddewaleffe at gmail.com Thu Mar 15 16:16:24 2012 From: ddewaleffe at gmail.com (Dominique de Waleffe) Date: Thu, 15 Mar 2012 16:16:24 +0100 Subject: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe In-Reply-To: References: <167784982.20120315084214@mail.com> Message-ID: Will try your suggestion and I will also spend a bit of time to construct the list of needed dependencies so that pyc can do a better job... Will also file an issue later on today. D. ############################ # Dominique de Waleffe # ddewaleffe -at- gmail -dot- com # domi -at- dewaleffe -dot- org ############################ On Thu, Mar 15, 2012 at 3:24 PM, Slide wrote: > There is no need to use the CPython stdlib, the IP installer comes with a > stdlib that has some mods for it to work better. Check the Lib directory > where you installed IP. Also, you can set IRONPYTHONPATH to have it find > things. > On Mar 15, 2012 5:49 AM, wrote: > >> Thursday, March 15, 2012, 3:49:36 AM, you wrote: >> >> >> I am not sure whether this should be expected to work or not, nor if I >> am using this correctly... >> >> I tried to generate a standalone exe for a tool I have (3 modules) but it >> bombs out at startup with: >> >> Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No >> module named os >> at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode >> $functionCode) >> at IronPython.Compiler.OnDiskScriptCode.Run() >> at IronPython.Runtime.PythonContext.InitializeModule(String fileName, >> ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) >> at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, >> String fullName) >> at >> Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame >> frame) >> at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame >> frame) >> at >> Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, >> T1 arg1, T2 arg2, T3 arg3) >> >> I can reproduce with this simple foo.py module >> >> # foo.py >> import os >> print "Hello" >> print "OS:",os.name >> print "Bye" >> #end foo.py >> >> which I compile with the following: >> >> ipy -m pyc /standalone /main:foo.py /target:exe /out:foo >> or >> ipy -m pyc /main:foo.py /target:exe /out:foo2 >> >> Starting either foo.exe or foo2.exe fails with above error. >> >> If I remove the import os and the line that uses on.name, I get an >> executable that works... >> >> Is this a bug or a misunderstanding in what I expect to work? >> If so what are the correct steps? >> >> Thanks for your help >> >> D. >> >> ############################ >> # Dominique de Waleffe >> # ddewaleffe -at- gmail -dot- com >> # domi -at- dewaleffe -dot- org >> ############################ >> >> I'll try to help, since I got a lot of help with something similar >> recently. Congratulations - you got further before asking for help than I >> did... >> >> It seems that you don't have the path to your CPython directory in your >> environment variables. I thought installing IronPython automatically set >> those variables, but maybe CPython got moved or something? In any case, >> you can add it like this: >> >> import sys >> sys.path.append(r"c:\python24\lib") >> >> And if you plan on distributing the exe to another machine that doesn't >> have CPython installed, you need to put a copy of all the modules your >> script needs in a zip file located in the same directory as the exe and put >> the line >> >> sys.path.append('zipfile.zip') >> >> in your script before importing those modules... >> >> Mark >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Thu Mar 15 16:40:02 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 15 Mar 2012 08:40:02 -0700 Subject: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe In-Reply-To: References: <167784982.20120315084214@mail.com> Message-ID: I also need to add in a try/catch around the call to the Python module and output better error messages. :-) On Thu, Mar 15, 2012 at 8:16 AM, Dominique de Waleffe wrote: > > Will try your suggestion and I will also spend a bit of time to construct > the list of needed dependencies so that pyc can do a better job... > > Will also file an issue later on today. > > > D. > ############################ > # Dominique de Waleffe > # ddewaleffe -at- gmail -dot- com > # domi -at- dewaleffe -dot- org > ############################ > > > On Thu, Mar 15, 2012 at 3:24 PM, Slide wrote: > >> There is no need to use the CPython stdlib, the IP installer comes with a >> stdlib that has some mods for it to work better. Check the Lib directory >> where you installed IP. Also, you can set IRONPYTHONPATH to have it find >> things. >> On Mar 15, 2012 5:49 AM, wrote: >> >>> Thursday, March 15, 2012, 3:49:36 AM, you wrote: >>> >>> >>> I am not sure whether this should be expected to work or not, nor if I >>> am using this correctly... >>> >>> I tried to generate a standalone exe for a tool I have (3 modules) but >>> it bombs out at startup with: >>> >>> Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No >>> module named os >>> at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode >>> $functionCode) >>> at IronPython.Compiler.OnDiskScriptCode.Run() >>> at IronPython.Runtime.PythonContext.InitializeModule(String fileName, >>> ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) >>> at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, >>> String fullName) >>> at >>> Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame >>> frame) >>> at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame >>> frame) >>> at >>> Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, >>> T1 arg1, T2 arg2, T3 arg3) >>> >>> I can reproduce with this simple foo.py module >>> >>> # foo.py >>> import os >>> print "Hello" >>> print "OS:",os.name >>> print "Bye" >>> #end foo.py >>> >>> which I compile with the following: >>> >>> ipy -m pyc /standalone /main:foo.py /target:exe /out:foo >>> or >>> ipy -m pyc /main:foo.py /target:exe /out:foo2 >>> >>> Starting either foo.exe or foo2.exe fails with above error. >>> >>> If I remove the import os and the line that uses on.name, I get an >>> executable that works... >>> >>> Is this a bug or a misunderstanding in what I expect to work? >>> If so what are the correct steps? >>> >>> Thanks for your help >>> >>> D. >>> >>> ############################ >>> # Dominique de Waleffe >>> # ddewaleffe -at- gmail -dot- com >>> # domi -at- dewaleffe -dot- org >>> ############################ >>> >>> I'll try to help, since I got a lot of help with something similar >>> recently. Congratulations - you got further before asking for help than I >>> did... >>> >>> It seems that you don't have the path to your CPython directory in your >>> environment variables. I thought installing IronPython automatically set >>> those variables, but maybe CPython got moved or something? In any case, >>> you can add it like this: >>> >>> import sys >>> sys.path.append(r"c:\python24\lib") >>> >>> And if you plan on distributing the exe to another machine that doesn't >>> have CPython installed, you need to put a copy of all the modules your >>> script needs in a zip file located in the same directory as the exe and put >>> the line >>> >>> sys.path.append('zipfile.zip') >>> >>> in your script before importing those modules... >>> >>> Mark >>> >>> _______________________________________________ >>> Ironpython-users mailing list >>> Ironpython-users at python.org >>> http://mail.python.org/mailman/listinfo/ironpython-users >>> >>> > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug.blank at gmail.com Fri Mar 16 02:22:12 2012 From: doug.blank at gmail.com (Doug Blank) Date: Thu, 15 Mar 2012 21:22:12 -0400 Subject: [Ironpython-users] Passing an IronPython function to C# Message-ID: I am attempting to pass an IronPython function into the following C# functions, which I import into IronPython: public static Func getFunc1(params Func [] functions) { return functions[0]; } public static Func getFunc2(IList> functions) { return functions[0]; } The first works fine: python>>> Myro.getFunc1(test1) ? Ok But the second gives the following error: python>>> Myro.getFunc2([test1]) Traceback (most recent call last): File "", line 1, in TypeError: Unable to cast object of type 'IronPython.Runtime.PythonFunction' to type 'System.Func`1[System.Object]'. What am I missing in the second case that prevents the cast? Thanks for any pointers, -Doug From hfoffani at gmail.com Fri Mar 16 11:33:10 2012 From: hfoffani at gmail.com (=?iso-8859-1?Q?Hern=E1n_Foffani?=) Date: Fri, 16 Mar 2012 11:33:10 +0100 Subject: [Ironpython-users] standard lib: pyc or zip it? Message-ID: Hi, Say I want to distribute a smaller (in quantity of files) Python standard library. What would you recommend? Pyc the whole library to build a DLL or just zip it? Are there any performance difference between the two? Any other alternative or best practice? Regards, Hern?n. From doug.blank at gmail.com Fri Mar 16 12:24:46 2012 From: doug.blank at gmail.com (Doug Blank) Date: Fri, 16 Mar 2012 07:24:46 -0400 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: Message-ID: On Thu, Mar 15, 2012 at 9:22 PM, Doug Blank wrote: > I am attempting to pass an IronPython function into the following C# > functions, which I import into IronPython: > > ? ? ? ?public static Func getFunc1(params Func [] functions) { > ? ? ? ? ? ? ? ?return functions[0]; > ? ? ? ?} > > ? ? ? ?public static Func getFunc2(IList> functions) { > ? ? ? ? ? ? ? ?return functions[0]; > ? ? ? ?} > > The first works fine: > > python>>> Myro.getFunc1(test1) > ? Culture=neutral, PublicKeyToken=b77a5c561934e089]] object at > 0x000000000000002B [System.Func`1[System.Object]]> > Ok > > But the second gives the following error: > > python>>> Myro.getFunc2([test1]) > Traceback (most recent call last): > ?File "", line 1, in > TypeError: Unable to cast object of type > 'IronPython.Runtime.PythonFunction' to type > 'System.Func`1[System.Object]'. > > What am I missing in the second case that prevents the cast? > > Thanks for any pointers, This is looking more and more like a bug. I see from http://stackoverflow.com/questions/799987/how-to-pass-a-lambda-expression-to-a-c-sharp-constructor-from-an-ironpython-scri that it works for constructors (and have verified that it does), but I can't figure out any way to make it work with a static method. Why the difference? If it is a bug, is there a workaround? How can I pass any Python callable to a C# static method? Any suggestions appreciated! -Doug > -Doug From no_reply at codeplex.com Fri Mar 16 12:44:24 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 16 Mar 2012 04:44:24 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/15/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] pyc should generate try/catch around module call 2. [New issue] pyc.py: generates exes which fail on using std python libs 3. [New comment] pyc.py: generates exes which fail on using std python libs ---------------------------------------------- ISSUES 1. [New issue] pyc should generate try/catch around module call http://ironpython.codeplex.com/workitem/32419 User slide_o_mix has proposed the issue: "The try/catch would make error messages look nicer if they occur. Some cases to handle specifically would be ImportException and other such Python exceptions."----------------- 2. [New issue] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has proposed the issue: "I tried to generate a standalone exe for a tool I have (3 modules) but it bombs out at startup with: Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No module named os at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode $functionCode) at IronPython.Compiler.OnDiskScriptCode.Run() at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options) at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, String fullName) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) I can reproduce with this simple foo.py module # foo.py import os print "Hello" print "OS:",os.name print "Bye" #end foo.py which I compile with the following: ipy -m pyc /standalone /main:foo.py /target:exe /out:foo or ipy -m pyc /main:foo.py /target:exe /out:foo2 Starting either foo.exe or foo2.exe fails with above error. If I remove the import os and the line that uses on.name, I get an executable that works..."----------------- 3. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User slide_o_mix has commented on the issue: "What pyc.py needs to do is try and find all the modules that are needed and automatically compile them as well." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Mar 16 16:28:17 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 08:28:17 -0700 Subject: [Ironpython-users] standard lib: pyc or zip it? In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 3:33 AM, Hern?n Foffani wrote: > Hi, > Say I want to distribute a smaller (in quantity of files) Python standard library. What would you recommend? Pyc the whole library to build a DLL or just zip it? Are there any performance difference between the two? Any other alternative or best practice? I know that some people have pyc'd the standard library in the past, but with zipimport being so new I don't know if anyone has tried it yet. I haven't heard from anyone who has, at least. You might have to give both a try, and if you can let us know the results that would be very helpful. - Jeff From jdhardy at gmail.com Fri Mar 16 16:36:31 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 08:36:31 -0700 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 4:24 AM, Doug Blank wrote: > This is looking more and more like a bug. I see from > http://stackoverflow.com/questions/799987/how-to-pass-a-lambda-expression-to-a-c-sharp-constructor-from-an-ironpython-scri > > that it works for constructors (and have verified that it does), but I > can't figure out any way to make it work with a static method. Why the > difference? Well, it could just be a bug :), and I haven't investigated it at all, so this is speculation. However, in the first method (the params [] one) the callables are being passed directly, while in the second they're being converted as part of a list -> List<> conversion. IronPython's conversion code is, um, interesting -- Dino might understand it all, but I don't know if anyone else does -- so it's possible two different sets of conversions are being chosen. Now, this *shouldn't* be the case, but it's my hypothesis. > > If it is a bug, is there a workaround? How can I pass any Python > callable to a C# static method? Try the conversion on the Python side, manually: f = System.Func[System.Object](test1) Myro.getFunc1(f) Myro.getFunc2([f]) - Jeff From jdhardy at gmail.com Fri Mar 16 16:37:20 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 08:37:20 -0700 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 4:24 AM, Doug Blank wrote: > Any suggestions appreciated! > Oh, and please open an issue on Codeplex with a minimal reproduction, if you can. Thanks., Jeff From jdhardy at gmail.com Fri Mar 16 16:44:52 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 08:44:52 -0700 Subject: [Ironpython-users] Considering IronPython for a new project In-Reply-To: <1331630967.17063.140661048492365@webmail.messagingengine.com> References: <1331630967.17063.140661048492365@webmail.messagingengine.com> Message-ID: On Tue, Mar 13, 2012 at 2:29 AM, wrote: > I wasn't aware that MS bailed on the Irons (back at 2010) until a few > days ago, this will probably hurt my arguments, let alone other chatter > on the web saying that nobody uses these languages aside from the former > teams at MS. That's not true; I have a decent list of other users that I really need to publish soon. Figure ~20 companies, a few open source projects, etc. > > For now, the most compelling argument to use IPy over C# is convenience > (not having to compile and distribute), although at the cost of few > other people learning to use it. More people learning Python is never bad a thing, in my books :) > > I know static compilation is over rated, but some think it?s very > important, sadly I don?t remember being able to run > PyChecker/PyLint/PyFlakes with IronPython, and since it?s going be using > a lot of .net libraries I don?t see how I can use CPython to run those. The Python static analysis tools should still give you decent information, even when run under CPYthon - PyFlakes, at least, shouldn't be tripped up by IronPython-specific code. Heck, if you reimplemented the .NET BCL in Python, any IronPython code should just work on CPython as well. I'm not familiar with what pylint and pychecker do, so I can't comment on them. > > Lastly, I?m concerned about future support, again for what I?ve managed > to gather in the last few days. That's definitely an issue, but it's true of any open-source project run entirely by volunteers. All I can say is I don't plan on going anywhere for a while. > > Can anyone please enlighten me on any of my points? Hopefully that helps a little. Sorry for taking so long to get back to you; your message slipped by when it first came in. - Jeff From doug.blank at gmail.com Fri Mar 16 16:45:55 2012 From: doug.blank at gmail.com (Doug Blank) Date: Fri, 16 Mar 2012 11:45:55 -0400 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 11:36 AM, Jeff Hardy wrote: > On Fri, Mar 16, 2012 at 4:24 AM, Doug Blank wrote: >> This is looking more and more like a bug. I see from >> http://stackoverflow.com/questions/799987/how-to-pass-a-lambda-expression-to-a-c-sharp-constructor-from-an-ironpython-scri >> >> that it works for constructors (and have verified that it does), but I >> can't figure out any way to make it work with a static method. Why the >> difference? > > Well, it could just be a bug :), and I haven't investigated it at all, > so this is speculation. However, in the first method (the params [] > one) the callables are being passed directly, while in the second > they're being converted as part of a list -> List<> conversion. > IronPython's conversion code is, um, interesting -- Dino might > understand it all, but I don't know if anyone else does -- so it's > possible two different sets of conversions are being chosen. Now, this > *shouldn't* be the case, but it's my hypothesis. > >> >> If it is a bug, is there a workaround? How can I pass any Python >> callable to a C# static method? > > Try the conversion on the Python side, manually: > > ? ?f = System.Func[System.Object](test1) > ? ?Myro.getFunc1(f) > ? ?Myro.getFunc2([f]) That might work, but I don't want to use it that way. Developing introductory educational materials, and I don't want to blow any young minds... just yet :) > Oh, and please open an issue on Codeplex with a minimal reproduction, > if you can. Will do! Can you think of *any* workaround on the C# side? Nothing I have tried will allow me to get a Python-based function (lambda, PythonFunction, builtin) out of an IList as a Func. -Doug > - Jeff From hfoffani at gmail.com Fri Mar 16 16:47:08 2012 From: hfoffani at gmail.com (=?iso-8859-1?Q?Hern=E1n_Foffani?=) Date: Fri, 16 Mar 2012 16:47:08 +0100 Subject: [Ironpython-users] standard lib: pyc or zip it? In-Reply-To: References: Message-ID: <22B6A1A2-3D5C-499A-9741-369FBAA4447E@gmail.com> El 16/03/2012, a las 16:28, Jeff Hardy escribi?: > On Fri, Mar 16, 2012 at 3:33 AM, Hern?n Foffani wrote: >> Hi, >> Say I want to distribute a smaller (in quantity of files) Python standard library. What would you recommend? Pyc the whole library to build a DLL or just zip it? Are there any performance difference between the two? Any other alternative or best practice? > > I know that some people have pyc'd the standard library in the past, > but with zipimport being so new I don't know if anyone has tried it > yet. I haven't heard from anyone who has, at least. You might have to > give both a try, and if you can let us know the results that would be > very helpful. I was one of them.. ;-) There were some problems back then with some packages which made me fall back to the standard files distribution. As Slide noted, zipimport makes it very easy now. I might give pyc a shot in the near future. From jdhardy at gmail.com Fri Mar 16 16:49:08 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 08:49:08 -0700 Subject: [Ironpython-users] DataSet --> SQLite In-Reply-To: References: Message-ID: On Wed, Mar 14, 2012 at 3:34 PM, Vernon Cole wrote: > I would suggest opening both databases in their native form, then do the > comparison using Python code rather than a complex SQL query. It may take a > while to run, but should work okay. SQLite select statements are quite fast. > Trying to do the whole thing in one swallow may be too much. Better to do > lots of querys sequentially and build your result set as you go. I agree with Vernon, but of course it depends on the operations you need to do. You'll need to provide a little more information about why System.Data.SQLite isn't working for you. You could also try 2.7.2's sqlite3 support, which is more Pythonic. - Jeff From mchalkley at mail.com Fri Mar 16 16:55:09 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Fri, 16 Mar 2012 11:55:09 -0400 Subject: [Ironpython-users] Startup performance Message-ID: <1371338792.20120316115509@mail.com> Since the question of performance with regard to zipimport was just raised, it prompted me to ask a related question. I have a script that I've compiled to an console app exe, which retrieves some data from an SQL db, does quite a bit of simple analysis and produces some files containing the resuts. It's used by 6 other people and they've all commented on the fact that it takes almost 10 seconds (usually) to display its first message (which is a "print 'Loading...'" statement that is the first non-comment line in the script, to test this very issue), but usually 2 seconds or less to retrieve 4,000 records, process them, and create the output files. Since the print statement I refer to happens before first import, or anything else, for that matter, I'm just curious if anyone has any observations on this. Are there any techniques to reduce this time? Thanks, Mark From slide.o.mix at gmail.com Fri Mar 16 17:12:23 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 16 Mar 2012 09:12:23 -0700 Subject: [Ironpython-users] Startup performance In-Reply-To: <1371338792.20120316115509@mail.com> References: <1371338792.20120316115509@mail.com> Message-ID: How long does it take if you run in script form? Just wondering for comparison. slide On Fri, Mar 16, 2012 at 8:55 AM, wrote: > Since the question of performance with regard to zipimport was just > raised, it prompted me to ask a related question. > > I have a script that I've compiled to an console app exe, which > retrieves some data from an SQL db, does quite a bit of simple > analysis and produces some files containing the resuts. It's used by 6 > other people and they've all commented on the fact that it takes > almost 10 seconds (usually) to display its first message (which is a > "print 'Loading...'" statement that is the first non-comment line in > the script, to test this very issue), but usually 2 seconds or less to > retrieve 4,000 records, process them, and create the output files. > > Since the print statement I refer to happens before first import, or > anything else, for that matter, I'm just curious if anyone has any > observations on this. Are there any techniques to reduce this time? > > Thanks, > > Mark > > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sepatan at sibmail.com Fri Mar 16 17:09:59 2012 From: sepatan at sibmail.com (sepatan at sibmail.com) Date: Fri, 16 Mar 2012 23:09:59 +0700 (NOVT) Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython Message-ID: <2456.92.125.54.67.1331914199.squirrel@www.sibmail.com> I have a need to run a WPF application written in IronPython on the client computer without the install IronPython. I try to create a C # thin client (. Exe), using IronPython.dll. If I can not load the XAML - everything is fine. But when loading XAML error occurs. Does anyone have any information on this topic (link)? Thank you. From Sven.Thomas at prov.ca Fri Mar 16 17:23:13 2012 From: Sven.Thomas at prov.ca (Sven Thomas) Date: Fri, 16 Mar 2012 11:23:13 -0500 Subject: [Ironpython-users] DataSet --> SQLite In-Reply-To: References: Message-ID: Thanks. So far I've worked out a solution iterating through the dataset. It's slow and the hard drive pins, but this report is only intended to be run once a year so performance isn't exactly a priority: for i in range(self.oraData2.Tables[0].Rows.Count -1): title = self.oraData2.Tables[0].Rows[i][0] bcode = self.oraData2.Tables[0].Rows[i][1] callno = str(self.oraData2.Tables[0].Rows[i][2]) stat1 = str(self.oraData2.Tables[0].Rows[i][3]) stat2 = str(self.oraData2.Tables[0].Rows[i][4]) (prep and execute SQL) I'm on a bit of a timeline with this project before the end of the semester so I'll explore a more performance friendly method once our library gets underway with this version. To be honest; System.Data.SQLite wasn't working because I've no idea how to do it! :0 I kept translating code examples from VB and C# but it didn't work. I'm sure it can be done quite well, I'm just a little too green on the subject. :) - Sven > -----Original Message----- > From: Jeff Hardy [mailto:jdhardy at gmail.com] > Sent: March-16-12 10:49 AM > To: Vernon Cole > Cc: Sven Thomas; ironpython-users at python.org > Subject: Re: [Ironpython-users] DataSet --> SQLite > > On Wed, Mar 14, 2012 at 3:34 PM, Vernon Cole > wrote: > > I would suggest opening both databases in their native form, then do > > the comparison using Python code rather than a complex SQL query. It > > may take a while to run, but should work okay. SQLite select statements > are quite fast. > > Trying to do the whole thing in one swallow may be too much. Better to > > do lots of querys sequentially and build your result set as you go. > > I agree with Vernon, but of course it depends on the operations you need > to do. > > You'll need to provide a little more information about why > System.Data.SQLite isn't working for you. You could also try 2.7.2's > sqlite3 support, which is more Pythonic. > > - Jeff From jdhardy at gmail.com Fri Mar 16 17:26:15 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 09:26:15 -0700 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 8:45 AM, Doug Blank wrote: > Can you think of *any* workaround on the C# side? Nothing I have tried > will allow me to get a Python-based function (lambda, PythonFunction, > builtin) out of an IList as a Func. If you're in C# 4 this should work: void test3(IList functions) { return (Func)functions[0]; } If not (or C# 3.5), you'll need to use DynamicOperations (totally untested!): void test4(CodeContext context, IList functions) { return new DynamicOperations(context.LanguageContext).ConvertTo>(functions[0]); } - Jeff From slide.o.mix at gmail.com Fri Mar 16 17:28:46 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 16 Mar 2012 09:28:46 -0700 Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython In-Reply-To: <2456.92.125.54.67.1331914199.squirrel@www.sibmail.com> References: <2456.92.125.54.67.1331914199.squirrel@www.sibmail.com> Message-ID: Getting more information about the errors would be necessary. Thanks, slide On Fri, Mar 16, 2012 at 9:09 AM, wrote: > I have a need to run a WPF application written in IronPython on the client > computer without the install IronPython. > I try to create a C # thin client (. Exe), using IronPython.dll. If I can > not load the XAML - everything is fine. But when loading XAML error > occurs. > Does anyone have any information on this topic (link)? Thank you. > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Mar 16 17:31:19 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 16 Mar 2012 09:31:19 -0700 Subject: [Ironpython-users] Startup performance In-Reply-To: References: <1371338792.20120316115509@mail.com> Message-ID: On Fri, Mar 16, 2012 at 9:12 AM, Slide wrote: > How long does it take if you run in script form? Just wondering for > comparison. Yeah, that would be a good comparison - .NET will have to JIT all of IronPython as it loads, which can take some time. The installer runs NGEN to reduce this pretty significantly. Plus the compiled exes are pretty big, which is a lot of code to load from disk. Alex, it might be worth having an option to exclude IronPython.Modules/Sqlite/Wpf just to reduce the disk size a bit. - Jeff From mchalkley at mail.com Fri Mar 16 18:21:59 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Fri, 16 Mar 2012 13:21:59 -0400 Subject: [Ironpython-users] Startup performance In-Reply-To: References: <1371338792.20120316115509@mail.com> Message-ID: <1593478457.20120316132159@mail.com> An HTML attachment was scrubbed... URL: From cold_fusion at fastmail.fm Fri Mar 16 18:28:59 2012 From: cold_fusion at fastmail.fm (cold_fusion at fastmail.fm) Date: Fri, 16 Mar 2012 19:28:59 +0200 Subject: [Ironpython-users] Considering IronPython for a new project In-Reply-To: References: <1331630967.17063.140661048492365@webmail.messagingengine.com> Message-ID: <1331918939.28297.140661050133401@webmail.messagingengine.com> Jeff, thank you very much for your feedback. I'm eager to see that list you mentioned, hopefully with testimonials. On Fri, Mar 16, 2012, at 08:44 AM, Jeff Hardy wrote: > On Tue, Mar 13, 2012 at 2:29 AM, wrote: > > I wasn't aware that MS bailed on the Irons (back at 2010) until a few > > days ago, this will probably hurt my arguments, let alone other chatter > > on the web saying that nobody uses these languages aside from the former > > teams at MS. > > That's not true; I have a decent list of other users that I really > need to publish soon. Figure ~20 companies, a few open source > projects, etc. > > > > > For now, the most compelling argument to use IPy over C# is convenience > > (not having to compile and distribute), although at the cost of few > > other people learning to use it. > > More people learning Python is never bad a thing, in my books :) > > > > > I know static compilation is over rated, but some think it?s very > > important, sadly I don?t remember being able to run > > PyChecker/PyLint/PyFlakes with IronPython, and since it?s going be using > > a lot of .net libraries I don?t see how I can use CPython to run those. > > The Python static analysis tools should still give you decent > information, even when run under CPYthon - PyFlakes, at least, > shouldn't be tripped up by IronPython-specific code. Heck, if you > reimplemented the .NET BCL in Python, any IronPython code should just > work on CPython as well. > > I'm not familiar with what pylint and pychecker do, so I can't comment on > them. > > > > > Lastly, I?m concerned about future support, again for what I?ve managed > > to gather in the last few days. > > That's definitely an issue, but it's true of any open-source project > run entirely by volunteers. All I can say is I don't plan on going > anywhere for a while. > > > > > Can anyone please enlighten me on any of my points? > > Hopefully that helps a little. Sorry for taking so long to get back to > you; your message slipped by when it first came in. > > - Jeff > -- http://www.fastmail.fm - Does exactly what it says on the tin From mchalkley at mail.com Fri Mar 16 18:31:03 2012 From: mchalkley at mail.com (mchalkley at mail.com) Date: Fri, 16 Mar 2012 13:31:03 -0400 Subject: [Ironpython-users] Startup performance In-Reply-To: References: <1371338792.20120316115509@mail.com> Message-ID: <1567085142.20120316133103@mail.com> And to add to my previous message that it's about 5x faster via the ipy route: On my laptop, which is an i7 W7-64 machine with 16gb RAM & 256gb SSD, it opens in 1.5 sec or so (really too fast to accurately gauge) via ipy, while the exe requires more than 5 seconds... Mark Friday, March 16, 2012, 12:31:19 PM, you wrote: > On Fri, Mar 16, 2012 at 9:12 AM, Slide wrote: >> How long does it take if you run in script form? Just wondering for >> comparison. > Yeah, that would be a good comparison - .NET will have to JIT all of > IronPython as it loads, which can take some time. The installer runs > NGEN to reduce this pretty significantly. Plus the compiled exes are > pretty big, which is a lot of code to load from disk. > Alex, it might be worth having an option to exclude > IronPython.Modules/Sqlite/Wpf just to reduce the disk size a bit. > - Jeff From no_reply at codeplex.com Sat Mar 17 10:35:37 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 17 Mar 2012 02:35:37 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/16/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] pyc.py: generates exes which fail on using std python libs 2. [New comment] pyc.py: generates exes which fail on using std python libs 3. [Status update] 1.1: IRONPYTHONPATH Environment Variable Ignored When Running Under Limited Account on Windows XP SP2 4. [New comment] ModuleFinder not finding imports 5. [New comment] ModuleFinder not finding imports 6. [New comment] ModuleFinder not finding imports 7. [New comment] ModuleFinder not finding imports 8. [New comment] ModuleFinder not finding imports ---------------------------------------------- ISSUES 1. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "I started to look at this last night... Hope to get this done over the week-end. More news soon..."----------------- 2. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User slide_o_mix has commented on the issue: "ModuleFinder won't work for IronPython as it stands now, so there may need to be another avenue found."----------------- 3. [Status update] 1.1: IRONPYTHONPATH Environment Variable Ignored When Running Under Limited Account on Windows XP SP2 http://ironpython.codeplex.com/workitem/18648 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "I installed Win XP SP2 in a VM and set IRONPYTHONPATH. I was able to import things in a directory in IRONPYTHONPATH with a limited account under 2.7.2.1"----------------- 4. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User slide_o_mix has commented on the issue: "The reason this isn't working is because ModuleFinder is expecting a marshalled code object in Python bytecode form. You can see from the scan_code method, that it actually looks for specific byte codes (import byte codes) to determine what modules to load. Since the code object that is returned from compile() is not in this form, ModuleFinder fails. This would take some pretty heavy development to implement byte code marshalling of the AST."----------------- 5. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User ned14 has commented on the issue: "By "marshalled code object" do you mean I ought to supply a .pyc instead of .py and then it'll work? I really don't mind if ModuleFinder isn't identical to CPython's. I'm just looking for a viable "compile this to ILR" solution."----------------- 6. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User slide_o_mix has commented on the issue: "The "compiled code object" is a CPython bytecode base code object, which IronPython does not support. We'd have to come up with another way of doing this."----------------- 7. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User ned14 has commented on the issue: "Perhaps there is a way of asking IronPython to do a module find on its particular marshalled code objects? Or are you saying that there is no presently available way of natively determining imports in IronPython?"----------------- 8. [New comment] ModuleFinder not finding imports http://ironpython.codeplex.com/workitem/32371 User slide_o_mix has commented on the issue: "There is probably a way to do it, I can't think of one off the top of my head, but there are smarter people than me around here." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Sat Mar 17 23:51:58 2012 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 17 Mar 2012 22:51:58 +0000 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54D9D05A@TK5EX14MBXC292.redmond.corp.microsoft.com> Jeff wrote: > IronPython's conversion code is, um, interesting -- Dino might understand it all, > but I don't know if anyone else does -- so it's possible two different sets of > conversions are being chosen. Now, this > *shouldn't* be the case, but it's my hypothesis. Ha! Overload resolution is like Conway's game of life, you can know the rules, but knowing the behavior is another time entirely... Luckily this doesn't so much deal with that rather than how our IList wrapper is implemented in ConversionWrappers.cs. The indexer is just doing a C# cast from the value to the T type. That could easily be changed to do a full Python conversion. I think doing an is check first and only doing the conversion if it's not already the proper type would be an alright change. But it could be a little surprising in that sometimes you could get a new instance each time you access an element (e.g. a new delegate could be created each time). From doug.blank at gmail.com Sun Mar 18 01:16:19 2012 From: doug.blank at gmail.com (Doug Blank) Date: Sat, 17 Mar 2012 20:16:19 -0400 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54D9D05A@TK5EX14MBXC292.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54D9D05A@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: On Sat, Mar 17, 2012 at 6:51 PM, Dino Viehland wrote: > > > Jeff wrote: >> IronPython's conversion code is, um, interesting -- Dino might understand it all, >> but I don't know if anyone else does -- so it's possible two different sets of >> conversions are being chosen. Now, this >> *shouldn't* be the case, but it's my hypothesis. > > Ha! ?Overload resolution is like Conway's game of life, you can know the rules, > but knowing the behavior is another time entirely... ?Luckily this doesn't so much deal with > that rather than how our IList wrapper is implemented in ConversionWrappers.cs. > The indexer is just doing a C# cast from the value to the T type. ?That could easily > be changed to do a full Python conversion. > > I think doing an is check first and only doing the conversion if it's not already the proper > type would be an alright change. ?But it could be a little surprising in that sometimes you > could get a new instance each time you access an element (e.g. a new delegate could be > created each time). Thanks for the hints! I was able to get the functionality I was seeking. Here is the relevant code I ended up with: public static List doTogether (IList functions) { foreach (dynamic function in functions) { Func func = IronPython.Runtime.Converter.Convert>(function); ... I need to do some more testing to make sure that this will always do the right thing. For example, I would want this function to be able to take, say, an IronRuby function and coerce it into the correct type as well. It does seem like these two functions should behave similarly: public void function1(params Func [] functions) { foreach (Func function in functions) { function(); } } public void function2(IList> functions) { foreach (Func function in functions) { function(); } } [I'll put that in the issue tracker and y'all can decide what the best thing to do is.] FYI, the interface I was working on was an easy way for users to run code in parallel (using Threads from behind). The function doTogether() (based on an Alice block of the same name) now allows the following: doTogether(f1, f2, ...): will run f1(), f2() at the same time and return their results in a list doTogether([f1, f2, ...], arg): will run f1(arg), f2(arg) at the same and return their results in a list doTogether(f1, [arg1, arg2, ...]): will run f1(arg1), f1(arg2) at the same time and return their results in a list doTogether([f1, arg1, ...], [f2, arg2, ...], ...): will run f1(arg1), f2(arg2) at the same time and return their results in a list I've used this in class to compose music (each function is an instrument), robot dancing (each argument is a robot), and parallel computation, among other mundane uses (such as initialize a bunch of serial ports in parallel). (The last example there would look better with lambdas (making a "thunk" in Scheme lingo) and then using the first example, but we're trying to allow some flexibility in when we must introduce additional concepts.) Full code available in the Myro library [1]. Thanks again! -Doug [1] - http://svn.cs.brynmawr.edu/viewvc/Calico/trunk/modules/Myro/Myro.cs From slide.o.mix at gmail.com Sun Mar 18 02:19:54 2012 From: slide.o.mix at gmail.com (Slide) Date: Sat, 17 Mar 2012 18:19:54 -0700 Subject: [Ironpython-users] Passing an IronPython function to C# In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54D9D05A@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: I'm just glad to see more people engaged in using IronPython! Thanks, Slide On Mar 17, 2012 5:16 PM, "Doug Blank" wrote: > On Sat, Mar 17, 2012 at 6:51 PM, Dino Viehland > wrote: > > > > > > Jeff wrote: > >> IronPython's conversion code is, um, interesting -- Dino might > understand it all, > >> but I don't know if anyone else does -- so it's possible two different > sets of > >> conversions are being chosen. Now, this > >> *shouldn't* be the case, but it's my hypothesis. > > > > Ha! Overload resolution is like Conway's game of life, you can know the > rules, > > but knowing the behavior is another time entirely... Luckily this > doesn't so much deal with > > that rather than how our IList wrapper is implemented in > ConversionWrappers.cs. > > The indexer is just doing a C# cast from the value to the T type. That > could easily > > be changed to do a full Python conversion. > > > > I think doing an is check first and only doing the conversion if it's > not already the proper > > type would be an alright change. But it could be a little surprising in > that sometimes you > > could get a new instance each time you access an element (e.g. a new > delegate could be > > created each time). > > Thanks for the hints! I was able to get the functionality I was > seeking. Here is the relevant code I ended up with: > > public static List doTogether (IList functions) > { > foreach (dynamic function in functions) { > Func func = > IronPython.Runtime.Converter.Convert>(function); > ... > > I need to do some more testing to make sure that this will always do > the right thing. For example, I would want this function to be able to > take, say, an IronRuby function and coerce it into the correct type as > well. > > It does seem like these two functions should behave similarly: > > public void function1(params Func [] functions) { > foreach (Func function in functions) { > function(); > } > } > public void function2(IList> functions) { > foreach (Func function in functions) { > function(); > } > } > > [I'll put that in the issue tracker and y'all can decide what the best > thing to do is.] > > FYI, the interface I was working on was an easy way for users to run > code in parallel (using Threads from behind). The function > doTogether() (based on an Alice block of the same name) now allows the > following: > > doTogether(f1, f2, ...): will run f1(), f2() at the same time and > return their results in a list > doTogether([f1, f2, ...], arg): will run f1(arg), f2(arg) at the same > and return their results in a list > doTogether(f1, [arg1, arg2, ...]): will run f1(arg1), f1(arg2) at the > same time and return their results in a list > doTogether([f1, arg1, ...], [f2, arg2, ...], ...): will run f1(arg1), > f2(arg2) at the same time and return their results in a list > > I've used this in class to compose music (each function is an > instrument), robot dancing (each argument is a robot), and parallel > computation, among other mundane uses (such as initialize a bunch of > serial ports in parallel). (The last example there would look better > with lambdas (making a "thunk" in Scheme lingo) and then using the > first example, but we're trying to allow some flexibility in when we > must introduce additional concepts.) Full code available in the Myro > library [1]. > > Thanks again! > > -Doug > > [1] - http://svn.cs.brynmawr.edu/viewvc/Calico/trunk/modules/Myro/Myro.cs > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Mar 18 13:51:22 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 18 Mar 2012 05:51:22 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/17/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] 2.7.2.1: ast.py fails on Lib/subprocess.py 2. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py 3. [New comment] pyc.py: generates exes which fail on using std python libs 4. [New comment] pyc.py: generates exes which fail on using std python libs 5. [New issue] Func coersions in IList ---------------------------------------------- ISSUES 1. [New issue] 2.7.2.1: ast.py fails on Lib/subprocess.py http://ironpython.codeplex.com/workitem/32446 User ddewaleffe has proposed the issue: "Parsing with ast module fails in subprocess.py: bash-3.2$ ipy ipy-bug.py Parsing file: c:\s\ipy27\Lib\subprocess.py Got exception while parsing Traceback (most recent call last): File "ipy-bug.py", line 8, in root=ast.parse(src,filename) File "C:\s\ipy27\Lib\ast.py", line 37, in parse return compile(source, filename, mode, PyCF_ONLY_AST) TypeError: Unexpected expression type: IronPython.Compiler.Ast.SetExpression bash-3.2$ Attached is the way to reproduce (module path to the file)..."----------------- 2. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py http://ironpython.codeplex.com/workitem/32446 User ddewaleffe has commented on the issue: "Also fails in random.py: Parsing file: C:\s\ipy27\Lib\random.py Got exception while parsing or visiting nodes: returning what we have so far... Traceback (most recent call last): File "C:\Users\ddw\Documents\0-dropbox\My Dropbox\Prg\ipy\finddeps.py", line 55, in dire ct_deps root=ast.parse(src,self.filename) File "C:\s\ipy27\Lib\ast.py", line 37, in parse return compile(source, filename, mode, PyCF_ONLY_AST) ValueError: Unexpected PyOperator: TrueDivide Parameter name: op Probably good to add a test that tries parsing all the source libs provided ..."----------------- 3. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "I attach findeps.py and my modified pyc.py (packaged in zip) This relies on ast.py to recursively find imports and generate a list of files to be compiled along the main ones. It works for the small examples I tried. It may miss dependencies if ast.py fails to parse a source file (e.g: subprocess.py, random.py) "----------------- 4. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User slide_o_mix has commented on the issue: "What license would you attribute to finddeps.py? I think we would need it something similar to Apache in order to include it."----------------- 5. [New issue] Func coersions in IList http://ironpython.codeplex.com/workitem/32451 User dsblank has proposed the issue: "These two C# functions behave very differently when passed IronPython functions (PythonFunction, builtin, lambda, etc): public void function1(params Func [] functions) { foreach (Func function in functions) { function(); } } public void function2(IList> functions) { foreach (Func function in functions) { function(); } } The first works as expected and executes the code. The second can't convert the IronPython function to a Func. Workaround: public void function3 (IList functions) { foreach (dynamic function in functions) { Func func = IronPython.Runtime.Converter.Convert>(function); func(); } } [Tested in MonoDevelop for .NET 4 on Windows7 64-bit. Need to include System.Core and Microsoft.CSharp.] Dino says in mailing list Mar 17, 2012: """ ...this doesn't so much deal with [two different paths] rather than how our IList wrapper is implemented in ConversionWrappers.cs. The indexer is just doing a C# cast from the value to the T type. That could easily be changed to do a full Python conversion. I think doing an is check first and only doing the conversion if it's not already the proper type would be an alright change. But it could be a little surprising in that sometimes you could get a new instance each time you access an element (e.g. a new delegate could be created each time). """ -Doug" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Mon Mar 19 09:03:06 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 19 Mar 2012 01:03:06 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/18/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py 2. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py 3. [New issue] 2.7.2.1 "load language" problem 4. [New comment] 2.7.2.1 "load language" problem 5. [New comment] 2.7.2.1 "load language" problem 6. [New comment] 2.7.2.1 "load language" problem 7. [New comment] 2.7.2.1 "load language" problem 8. [New comment] 2.7.2.1 "load language" problem 9. [New comment] pyc.py: generates exes which fail on using std python libs ---------------------------------------------- ISSUES 1. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py http://ironpython.codeplex.com/workitem/32446 User ddewaleffe has commented on the issue: "Here's a small test program which goes down sys.path and tries ast.parse() on each .py file. It reports the list of failing files: quite a few... All failures: ['c:\\s\\ipy27\\Lib\\fractions.py', 'c:\\s\\ipy27\\Lib\\sre_compile.py', 'c:\\s\\ipy27\\Lib\\netrc.py', 'c:\\s\\ipy27\\Lib\\ftplib.py', 'c:\\s\\ipy27\\Lib\\numbers.py', 'c:\\s\\ipy27\\Lib\\subprocess.py', 'c:\\s\\ipy27\\Lib\\distutils\\extension.py', 'c:\\s\\ipy27\\Lib\\UserList.py', 'c:\\s\\ipy27\\Lib\\httplib.py', 'c:\\s\\ipy27\\Lib\\wsgiref\\simple_server.py', 'c:\\s\\ipy27\\Lib\\wsgiref\\handlers.py', 'c:\\s\\ipy27\\Lib\\poplib.py', 'c:\\s\\ipy27\\Lib\\imaplib.py', 'c:\\s\\ipy27\\Lib\\UserString.py', 'c:\\s\\ipy27\\Lib\\threading.py', 'c:\\s\\ipy27\\Lib\\mailcap.py', 'c:\\s\\ipy27\\Lib\\sre_parse.py', 'c:\\s\\ipy27\\Lib\\quopri.py', 'c:\\s\\ipy27\\Tutorial\\spellcheck.py', 'c:\\s\\ipy27\\Lib\\random.py', 'c:\\s\\ipy27\\Lib\\asyncore.py']"----------------- 2. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py http://ironpython.codeplex.com/workitem/32446 User ddewaleffe has commented on the issue: "The reported failures are always one of: TypeError: Unexpected expression type: IronPython.Compiler.Ast.SetExpression TypeError: Unexpected statement type: IronPython.Compiler.Ast.SuiteStatement ValueError: Unexpected PyOperator: TrueDivide "----------------- 3. [New issue] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User Snake38 has proposed the issue: "If I try to run console or from C# code from tutorial I got this error: Failed to load language 'PythonContext': Method not found: '!!1[]Microsoft.Scripting.Utils.ArrayUtils.ConvertAll(!!0[], System.Func`2)'. I have Windows 7 32bit."----------------- 4. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User slide_o_mix has commented on the issue: "Which tutorial? "----------------- 5. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User Snake38 has commented on the issue: "From documentation - "Hosting IronPython". With this code: var engine = Python.CreateEngine(); engine.CreateScriptSourceFromString("print 'hello world'").Execute(); But I can't run IronPY at all. From "cmd": C:\Users\Snake38\Downloads\IronPython-2.7.2.1\IronPython-2.7.2.1>ipy.exe Failed to load language 'PythonContext': Method not found: '!!1[] Microsoft.Scri pting.Utils.ArrayUtils.ConvertAll(!!0[], System.Func`2)'. "----------------- 6. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User slide_o_mix has commented on the issue: "How did in you install? I've never seen this issue on several computers. Which .NET version do you have installed?"----------------- 7. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User Snake38 has commented on the issue: ".NET Framework 4.0 and I use this by download "bin" package. Older versions (before 2.7) are seems to works properly. "----------------- 8. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User slide_o_mix has commented on the issue: "Anything special with your setup? Different locale? Can you take a screenshot?"----------------- 9. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "Here is a new version of finddeps.py: - includes mention of licensing (apache v2) - falls back of re based parsing (imperfect) for the cases where ast fails.... (see secondBestGuess() function) " ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sepatan at sibmail.com Mon Mar 19 09:17:43 2012 From: sepatan at sibmail.com (sepatan at sibmail.com) Date: Mon, 19 Mar 2012 15:17:43 +0700 (NOVT) Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython Message-ID: <57328.83.172.33.173.1332145063.squirrel@www.sibmail.com> I have a need to run a WPF application written in IronPython on the client without installing IronPython. Technology to try to debug a standard example of WPF .\IronPython-2.7.2.1\Tutorial. Baseline data: 1) The computer is not installed IronPython. From IronPython-2.7.2.1.zip (download program) extracted in C:\IronPython 2) Create a C:\IronPython subdirectory pyc_d. 3) In the C:\IronPython\pyc_d created a file primer.py: from avalon import * import calculator w = Window() w.Title = "My Avalon Application" w.Content = LoadXaml("calc.xaml") calculator.enliven(w) w.Show() 4)pyc_d contains: IronPython.dll IronPython.Modules.dll IronPython.Wpf.dll Microsoft.Scripting.dll avalon.py Calc.xaml calculator.py primer.py pyc.py 5) Run ipy.exe, sequentially enter commands from the primer.py, it works :). 6) Next: c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe /platform:x86 /standalone I get primer.exe (4,09 ??). 7) Run from the console, I get: C:\IronPython\pyc_d>primer.exe An unhandled exception: System.InvalidOperationException: The calling thread must be STA, because many UI components require this. ? Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame frame) ? Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ? Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) ............................................................................... All is not enumerate It seems to do everything correctly. I take an example from the Tutorial, the files from the Tutorial, to be going smoothly, but ... What is the problem? 8)Try another option. Make a thin client in C #. Create a console C # project, and Program.cs: using System; using IronPython.Hosting; using Microsoft.Scripting.Hosting; using System.Reflection; using System.IO; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string path = Assembly.GetExecutingAssembly().Location; string dir = Directory.GetParent(path).FullName; ScriptEngine engine = Python.CreateEngine(); ScriptSource source = engine.CreateScriptSourceFromFile(Path.Combine(dir, args[0])); CompiledCode compiled = source.Compile(); ScriptScope scope = engine.CreateScope(); compiled.Execute(scope); } } } 9) run: C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py the same result: (Unhandled exception: System.InvalidOperationException: The calling thread must be STA, because many UI components require this.) What is the problem? Are there any experts who can create learning (from Tutorial) WPF application and run it on a machine without installing IronPython from the console? Thank you.) From ward.matt at gmail.com Mon Mar 19 10:14:36 2012 From: ward.matt at gmail.com (Matt Ward) Date: Mon, 19 Mar 2012 09:14:36 +0000 Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython In-Reply-To: <57328.83.172.33.173.1332145063.squirrel@www.sibmail.com> References: <57328.83.172.33.173.1332145063.squirrel@www.sibmail.com> Message-ID: If you use the /target:winexe with pyc.py it will add the STAThread attribute to your main method. That should fix the exception. In the C# console app you can add the STAThread attribute to the main method: class Program { [STAThread] static void Main(string[] args) { On 19 March 2012 08:17, wrote: > I have a need to run a WPF application written in IronPython on the client > without installing IronPython. > ?Technology to try to debug a standard example of WPF > .\IronPython-2.7.2.1\Tutorial. > ?Baseline data: > > 1) The computer is not installed IronPython. From IronPython-2.7.2.1.zip > (download program) extracted in C:\IronPython > > 2) Create a C:\IronPython subdirectory pyc_d. > > 3) In the C:\IronPython\pyc_d created a file primer.py: > > from avalon import * > import calculator > w = Window() > w.Title = "My Avalon Application" > w.Content = LoadXaml("calc.xaml") > calculator.enliven(w) > w.Show() > > 4)pyc_d contains: > > IronPython.dll > IronPython.Modules.dll > IronPython.Wpf.dll > Microsoft.Scripting.dll > > avalon.py > Calc.xaml > calculator.py > primer.py > pyc.py > > 5) Run ipy.exe, sequentially enter commands from the primer.py, it works :). > > 6) Next: > c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe /platform:x86 > /standalone > I get primer.exe (4,09 ??). > > 7) Run from the console, I get: > C:\IronPython\pyc_d>primer.exe > > An unhandled exception: System.InvalidOperationException: The calling > thread must be STA, because many UI components require this. > ? ? Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame > frame) > ? ? Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) > ? ? Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 > arg0, T1 arg1, T2 arg2) > ?............................................................................... > ?All is not enumerate > > It seems to do everything correctly. I take an example from the Tutorial, > the files from the Tutorial, to be going smoothly, but ... What is the > problem? > > 8)Try another option. Make a thin client in C #. > ?Create a console C # project, and Program.cs: > > using System; > using IronPython.Hosting; > using Microsoft.Scripting.Hosting; > using System.Reflection; > using System.IO; > > namespace ConsoleApplication1 > { > ? ?class Program > ? ?{ > ? ? ? ?static void Main(string[] args) > ? ? ? ?{ > ? ? ? ? ? ?string path = Assembly.GetExecutingAssembly().Location; > ? ? ? ? ? ?string dir = Directory.GetParent(path).FullName; > > ? ? ? ? ? ?ScriptEngine engine = Python.CreateEngine(); > ? ? ? ? ? ?ScriptSource source = > engine.CreateScriptSourceFromFile(Path.Combine(dir, args[0])); > ? ? ? ? ? ?CompiledCode compiled = source.Compile(); > ? ? ? ? ? ?ScriptScope scope = engine.CreateScope(); > ? ? ? ? ? ?compiled.Execute(scope); > ? ? ? ?} > ? ?} > } > > 9) run: > C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py > > the same result: (Unhandled exception: System.InvalidOperationException: > The calling thread must be STA, because many UI components require this.) > ?What is the problem? > ?Are there any experts who can create learning (from Tutorial) WPF > application and run it on a machine without installing IronPython from > the console? > ?Thank you.) > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From sepatan at sibmail.com Mon Mar 19 10:44:38 2012 From: sepatan at sibmail.com (sepatan at sibmail.com) Date: Mon, 19 Mar 2012 16:44:38 +0700 (NOVT) Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython Message-ID: <40016.83.172.33.173.1332150278.squirrel@www.sibmail.com> Thank you, Matt Ward :). It worked :)). You're a real expert. Just one more thing, a window appears and then disappears. I guess, because the console is closed. Maybe after the text of the program in primer.py something else should be? from avalon import * import calculator w = Window() w.Title = "My Avalon Application" w.Content = LoadXaml("calc.xaml") calculator.enliven(w) w.Show() ?????????????????????????????????? > If you use the /target:winexe with pyc.py it will add the STAThread > attribute to your main method. That should fix the exception. > > In the C# console app you can add the STAThread attribute to the main > method: > > class Program > { > [STAThread] > static void Main(string[] args) > { > > On 19 March 2012 08:17, wrote: >> I have a need to run a WPF application written in IronPython on the >> client >> without installing IronPython. >> ? Technology to try to debug a standard example of WPF >> .\IronPython-2.7.2.1\Tutorial. >> ? Baseline data: >> >> 1) The computer is not installed IronPython. From IronPython-2.7.2.1.zip >> (download program) extracted in C:\IronPython >> >> 2) Create a C:\IronPython subdirectory pyc_d. >> >> 3) In the C:\IronPython\pyc_d created a file primer.py: >> >> from avalon import * >> import calculator >> w = Window() >> w.Title = "My Avalon Application" >> w.Content = LoadXaml("calc.xaml") >> calculator.enliven(w) >> w.Show() >> >> 4)pyc_d contains: >> >> IronPython.dll >> IronPython.Modules.dll >> IronPython.Wpf.dll >> Microsoft.Scripting.dll >> >> avalon.py >> Calc.xaml >> calculator.py >> primer.py >> pyc.py >> >> 5) Run ipy.exe, sequentially enter commands from the primer.py, it works >> :). >> >> 6) Next: >> c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe /platform:x86 >> /standalone >> I get primer.exe (4,09 ????). >> >> 7) Run from the console, I get: >> C:\IronPython\pyc_d>primer.exe >> >> An unhandled exception: System.InvalidOperationException: The calling >> thread must be STA, because many UI components require this. >> ? ?? >> Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame >> frame) >> ? ?? Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame >> frame) >> ? ?? Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 >> arg0, T1 arg1, T2 arg2) >> ? ............................................................................... >> ? All is not enumerate >> >> It seems to do everything correctly. I take an example from the >> Tutorial, >> the files from the Tutorial, to be going smoothly, but ... What is the >> problem? >> >> 8)Try another option. Make a thin client in C #. >> ? Create a console C # project, and Program.cs: >> >> using System; >> using IronPython.Hosting; >> using Microsoft.Scripting.Hosting; >> using System.Reflection; >> using System.IO; >> >> namespace ConsoleApplication1 >> { >> class Program { >> static void Main(string[] args) >> { >> string path = Assembly.GetExecutingAssembly().Location; >> string dir = Directory.GetParent(path).FullName; >> >> ScriptEngine engine = Python.CreateEngine(); >> ScriptSource source = >> engine.CreateScriptSourceFromFile(Path.Combine(dir, args[0])); >> CompiledCode compiled = source.Compile(); >> ScriptScope scope = engine.CreateScope(); >> compiled.Execute(scope); >> } >> } >> } >> >> 9) run: >> C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py >> >> the same result: (Unhandled exception: System.InvalidOperationException: >> The calling thread must be STA, because many UI components require >> this.) >> ? What is the problem? >> ? Are there any experts who can create learning (from Tutorial) WPF >> application and run it on a machine without installing IronPython from >> the console? >> ? Thank you.) From cmello at gmail.com Mon Mar 19 14:50:06 2012 From: cmello at gmail.com (Cesar Mello) Date: Mon, 19 Mar 2012 10:50:06 -0300 Subject: [Ironpython-users] Passing Python exceptions in a sandboxed domain Message-ID: Hi, When I try to run something like 'None + 2' inside a sandboxed domain, I'm getting the following exception: System.Security.SecurityException Message: Request failed Stack trace: at IronPython.Runtime.Exceptions.TypeErrorException.GetObjectData(SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object serObj, String& typeName, String& assemName, String[]& fieldNames, Object[]& fieldValues) Any help is greatly appreciated. To help debugging, I thought about adding a command line argument to ipy console for setting up a standard Internet-zone sandbox. Thank you! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Mon Mar 19 16:17:36 2012 From: slide.o.mix at gmail.com (Slide) Date: Mon, 19 Mar 2012 08:17:36 -0700 Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython In-Reply-To: <40016.83.172.33.173.1332150278.squirrel@www.sibmail.com> References: <40016.83.172.33.173.1332150278.squirrel@www.sibmail.com> Message-ID: Setting /target:winexe should not show any console window. Are you sure its a console window that is being shown? Thanks, slide 2012/3/19 > Thank you, Matt Ward :). > It worked :)). You're a real expert. > Just one more thing, a window appears and then disappears. I guess, > because the console is closed. > Maybe after the text of the program in primer.py something else should be? > > from avalon import * > import calculator > w = Window() > w.Title = "My Avalon Application" > w.Content = LoadXaml("calc.xaml") > calculator.enliven(w) > w.Show() > ?????????????????????????????????? > > > If you use the /target:winexe with pyc.py it will add the STAThread > > attribute to your main method. That should fix the exception. > > > > In the C# console app you can add the STAThread attribute to the main > > method: > > > > class Program > > { > > [STAThread] > > static void Main(string[] args) > > { > > > > On 19 March 2012 08:17, wrote: > >> I have a need to run a WPF application written in IronPython on the > >> client > >> without installing IronPython. > >> ? Technology to try to debug a standard example of WPF > >> .\IronPython-2.7.2.1\Tutorial. > >> ? Baseline data: > >> > >> 1) The computer is not installed IronPython. From IronPython-2.7.2.1.zip > >> (download program) extracted in C:\IronPython > >> > >> 2) Create a C:\IronPython subdirectory pyc_d. > >> > >> 3) In the C:\IronPython\pyc_d created a file primer.py: > >> > >> from avalon import * > >> import calculator > >> w = Window() > >> w.Title = "My Avalon Application" > >> w.Content = LoadXaml("calc.xaml") > >> calculator.enliven(w) > >> w.Show() > >> > >> 4)pyc_d contains: > >> > >> IronPython.dll > >> IronPython.Modules.dll > >> IronPython.Wpf.dll > >> Microsoft.Scripting.dll > >> > >> avalon.py > >> Calc.xaml > >> calculator.py > >> primer.py > >> pyc.py > >> > >> 5) Run ipy.exe, sequentially enter commands from the primer.py, it works > >> :). > >> > >> 6) Next: > >> c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe /platform:x86 > >> /standalone > >> I get primer.exe (4,09 ????). > >> > >> 7) Run from the console, I get: > >> C:\IronPython\pyc_d>primer.exe > >> > >> An unhandled exception: System.InvalidOperationException: The calling > >> thread must be STA, because many UI components require this. > >> ? ?? > >> Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame > >> frame) > >> ? ?? Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > >> frame) > >> ? ?? Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 > >> arg0, T1 arg1, T2 arg2) > >> ? > > ............................................................................... > >> ? All is not enumerate > >> > >> It seems to do everything correctly. I take an example from the > >> Tutorial, > >> the files from the Tutorial, to be going smoothly, but ... What is the > >> problem? > >> > >> 8)Try another option. Make a thin client in C #. > >> ? Create a console C # project, and Program.cs: > >> > >> using System; > >> using IronPython.Hosting; > >> using Microsoft.Scripting.Hosting; > >> using System.Reflection; > >> using System.IO; > >> > >> namespace ConsoleApplication1 > >> { > >> class Program > { > >> static void Main(string[] args) > >> { > >> string path = Assembly.GetExecutingAssembly().Location; > >> string dir = Directory.GetParent(path).FullName; > >> > >> ScriptEngine engine = Python.CreateEngine(); > >> ScriptSource source = > >> engine.CreateScriptSourceFromFile(Path.Combine(dir, args[0])); > >> CompiledCode compiled = source.Compile(); > >> ScriptScope scope = engine.CreateScope(); > >> compiled.Execute(scope); > >> } > >> } > >> } > >> > >> 9) run: > >> C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py > >> > >> the same result: (Unhandled exception: System.InvalidOperationException: > >> The calling thread must be STA, because many UI components require > >> this.) > >> ? What is the problem? > >> ? Are there any experts who can create learning (from Tutorial) WPF > >> application and run it on a machine without installing IronPython from > >> the console? > >> ? Thank you.) > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Mon Mar 19 15:53:40 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 19 Mar 2012 14:53:40 +0000 Subject: [Ironpython-users] Considering IronPython for a new project In-Reply-To: References: <1331630967.17063.140661048492365@webmail.messagingengine.com> Message-ID: <727D8E16AE957149B447FE368139F2B50D787893@SERVER10> Hi, Jeff, Von: Jeff Hardy On Tue, Mar 13, 2012 at 2:29 AM, wrote: >> I wasn't aware that MS bailed on the Irons (back at 2010) until a few >> days ago, this will probably hurt my arguments, let alone other >> chatter on the web saying that nobody uses these languages aside from >> the former teams at MS. > That's not true; I have a decent list of other users that I really need to publish soon. Figure ~20 companies, a few open source projects, etc. I hope that we're on this list - if not, please tell me where to sign up. :-) (We = 3S-Smart Software Solutions GmbH, www.3s-software.com, we use it in CoDeSys as an embedded scripting environment.) Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From sepatan at sibmail.com Mon Mar 19 16:36:51 2012 From: sepatan at sibmail.com (sepatan at sibmail.com) Date: Mon, 19 Mar 2012 22:36:51 +0700 (NOVT) Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython Message-ID: <2131.90.188.102.223.1332171411.squirrel@www.sibmail.com> Hello). With the advice Matt Ward, thanks to him, the problem was solved as follows: 1) had to change avalon.py as follows: commented out 2 lines ............. t = Thread(ThreadStart(start)) t.IsBackground = True t.ApartmentState = ApartmentState.STA #t.Start() #are.WaitOne() .............. 2) changed the file primer.py: from avalon import * import calculator global app global dispatcher app = Application() app.Startup += on_startup w = Window() w.Title = "My Avalon Application" w.Content = LoadXaml("calc.xaml") calculator.enliven(w) app.Run(w) w.Show() 3) after compilation: c:\IronPython\ipy.exe pyc.py /main: primer.py /target: winexe /platform: x86 /standalone was working primer.exe but ... not without nuance): after closing the window appears the system error message: primer.exe - an error is detected. The application will be closed. We are We apologize for any inconvenience. If the work was not finished, operational data may be lost. This message did not have to be. Maybe there is someone the idea.) Thank you. > You will need to keep the message pump alive by using Application.Run. > The following code should work (new first line and last two lines): > > from System.Windows import Application > > from avalon import * > import calculator > w = Window() > w.Title = "My Avalon Application" > w.Content = LoadXaml("calc.xaml") > calculator.enliven(w) > > app = Application() > app.Run(w) > > On 19 March 2012 09:29, wrote: >> Thank you, Matt Ward :). >> ??It worked :)). You're a real expert. >> ??Just one more thing, a window appears and then disappears. I guess, >> because the console is closed. >> ??Maybe after the text of the program in primer.py something else should >> be? >> >> from avalon import * >> import calculator >> w = Window() >> w.Title = "My Avalon Application" >> w.Content = LoadXaml("calc.xaml") >> calculator.enliven(w) >> w.Show() >> ?????????????????????????????????? >> >>> If you use the /target:winexe with pyc.py it will add the STAThread >>> attribute to your main method. That should fix the exception. >>> >>> In the C# console app you can add the STAThread attribute to the main >>> method: >>> >>> class Program >>> { >>> ? [STAThread] >>> ? static void Main(string[] args) >>> ? { >>> >>> On 19 March 2012 08:17, ?? wrote: >>>> I have a need to run a WPF application written in IronPython on the >>>> client >>>> without installing IronPython. >>>> Technology to try to debug a standard example of WPF >>>> .\IronPython-2.7.2.1\Tutorial. >>>> Baseline data: >>>> >>>> 1) The computer is not installed IronPython. From >>>> IronPython-2.7.2.1.zip >>>> (download program) extracted in C:\IronPython >>>> >>>> 2) Create a C:\IronPython subdirectory pyc_d. >>>> >>>> 3) In the C:\IronPython\pyc_d created a file primer.py: >>>> >>>> from avalon import * >>>> import calculator >>>> w = Window() >>>> w.Title = "My Avalon Application" >>>> w.Content = LoadXaml("calc.xaml") >>>> calculator.enliven(w) >>>> w.Show() >>>> >>>> 4)pyc_d contains: >>>> >>>> IronPython.dll >>>> IronPython.Modules.dll >>>> IronPython.Wpf.dll >>>> Microsoft.Scripting.dll >>>> >>>> avalon.py >>>> Calc.xaml >>>> calculator.py >>>> primer.py >>>> pyc.py >>>> >>>> 5) Run ipy.exe, sequentially enter commands from the primer.py, it >>>> works >>>> :). >>>> >>>> 6) Next: >>>> c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe /platform:x86 /standalone >>>> I get primer.exe (4,09 MB). >>>> >>>> 7) Run from the console, I get: >>>> C:\IronPython\pyc_d>primer.exe >>>> >>>> An unhandled exception: System.InvalidOperationException: The calling >>>> thread must be STA, because many UI components require this. >>>> >>>> Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame >>>> frame) >>>> >>>> Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame >>>> frame) >>>> >>>> Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 >>>> arg0, T1 arg1, T2 arg2) >>>> ?............................................................................... >>>> All is not enumerate >>>> >>>> It seems to do everything correctly. I take an example from the >>>> Tutorial, >>>> the files from the Tutorial, to be going smoothly, but ... What is the >>>> problem? >>>> >>>> 8)Try another option. Make a thin client in C #. >>>> Create a console C # project, and Program.cs: >>>> >>>> using System; >>>> using IronPython.Hosting; >>>> using Microsoft.Scripting.Hosting; >>>> using System.Reflection; >>>> using System.IO; >>>> >>>> namespace ConsoleApplication1 >>>> { >>>> ?class Program >>>> ?{ >>>> ?static void Main(string[] args) >>>> ?{ >>>> ?string path = Assembly.GetExecutingAssembly().Location; >>>> string dir = Directory.GetParent(path).FullName; >>>> >>>> ?ScriptEngine engine = Python.CreateEngine(); >>>> ?ScriptSource source = engine.CreateScriptSourceFromFile(Path.Combine(dir, args[0])); >>>> ?CompiledCode compiled = source.Compile(); >>>> ?ScriptScope scope = engine.CreateScope(); >>>> ?compiled.Execute(scope); >>>> } >>>> ?} >>>> } >>>> >>>> 9) run: >>>> C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py >>>> >>>> the same result: (Unhandled exception: >>>> System.InvalidOperationException: >>>> The calling thread must be STA, because many UI components require >>>> this.) >>>> What is the problem? >>>> Are there any experts who can create learning (from Tutorial) WPF >>>> application and run it on a machine without installing IronPython from >>>> the console? >>>> Thank you.) >>>> >>>> _______________________________________________ >>>> Ironpython-users mailing list >>>> Ironpython-users at python.org >>>> http://mail.python.org/mailman/listinfo/ironpython-users >>> >> >> > From slide.o.mix at gmail.com Mon Mar 19 17:07:39 2012 From: slide.o.mix at gmail.com (Slide) Date: Mon, 19 Mar 2012 09:07:39 -0700 Subject: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython In-Reply-To: <2131.90.188.102.223.1332171411.squirrel@www.sibmail.com> References: <2131.90.188.102.223.1332171411.squirrel@www.sibmail.com> Message-ID: Hmmm, do you have Visual Studio installed so that you could possibly debug the application when it fails at the end and pinpoint the spot of failure? Thanks, slide 2012/3/19 > Hello). > With the advice Matt Ward, thanks to him, the problem was solved as > follows: > 1) had to change avalon.py as follows: > commented out 2 lines > ............. > t = Thread(ThreadStart(start)) > t.IsBackground = True > t.ApartmentState = ApartmentState.STA > #t.Start() > #are.WaitOne() > .............. > > 2) changed the file primer.py: > from avalon import * > import calculator > global app > global dispatcher > app = Application() > app.Startup += on_startup > w = Window() > w.Title = "My Avalon Application" > w.Content = LoadXaml("calc.xaml") > calculator.enliven(w) > app.Run(w) > w.Show() > > 3) after compilation: > c:\IronPython\ipy.exe pyc.py /main: primer.py /target: winexe /platform: > x86 /standalone > was working primer.exe > but ... > not without nuance): > after closing the window appears the system error message: > primer.exe - an error is detected. The application will be closed. We are > We apologize for any inconvenience. > If the work was not finished, operational data may be lost. > This message did not have to be. > Maybe there is someone the idea.) > > Thank you. > > > You will need to keep the message pump alive by using Application.Run. > > The following code should work (new first line and last two lines): > > > > from System.Windows import Application > > > > from avalon import * > > import calculator > > w = Window() > > w.Title = "My Avalon Application" > > w.Content = LoadXaml("calc.xaml") > > calculator.enliven(w) > > > > app = Application() > > app.Run(w) > > > > On 19 March 2012 09:29, wrote: > >> Thank you, Matt Ward :). > >> ? It worked :)). You're a real expert. > >> ? Just one more thing, a window appears and then disappears. I guess, > >> because the console is closed. > >> ? Maybe after the text of the program in primer.py something else should > >> be? > >> > >> from avalon import * > >> import calculator > >> w = Window() > >> w.Title = "My Avalon Application" > >> w.Content = LoadXaml("calc.xaml") > >> calculator.enliven(w) > >> w.Show() > >> ?????????????????????????????????? > >> > >>> If you use the /target:winexe with pyc.py it will add the STAThread > >>> attribute to your main method. That should fix the exception. > >>> > >>> In the C# console app you can add the STAThread attribute to the main > >>> method: > >>> > >>> class Program > >>> { > >>> [STAThread] > >>> static void Main(string[] args) > >>> { > >>> > >>> On 19 March 2012 08:17, ? wrote: > >>>> I have a need to run a WPF application written in IronPython on the > >>>> client > >>>> without installing IronPython. > >>>> Technology to try to debug a standard example of WPF > >>>> .\IronPython-2.7.2.1\Tutorial. > >>>> Baseline data: > >>>> > >>>> 1) The computer is not installed IronPython. From > >>>> IronPython-2.7.2.1.zip > >>>> (download program) extracted in C:\IronPython > >>>> > >>>> 2) Create a C:\IronPython subdirectory pyc_d. > >>>> > >>>> 3) In the C:\IronPython\pyc_d created a file primer.py: > >>>> > >>>> from avalon import * > >>>> import calculator > >>>> w = Window() > >>>> w.Title = "My Avalon Application" > >>>> w.Content = LoadXaml("calc.xaml") > >>>> calculator.enliven(w) > >>>> w.Show() > >>>> > >>>> 4)pyc_d contains: > >>>> > >>>> IronPython.dll > >>>> IronPython.Modules.dll > >>>> IronPython.Wpf.dll > >>>> Microsoft.Scripting.dll > >>>> > >>>> avalon.py > >>>> Calc.xaml > >>>> calculator.py > >>>> primer.py > >>>> pyc.py > >>>> > >>>> 5) Run ipy.exe, sequentially enter commands from the primer.py, it > >>>> works > >>>> :). > >>>> > >>>> 6) Next: > >>>> c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe > /platform:x86 /standalone > >>>> I get primer.exe (4,09 MB). > >>>> > >>>> 7) Run from the console, I get: > >>>> C:\IronPython\pyc_d>primer.exe > >>>> > >>>> An unhandled exception: System.InvalidOperationException: The calling > >>>> thread must be STA, because many UI components require this. > >>>> > >>>> Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame > >>>> frame) > >>>> > >>>> Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > >>>> frame) > >>>> > >>>> Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 > >>>> arg0, T1 arg1, T2 arg2) > >>>> > ............................................................................... > >>>> All is not enumerate > >>>> > >>>> It seems to do everything correctly. I take an example from the > >>>> Tutorial, > >>>> the files from the Tutorial, to be going smoothly, but ... What is the > >>>> problem? > >>>> > >>>> 8)Try another option. Make a thin client in C #. > >>>> Create a console C # project, and Program.cs: > >>>> > >>>> using System; > >>>> using IronPython.Hosting; > >>>> using Microsoft.Scripting.Hosting; > >>>> using System.Reflection; > >>>> using System.IO; > >>>> > >>>> namespace ConsoleApplication1 > >>>> { > >>>> class Program > >>>> { > >>>> static void Main(string[] args) > >>>> { > >>>> string path = > Assembly.GetExecutingAssembly().Location; > >>>> string dir = > Directory.GetParent(path).FullName; > >>>> > >>>> ScriptEngine engine = > Python.CreateEngine(); > >>>> ScriptSource source = > engine.CreateScriptSourceFromFile(Path.Combine(dir, > args[0])); > >>>> CompiledCode compiled = source.Compile(); > >>>> ScriptScope scope = engine.CreateScope(); > >>>> compiled.Execute(scope); > >>>> } > >>>> } > >>>> } > >>>> > >>>> 9) run: > >>>> C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py > >>>> > >>>> the same result: (Unhandled exception: > >>>> System.InvalidOperationException: > >>>> The calling thread must be STA, because many UI components require > >>>> this.) > >>>> What is the problem? > >>>> Are there any experts who can create learning (from Tutorial) WPF > >>>> application and run it on a machine without installing IronPython from > >>>> the console? > >>>> Thank you.) > >>>> > >>>> _______________________________________________ > >>>> Ironpython-users mailing list > >>>> Ironpython-users at python.org > >>>> http://mail.python.org/mailman/listinfo/ironpython-users > >>> > >> > >> > > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Mon Mar 19 21:35:09 2012 From: cmello at gmail.com (Cesar Mello) Date: Mon, 19 Mar 2012 17:35:09 -0300 Subject: [Ironpython-users] Sandbox support for IronPython console Message-ID: Hi, I would like to know if someone other than me would find useful to have a command line argument for sandboxing the ipy console. I'm trying to implement this but I'm not sure if it is worth. For me it would make easier to debug and reproduce stuff. Also I'm curious to know how many people are using IronPython with Internet-zone sandbox. Thanks! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Mon Mar 19 22:10:28 2012 From: slide.o.mix at gmail.com (Slide) Date: Mon, 19 Mar 2012 14:10:28 -0700 Subject: [Ironpython-users] Sandbox support for IronPython console In-Reply-To: References: Message-ID: Cesar, I think this sounds like a pretty good idea for debugging stuff. Are you familiar with how we work with patches should you get something going? Thanks, slide On Mon, Mar 19, 2012 at 1:35 PM, Cesar Mello wrote: > Hi, > > I would like to know if someone other than me would find useful to have a > command line argument for sandboxing the ipy console. > > I'm trying to implement this but I'm not sure if it is worth. For me it > would make easier to debug and reproduce stuff. > > Also I'm curious to know how many people are using IronPython with > Internet-zone sandbox. > > Thanks! > > Best regards > Mello > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Mon Mar 19 22:25:52 2012 From: cmello at gmail.com (Cesar Mello) Date: Mon, 19 Mar 2012 18:25:52 -0300 Subject: [Ironpython-users] Sandbox support for IronPython console In-Reply-To: References: Message-ID: Hi Slide, You mean I should do a pull request when I'm finished? But I'm still just playing around. I've hard-coded a sandboxed appdomain here just for testing the idea: https://github.com/cmello/IronLanguages-main/commit/3241688e4917c70a6db4c1b671f42c4144e8bf96 But I get remoting exceptions as soon as the PythonContext is requested here: Microsoft.Scripting.Hosting.Providers.HostingHelpers public static LanguageContext GetLanguageContext(ScriptEngine engine) { ContractUtils.RequiresNotNull(engine, "engine"); return engine.LanguageContext; } I don't know what could be done here... Thanks for the attention! Best regards On Mon, Mar 19, 2012 at 6:10 PM, Slide wrote: > Cesar, > > I think this sounds like a pretty good idea for debugging stuff. Are you > familiar with how we work with patches should you get something going? > > Thanks, > > slide > > On Mon, Mar 19, 2012 at 1:35 PM, Cesar Mello wrote: > >> Hi, >> >> I would like to know if someone other than me would find useful to have a >> command line argument for sandboxing the ipy console. >> >> I'm trying to implement this but I'm not sure if it is worth. For me it >> would make easier to debug and reproduce stuff. >> >> Also I'm curious to know how many people are using IronPython with >> Internet-zone sandbox. >> >> Thanks! >> >> Best regards >> Mello >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > > > -- > Website: http://earl-of-code.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Mon Mar 19 22:26:51 2012 From: cmello at gmail.com (Cesar Mello) Date: Mon, 19 Mar 2012 18:26:51 -0300 Subject: [Ironpython-users] Sandbox support for IronPython console In-Reply-To: References: Message-ID: Actually if you find interesting for me to pull this through a command line argument, do you have any suggestions on what argument should I create for it? Thanks Best regards Mello On Mon, Mar 19, 2012 at 6:21 PM, Cesar Mello wrote: > Hi Slide, > > You mean I should do a pull request when I'm finished? > > But I'm still just playing around. I've hard-coded a sandboxed appdomain > here just for testing the idea: > > > https://github.com/cmello/IronLanguages-main/commit/3241688e4917c70a6db4c1b671f42c4144e8bf96 > > > But I get remoting exceptions as soon as the PythonContext is requested > here: > > Microsoft.Scripting.Hosting.Providers.HostingHelpers > > public static LanguageContext GetLanguageContext(ScriptEngine > engine) { > ContractUtils.RequiresNotNull(engine, "engine"); > return engine.LanguageContext; > } > > > I don't know what could be done here... > > Thanks for the attention! > > Best regards > Mello > > > On Mon, Mar 19, 2012 at 6:10 PM, Slide wrote: > >> Cesar, >> >> I think this sounds like a pretty good idea for debugging stuff. Are you >> familiar with how we work with patches should you get something going? >> >> Thanks, >> >> slide >> >> On Mon, Mar 19, 2012 at 1:35 PM, Cesar Mello wrote: >> >>> Hi, >>> >>> I would like to know if someone other than me would find useful to have >>> a command line argument for sandboxing the ipy console. >>> >>> I'm trying to implement this but I'm not sure if it is worth. For me it >>> would make easier to debug and reproduce stuff. >>> >>> Also I'm curious to know how many people are using IronPython with >>> Internet-zone sandbox. >>> >>> Thanks! >>> >>> Best regards >>> Mello >>> >>> _______________________________________________ >>> Ironpython-users mailing list >>> Ironpython-users at python.org >>> http://mail.python.org/mailman/listinfo/ironpython-users >>> >>> >> >> >> -- >> Website: http://earl-of-code.com >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Mar 19 22:44:51 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 19 Mar 2012 14:44:51 -0700 Subject: [Ironpython-users] Sandbox support for IronPython console In-Reply-To: References: Message-ID: On Mon, Mar 19, 2012 at 2:26 PM, Cesar Mello wrote: > Actually if you find interesting for me to pull this through a command line > argument, do you have any suggestions on what argument should I create for > it? Something like -X:Sandbox (It has to be under -X: so that we don't conflict with CPython). Bonus points if the user can provide a config file with a custom sandbox configuration. - Jeff From slide.o.mix at gmail.com Mon Mar 19 22:45:22 2012 From: slide.o.mix at gmail.com (Slide) Date: Mon, 19 Mar 2012 14:45:22 -0700 Subject: [Ironpython-users] Sandbox support for IronPython console In-Reply-To: References: Message-ID: Yes, a pull request would be preferred. It makes it very easy to review the code and then incorporate it into the master. As for the command line argument, -X:Sandbox or something like that. I think the name of the parameter is less of a concern until its all up and working. slide On Mon, Mar 19, 2012 at 2:26 PM, Cesar Mello wrote: > Actually if you find interesting for me to pull this through a command > line argument, do you have any suggestions on what argument should I create > for it? > > Thanks > > Best regards > Mello > > > On Mon, Mar 19, 2012 at 6:21 PM, Cesar Mello wrote: > >> Hi Slide, >> >> You mean I should do a pull request when I'm finished? >> >> But I'm still just playing around. I've hard-coded a sandboxed appdomain >> here just for testing the idea: >> >> >> https://github.com/cmello/IronLanguages-main/commit/3241688e4917c70a6db4c1b671f42c4144e8bf96 >> >> >> But I get remoting exceptions as soon as the PythonContext is requested >> here: >> >> Microsoft.Scripting.Hosting.Providers.HostingHelpers >> >> public static LanguageContext GetLanguageContext(ScriptEngine >> engine) { >> ContractUtils.RequiresNotNull(engine, "engine"); >> return engine.LanguageContext; >> } >> >> >> I don't know what could be done here... >> >> Thanks for the attention! >> >> Best regards >> Mello >> >> >> On Mon, Mar 19, 2012 at 6:10 PM, Slide wrote: >> >>> Cesar, >>> >>> I think this sounds like a pretty good idea for debugging stuff. Are you >>> familiar with how we work with patches should you get something going? >>> >>> Thanks, >>> >>> slide >>> >>> On Mon, Mar 19, 2012 at 1:35 PM, Cesar Mello wrote: >>> >>>> Hi, >>>> >>>> I would like to know if someone other than me would find useful to have >>>> a command line argument for sandboxing the ipy console. >>>> >>>> I'm trying to implement this but I'm not sure if it is worth. For me it >>>> would make easier to debug and reproduce stuff. >>>> >>>> Also I'm curious to know how many people are using IronPython with >>>> Internet-zone sandbox. >>>> >>>> Thanks! >>>> >>>> Best regards >>>> Mello >>>> >>>> _______________________________________________ >>>> Ironpython-users mailing list >>>> Ironpython-users at python.org >>>> http://mail.python.org/mailman/listinfo/ironpython-users >>>> >>>> >>> >>> >>> -- >>> Website: http://earl-of-code.com >>> >> >> > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Tue Mar 20 11:57:37 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 20 Mar 2012 03:57:37 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/19/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] pyc.py: generates exes which fail on using std python libs 2. [New comment] pyc.py: generates exes which fail on using std python libs 3. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py 4. [New comment] 2.7.2.1 "load language" problem ---------------------------------------------- ISSUES 1. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "Fixed bug in latest finddeps.py. Wrong type returned..."----------------- 2. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "However, still does not work completely. It fails for complex modules like 'logging' implemented in a directory... More to do for tonight... "----------------- 3. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py http://ironpython.codeplex.com/workitem/32446 User jdhardy has commented on the issue: "I wonder if a couple of 2.7 features weren't missed when adding it to 2.7 (it was originally written for 2.6). Thanks for the test cases by the way, very helpful. If you want to take a crack at fixing it the code in _ast.cs isn't too bad, and I'd be happy to help out."----------------- 4. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User jdhardy has commented on the issue: "I've seen that before when specifying the languages to load in an app.config file. Can you post the contents of ipy.exe.config?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Mar 21 16:31:33 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 21 Mar 2012 08:31:33 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/20/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] 2.7.2.1 "load language" problem 2. [New issue] incorrect generator variable scope 3. [New comment] incorrect generator variable scope ---------------------------------------------- ISSUES 1. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User Snake38 has commented on the issue: "My ipy.exe.config: http://i.imgur.com/lzFyQ.png I have Polish version of system. "----------------- 2. [New issue] incorrect generator variable scope http://ironpython.codeplex.com/workitem/32465 User jonathanhiga has proposed the issue: "IronPython 2.7.2.1 fails the attached IronPythonTestCase.test_generator_scope test. $ ipy -m testipy IronPythonTestCase.test_generator_scope E ====================================================================== ERROR: test_generator_scope (__main__.IronPythonTestCase) Test the scopes of the variables in a nested generator. ---------------------------------------------------------------------- Traceback (most recent call last): File "Z:\Developer\qmdl_test\lib\testipy.py", line 50, in test_generator_scope columns = {row['column_name']: row['data_type'].lower() File "Z:\Developer\qmdl_test\lib\testipy.py", line 53, in any(p.lower() in row['column_name'].lower() NameError: global name 'row' is not defined ---------------------------------------------------------------------- Ran 1 test in 0.219s FAILED (errors=1)"----------------- 3. [New comment] incorrect generator variable scope http://ironpython.codeplex.com/workitem/32465 User jonathanhiga has commented on the issue: "Interactive summary: IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.239 (32-bit) Type "help", "copyright", "credits" or "license" for more information. >>> metadata = [{'column_name': 'splunge', 'data_type': 'varchar(128)'}] >>> patterns = ['lunge'] >>> columns = {row['column_name']: row['data_type'].lower() ... for row in metadata ... if patterns is None or ... any(p.lower() in row['column_name'].lower() ... for p in patterns)} Traceback (most recent call last): File "", line 1, in File "", line 4, in NameError: global name 'row' is not defined" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 21 22:15:44 2012 From: cmello at gmail.com (Cesar Mello) Date: Wed, 21 Mar 2012 18:15:44 -0300 Subject: [Ironpython-users] Passing Python exceptions in a sandboxed domain In-Reply-To: References: Message-ID: Hey guys, I know this is not IronPython specific, but it is causing pain to embbed IronPython in our product. If someone can help, thanks so much! I can repro the problem throwing a TypeErrorException from the restricted appdomain like this: // starts with standard Internet Zone sandbox permissions var evidence = new Evidence(); evidence.AddHostEvidence(new Zone(SecurityZone.Internet)); var permissionSet = SecurityManager.GetStandardSandbox(evidence); permissionSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); var setup = new AppDomainSetup(); setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; setup.ApplicationName = "ConsoleScriptHost"; var domain = AppDomain.CreateDomain(setup.ApplicationName, evidence, setup, permissionSet, null); try { domain.DoCallBack(delegate { var x = new IronPython.Runtime.Exceptions.TypeErrorException("xxx"); throw x; }); } catch (SecurityException ex) { var m = ex.Message; // why this? } On Mon, Mar 19, 2012 at 10:50 AM, Cesar Mello wrote: > Hi, > > When I try to run something like 'None + 2' inside a sandboxed domain, I'm > getting the following exception: > > System.Security.SecurityException > Message: Request failed > > Stack trace: > > at > IronPython.Runtime.Exceptions.TypeErrorException.GetObjectData(SerializationInfo > info, StreamingContext context) > at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object > serObj, String& typeName, String& assemName, String[]& fieldNames, > Object[]& fieldValues) > > Any help is greatly appreciated. > > To help debugging, I thought about adding a command line argument to ipy > console for setting up a standard Internet-zone sandbox. > > Thank you! > > Best regards > Mello > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Mar 21 23:58:23 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 21 Mar 2012 22:58:23 +0000 Subject: [Ironpython-users] Passing Python exceptions in a sandboxed domain In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54DB679B@TK5EX14MBXC292.redmond.corp.microsoft.com> The Execute methods have ExecuteAndWrap versions which catch the exception locally and return it as an ObjectHandle. You can then pass that object handle back into either ObjectOperations or ExceptionOperations to do the formatting or conversion into a string in the remote domain. If you need code that's more like what you specifically have below (because you're not just executing code) you can always do the same trick - in the remote app domain catch the exception, and then pass out a new ObjectHandle to the exception object rather than passing the object back. From: ironpython-users-bounces+dinov=exchange.microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] On Behalf Of Cesar Mello Sent: Wednesday, March 21, 2012 2:16 PM To: ironpython-users at python.org Subject: Re: [Ironpython-users] Passing Python exceptions in a sandboxed domain Hey guys, I know this is not IronPython specific, but it is causing pain to embbed IronPython in our product. If someone can help, thanks so much! I can repro the problem throwing a TypeErrorException from the restricted appdomain like this: // starts with standard Internet Zone sandbox permissions var evidence = new Evidence(); evidence.AddHostEvidence(new Zone(SecurityZone.Internet)); var permissionSet = SecurityManager.GetStandardSandbox(evidence); permissionSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); var setup = new AppDomainSetup(); setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; setup.ApplicationName = "ConsoleScriptHost"; var domain = AppDomain.CreateDomain(setup.ApplicationName, evidence, setup, permissionSet, null); try { domain.DoCallBack(delegate { var x = new IronPython.Runtime.Exceptions.TypeErrorException("xxx"); throw x; }); } catch (SecurityException ex) { var m = ex.Message; // why this? } On Mon, Mar 19, 2012 at 10:50 AM, Cesar Mello > wrote: Hi, When I try to run something like 'None + 2' inside a sandboxed domain, I'm getting the following exception: System.Security.SecurityException Message: Request failed Stack trace: at IronPython.Runtime.Exceptions.TypeErrorException.GetObjectData(SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object serObj, String& typeName, String& assemName, String[]& fieldNames, Object[]& fieldValues) Any help is greatly appreciated. To help debugging, I thought about adding a command line argument to ipy console for setting up a standard Internet-zone sandbox. Thank you! Best regards Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Thu Mar 22 15:54:50 2012 From: cmello at gmail.com (Cesar Mello) Date: Thu, 22 Mar 2012 11:54:50 -0300 Subject: [Ironpython-users] Passing Python exceptions in a sandboxed domain In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54DB679B@TK5EX14MBXC292.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54DB679B@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: Hi Dino! It worked perfectly, thanks a lot! Actually I had already fixed this same problem in other places of the code, but forgot one... And then I didn't realize it was the same problem. Now the usability of our product with IronPython embedded is quite nice even when running inside the sandbox (removed support for decimal for this initial version). I still need to add some extra reflection permissions though, but I don't think that can bring security issues. Thank you and congratulations to all the team for the great work! Best regards Mello On Wed, Mar 21, 2012 at 7:58 PM, Dino Viehland wrote: > The Execute methods have ExecuteAndWrap versions which catch the > exception locally and return it as an ObjectHandle. You can then pass that > object handle back into either ObjectOperations or ExceptionOperations to > do the formatting or conversion into a string in the remote domain. **** > > ** ** > > If you need code that?s more like what you specifically have below > (because you?re not just executing code) you can always do the same trick ? > in the remote app domain catch the exception, and then pass out a new > ObjectHandle to the exception object rather than passing the object back.* > *** > > ** ** > > *From:* ironpython-users-bounces+dinov=exchange.microsoft.com at python.org[mailto: > ironpython-users-bounces+dinov=exchange.microsoft.com at python.org] *On > Behalf Of *Cesar Mello > *Sent:* Wednesday, March 21, 2012 2:16 PM > *To:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Passing Python exceptions in a > sandboxed domain**** > > ** ** > > Hey guys,**** > > ** ** > > I know this is not IronPython specific, but it is causing pain to embbed > IronPython in our product. If someone can help, thanks so much!**** > > ** ** > > I can repro the problem throwing a TypeErrorException from the restricted > appdomain like this:**** > > ** ** > > // starts with standard Internet Zone sandbox permissions**** > > var evidence = new Evidence();**** > > evidence.AddHostEvidence(new Zone(SecurityZone.Internet));**** > > var permissionSet = SecurityManager.GetStandardSandbox(evidence);* > *** > > permissionSet.AddPermission(new > ReflectionPermission(PermissionState.Unrestricted));**** > > ** ** > > var setup = new AppDomainSetup();**** > > setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;**** > > setup.ApplicationName = "ConsoleScriptHost";**** > > ** ** > > var domain = AppDomain.CreateDomain(setup.ApplicationName, > evidence, setup, permissionSet, null);**** > > ** ** > > try**** > > {**** > > domain.DoCallBack(delegate**** > > {**** > > var x = new > IronPython.Runtime.Exceptions.TypeErrorException("xxx");**** > > throw x;**** > > });**** > > }**** > > catch (SecurityException ex)**** > > {**** > > var m = ex.Message; // why this?**** > > }**** > > ** ** > > ** ** > > ** ** > > On Mon, Mar 19, 2012 at 10:50 AM, Cesar Mello wrote:*** > * > > Hi,**** > > ** ** > > When I try to run something like 'None + 2' inside a sandboxed domain, I'm > getting the following exception:**** > > ** ** > > System.Security.SecurityException**** > > Message: Request failed**** > > ** ** > > Stack trace:**** > > ** ** > > at > IronPython.Runtime.Exceptions.TypeErrorException.GetObjectData(SerializationInfo > info, StreamingContext context)**** > > at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object > serObj, String& typeName, String& assemName, String[]& fieldNames, > Object[]& fieldValues)**** > > ** ** > > Any help is greatly appreciated.**** > > ** ** > > To help debugging, I thought about adding a command line argument to ipy > console for setting up a standard Internet-zone sandbox.**** > > ** ** > > Thank you!**** > > ** ** > > Best regards**** > > Mello**** > > ** ** > > ** ** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremie.laval at gmail.com Thu Mar 22 21:44:11 2012 From: jeremie.laval at gmail.com (=?ISO-8859-1?Q?J=E9r=E9mie_Laval?=) Date: Thu, 22 Mar 2012 20:44:11 +0000 Subject: [Ironpython-users] Mono Google Summer of Code - Mentors Wanted! Message-ID: Hey folks, Once again Mono has been selected as an organization to participate to Google Summer of Code[0]. For those who don't know about Google Summer of Code, it's, in a nutshell, a program that encourages students to work during the summer on an open-source project while being paid by Google. As part of this effort, we need people (called mentors in GSoC jargon) who would be available to monitor and guide participants during the program (roughly between May-August). If you are interested you can register[1] as a mentor on Melange. We are especially looking for people or projects who have a list of idea they wish to propose to the students so if you have such a list, do include it in the application you send us (or a link to it). If you have any question, you can reach the Mono GSoC admins over at soc at xamarin.com Cheers! PS: Since we have a limited number of slots, we won't be able to accept everyone right away so it may take a bit of time before we process your request. [0] http://code.google.com/soc [1] http://www.google-melange.com/gsoc/org/google/gsoc2012/mono -- J?r?mie Laval http://neteril.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Thu Mar 22 22:22:30 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 22 Mar 2012 14:22:30 -0700 Subject: [Ironpython-users] Mono Google Summer of Code - Mentors Wanted! In-Reply-To: References: Message-ID: To add some IronPython specifics to this, I've had Mono and the PSF offer to include IronPython in their programs (still waiting on confirmation from the PSF for this year, though). If there are any students that wish to work on IronPython, the project ideas are at https://github.com/IronLanguages/main/wiki/IronPython-GSoC-2012-Ideas. Feel free to add any project ideas to the list. If you don't feel comfortable being a mentor, ask on the list to see if any one else would be willing handle it. Anyone who wishes to be a mentor can add themselves to any project they wish to mentor. - Jeff 2012/3/22 J?r?mie Laval : > Hey folks, > > Once again Mono has been selected as an organization to participate to > Google Summer of Code[0]. > > For those who don't know about Google Summer of Code, it's, in a nutshell, a > program that encourages students to work during the summer on an open-source > project while being paid by Google. > > As part of this effort, we need people (called mentors in GSoC jargon) who > would be available to monitor and guide participants during the program > (roughly between May-August). > > If you are interested you can register[1] as a mentor on Melange.?We are > especially looking for people or projects who have a list of idea they wish > to propose to the students so if you have such a list, do include it in the > application you send us (or a link to it). > > If you have any question, you can reach the Mono GSoC admins over at > soc at xamarin.com > > Cheers! > > PS:?Since we have a limited number of slots, we won't be able to accept > everyone right away so it may take a bit of time before we process your > request. > > [0]?http://code.google.com/soc > [1]?http://www.google-melange.com/gsoc/org/google/gsoc2012/mono > > -- > J?r?mie Laval > http://neteril.org > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From no_reply at codeplex.com Fri Mar 23 08:52:36 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 23 Mar 2012 00:52:36 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/22/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] 2.7.2.1 "load language" problem 2. [New comment] 2.7.2.1 "load language" problem ---------------------------------------------- ISSUES 1. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User becio has commented on the issue: "OMG, I just got the same error! I installed the .msi and I have changed nothing. Both ipy.exe and ipy64.exe do not work. I have the same bug reported by Snake38 - missing method on Microsoft.Scripting.Utils.ArrayUtils::Concatenate I thought it was a mismatch in dlls, so I used ILSpy to inspect the assembly and that class, this is what I got: ICSharpCode.Decompiler.DecompilerException: Error decompiling T[0...,0...] Microsoft.Scripting.Utils.ArrayUtils::Concatenate(T[0...,0...],T[0...,0...]) ---> System.InvalidCastException: Unable to cast object of type 'Mono.Cecil.MethodReference' to type 'Mono.Cecil.GenericInstanceMethod'. at ICSharpCode.Decompiler.ILAst.TypeAnalysis.SubstituteTypeArgs(TypeReference type, MemberReference member) at ICSharpCode.Decompiler.ILAst.TypeAnalysis.DoInferTypeForExpression(ILExpression expr, TypeReference expectedType, Boolean forceInferChildren) at ICSharpCode.Decompiler.ILAst.TypeAnalysis.RunInference(ILExpression expr) at ICSharpCode.Decompiler.ILAst.TypeAnalysis.RunInference() at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, ILAstOptimizationStep abortBeforeStep) at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, ConcurrentDictionary`2 localVariables) at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDefinition methodDef, DecompilerContext context, IEnumerable`1 parameters, ConcurrentDictionary`2 localVariables) --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDefinition methodDef, DecompilerContext context, IEnumerable`1 parameters, ConcurrentDictionary`2 localVariables) at ICSharpCode.Decompiler.Ast.AstBuilder.CreateMethod(MethodDefinition methodDef) at ICSharpCode.Decompiler.Ast.AstBuilder.AddTypeMembers(TypeDeclaration astType, TypeDefinition typeDef) at ICSharpCode.Decompiler.Ast.AstBuilder.CreateType(TypeDefinition typeDef) at ICSharpCode.ILSpy.CSharpLanguage.DecompileType(TypeDefinition type, ITextOutput output, DecompilationOptions options) at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput) at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass13.b__12() An exception decompiling the class, at least to c# target. I have net4, locale it-IT, 64bit Seven. I'm curious to download the source code and rebuild it."----------------- 2. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User becio has commented on the issue: "I have a suspect. In my system I have a previous version of IronPython registered into GAC, now I have uninstalled the latest version but I still see registered version 1.1.0.0 of IronPython.dll Since dll are strong signed, probably the runtime tries to search for the assembly first into the GAC, and here probably it matches the wrong dll causing that exception. I put it there, without any check." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sat Mar 24 16:16:50 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 24 Mar 2012 08:16:50 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/23/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] 2.7.2.1 "load language" problem 2. [New comment] 2.7.2.1 "load language" problem ---------------------------------------------- ISSUES 1. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User jdhardy has commented on the issue: "becio, what other version(s) of IronPython do you have installed? If you remove that entry from the gac, does it work? Strong naming should prevent old assemblies from being loaded. Snake38, do you have any other version of IronPython installed? Are there any IronPython assemblies in the GAC ("gacutil -l" should tell you)."----------------- 2. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User becio has commented on the issue: "IronPython.dll version: 1.1.0.0 language=neutral token=31bf3856ad364e35 I don't remember now why it is there and I can't find any installation package that I think it could have register it. It's not easy to manually unregister a component from GAC on Seven, but I'll try." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Sun Mar 25 05:51:42 2012 From: slide.o.mix at gmail.com (Slide) Date: Sat, 24 Mar 2012 20:51:42 -0700 Subject: [Ironpython-users] Why does this happen? Message-ID: I am implementing a module in C#. This module does some comparison operations. One of the tests for this module has something like the following: class CmpErr: def __cmp__(self, other): raise ZeroDivisionError x = [CmpErr(), CmpErr(), CmpErr()] cSharpMethod(x) Inside cSharpMethod is when I do the comparison. The way I am doing the comparison is taken from how its done in List.cs IComparer comparer = PythonContext.GetContext(context).GetComparer(null, GetComparisonType(context, list)); Then I call comparer.Compare on the two items. In List.sort, this eventually calls the __cmp__ method if I try adding a call to x.sort() instead of cSharpMethod, but from inside cSharpMethod, __cmp__ is never called and I can't figure out why. Any ideas on why this might be occuring? Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Mar 25 13:29:57 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 25 Mar 2012 04:29:57 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/24/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] IronPython doesn't work right after install 2. [Status update] IronPython doesn't work right after install ---------------------------------------------- ISSUES 1. [New issue] IronPython doesn't work right after install http://ironpython.codeplex.com/workitem/32495 User eblumenfeld has proposed the issue: "Hi all, I have installed IronRuby 1.1.3 and works like a charm, I tried to install IronPython in the same computer, but gives me this message whenever I try to run ipy (even siting in the install folder): 'Failed to load language 'PythonContext;: Method not found: '!!1[] Microsoft.Scripting.Utils.ArrayUtils.ConvertAll(!!0[], System.Func `2)'."----------------- 2. [Status update] IronPython doesn't work right after install http://ironpython.codeplex.com/workitem/32495 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of [workitem:32452]" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Mon Mar 26 11:17:10 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 26 Mar 2012 02:17:10 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/25/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Tracking: Show the power/compatibility of IronPython by showing Trac running on IronPython 2. [New comment] 2.7.2.1 "load language" problem 3. [New comment] 2.7.2.1 "load language" problem ---------------------------------------------- ISSUES 1. [New comment] Tracking: Show the power/compatibility of IronPython by showing Trac running on IronPython http://ironpython.codeplex.com/workitem/9197 User slide_o_mix has commented on the issue: "Looks like trac requires expat (because trac requires genshi which requires expat). Traceback (most recent call last): File "C:\IronPython-2.7.2.1\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_ resources.py", line 318, in load_entry_point File "C:\IronPython-2.7.2.1\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_ resources.py", line 1954, in load File "C:\IronPython-2.7.2.1\lib\site-packages\trac-0.12.3-py2.7.egg\trac\admin \__init__.py", line 14, in File "C:\IronPython-2.7.2.1\lib\site-packages\trac-0.12.3-py2.7.egg\trac\admin \api.py", line 19, in File "C:\IronPython-2.7.2.1\lib\site-packages\trac-0.12.3-py2.7.egg\trac\util\ __init__.py", line 35, in File "C:\IronPython-2.7.2.1\lib\site-packages\trac-0.12.3-py2.7.egg\trac\util\ text.py", line 30, in File "C:\IronPython-2.7.2.1\Scripts\trac-admin", line 7, in File "C:\IronPython-2.7.2.1\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_ resources.py", line 2221, in load_entry_point File "C:\IronPython-2.7.2.1\lib\site-packages\trac-0.12.3-py2.7.egg\trac\util\ translation.py", line 19, in File "C:\IronPython-2.7.2.1\lib\site-packages\genshi-0.6-py2.7.egg\genshi\__in it__.py", line 26, in File "C:\IronPython-2.7.2.1\lib\site-packages\genshi-0.6-py2.7.egg\genshi\inpu t.py", line 22, in ImportError: cannot import expat from xml.parsers"----------------- 2. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User jdhardy has commented on the issue: "Do you have IronRuby installed by any chance? Which versions?"----------------- 3. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User MarkusSchaber has commented on the issue: "IronRuby or any other package which comes with IronPython. If you don't find a clean way to uninstall the DLLs, try to get an unrestricted administrator shell, and delete/move/rename the dll file inside your GACs directory tree. (It is an unclean way which may break some other things, but it works to ensure that a certain DLL is not in the GAC any more.)" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremie.laval at gmail.com Tue Mar 27 11:00:54 2012 From: jeremie.laval at gmail.com (=?ISO-8859-1?Q?J=E9r=E9mie_Laval?=) Date: Tue, 27 Mar 2012 10:00:54 +0100 Subject: [Ironpython-users] [Mono-dev] Summer of Code: Student Proposals Now Being Accepted In-Reply-To: References: Message-ID: Hi everyone, Student proposals are now being accepted for Google Summer of Code! You can find a proposal template at the Mono SoC page ( http://www.google-melange.com/gsoc/org/google/gsoc2012/mono). This template has been updated to provide more guidance on the info you should include on your application, so check it out before you submit your proposal. Good luck! andreia gaita -------------------- blog.worldofcoding.com andreiagaita.net github.com/andreiagaita _______________________________________________ Mono-devel-list mailing list Mono-devel-list at lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Tue Mar 27 17:47:19 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 27 Mar 2012 08:47:19 -0700 Subject: [Ironpython-users] [main] -X:Sandbox command line argument (#61) In-Reply-To: References: Message-ID: Moving this to the mailing list.... Are you (the OP) developing something that is going to run in ASP.NET? For this type of thing, I believe you can host the ASP.NET runtime in an application, so that may be the way to go for that. slide On Tue, Mar 27, 2012 at 8:14 AM, Jeff Hardy < reply+i-3734327-e72caf099069ec510a8bcf5eda4b8e84f5c86061-55871 at reply.github.com > wrote: > Sorry about that, I've been busy the last couple of days. > > I think it's a feature that would be really useful, but without knowing > how to extend it to cover different sandboxes it would be best to hold off. > What you can do is create a new branch in your git repo, push it to github, > and then if if you (or someone else) gets ambitious they can take it up and > run with it. > > If you need some help with the git commands let me know. I'm going to > close this for now, but I really do appreciate the work you've put into > this. I just don't think the problem space is understood well enough to > implement it yet. > > --- > Reply to this email directly or view it on GitHub: > https://github.com/IronLanguages/main/pull/61#issuecomment-4718614 > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue Mar 27 18:58:37 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 27 Mar 2012 09:58:37 -0700 Subject: [Ironpython-users] [Mono-dev] Summer of Code: Student Proposals Now Being Accepted In-Reply-To: References: Message-ID: Also, the IronPython ideas page is at https://github.com/IronLanguages/main/wiki/IronPython-GSoC-2012-Ideas. If you want to be a mentor, you need to apply for that as well, from the link that J?r?mie gave. - Jeff 2012/3/27 J?r?mie Laval : > Hi everyone, > > Student proposals are now being accepted for Google Summer of Code! > > You can find a proposal template at the Mono SoC page > (http://www.google-melange.com/gsoc/org/google/gsoc2012/mono). > > This template has been updated to provide more guidance on the info you > should include on your application, so check it out before you submit your > proposal. > > Good luck! > > andreia gaita > -------------------- > blog.worldofcoding.com > andreiagaita.net > github.com/andreiagaita > > > _______________________________________________ > Mono-devel-list mailing list > Mono-devel-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From jdhardy at gmail.com Tue Mar 27 21:23:43 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 27 Mar 2012 12:23:43 -0700 Subject: [Ironpython-users] GSoC Mentors Message-ID: Hi all, IronPython needs at least three mentors to work with the PSF. Alex and I are two; if anyone is interested in being a mentor, send me an email (off-list) with your email, IM (if any), and phone number. - Jeff From lady_radsu at yahoo.com Wed Mar 28 00:50:44 2012 From: lady_radsu at yahoo.com (surangika ranathunga) Date: Tue, 27 Mar 2012 15:50:44 -0700 (PDT) Subject: [Ironpython-users] System.InsufficientMemoryException when calling a python method Message-ID: <1332888644.43883.YahooMailNeo@web122203.mail.ne1.yahoo.com> Hi All, I am using Ironpython to call a python method from my C# class. This is how i call the python method. ?ScriptScope scope = runtime.CreateScope(); ops = engine.Operations; ?ScriptSource source = engine.CreateScriptSourceFromFile("nlp.py"); source.Execute(scope); ?object klass = scope.GetVariable("nlp"); object instance = ops.Invoke(klass); method = ops.GetMember(instance, "identify_dtag"); object[] parameters = new object[1]; parameters[0] = line; object output = ops.Invoke(method, parameters); return output.ToString();? Error occurs atobject output = ops.Invoke(method, parameters);? line. In this python method, I am calling a method in the NLTK toolkit. System configurations: Ironpython 2.7, python 2.6, C# 4.0 This is called in a threaded environment. However, currently only one thread is active. Hope someone can help me out. Here is the stack trace: System.InsufficientMemoryException: Exception of type 'System.InsufficientMemory Exception' was thrown. ?? at NumpyDotNet.NpyCoreApi.CheckError() ?? at NumpyDotNet.NpyCoreApi.DescrFromType(NPY_TYPES type) ?? at NumpyDotNet.NpyDescr.ConvertSimpleString(CodeContext cntx, String s, Byteendian) ?? at NumpyDotNet.NpyDescr.ConvertSimpleString(CodeContext cntx, String s) ?? at NumpyDotNet.NpyDescr.DescrConverter(CodeContext cntx, Object obj, Booleanalign) ?? at NumpyDotNet.ndarray.Construct(CodeContext cntx, Object shape, Object dtype, Object buffer, Object offset, Object strides, Object order) ?? at NumpyDotNet.ndarray.__new__(CodeContext cntx, PythonType cls, Object shape, Object dtype, Object buffer, Object offset, Object strides, Object order) ?? at NumpyDotNet.ModuleMethods._reconstruct(CodeContext cntx, PythonType subtype, Object shape, Object dtype) ?? at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) ?? at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) ?? at CallSite.Target(Closure , CallSite , CodeContext , Object , Object[] ) ?? at IronPython.Runtime.PythonContext.CallSplat(Object func, Object[] args) ?? at IronPython.Modules.PythonPickle.UnpicklerObject.LoadReduce(CodeContext context) ?? at IronPython.Modules.PythonPickle.UnpicklerObject.load(CodeContext context) ?? at IronPython.Modules.PythonPickle.load(CodeContext context, Object file) ?? at Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) ?? at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) ?? at IronPython.Runtime.PythonFunction.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0) ?? at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) ?? at IronPython.Compiler.PythonCallTargets.OriginalCallTarget6(PythonFunction function, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object ?arg5) ?? at IronPython.Runtime.PythonFunction.FunctionCaller`1.Default5Call1(CallSitesite, CodeContext context, Object func, T0 arg0) ?? at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) ?? at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0) ?? at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) ?? at IronPython.Compiler.PythonCallTargets.OriginalCallTarget1(PythonFunction function, Object arg0) ?? at IronPython.Runtime.PythonFunction.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0) ?? at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) ?? at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrameframe) ?? at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) ?? at IronPython.Compiler.PythonCallTargets.OriginalCallTarget2(PythonFunction function, Object arg0, Object arg1) ?? at IronPython.Runtime.PythonFunction.FunctionCaller`2.Call2(CallSite site, CodeContext context, Object func, T0 arg0, T1 arg1) ?? at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) ?? at CallSite.Target(Closure , CallSite , Object , Object ) ?? at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) ?? at lambda_method(Closure , DynamicOperations , CallSiteBinder , Object , Object[] ) ?? at Microsoft.Scripting.Runtime.DynamicOperations.Invoke(Object obj, Object[]parameters) ?? at Microsoft.Scripting.Hosting.ObjectOperations.Invoke(Object obj, Object[] parameters) ?? at SL_LIBOMV_Connector.DtagGenerator.IdentifyDtag(String line) in D:\PhD Work\Research\libomv\test\SL_LIBOMV_Connector OVH-NLP\SL_LIBOMV_Connector\DtagGenera tor.cs:line 67 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 28 01:29:57 2012 From: cmello at gmail.com (Cesar Mello) Date: Tue, 27 Mar 2012 20:29:57 -0300 Subject: [Ironpython-users] [main] -X:Sandbox command line argument (#61) In-Reply-To: References: Message-ID: Hi, Our product is not related to ASP.NET. We only need users to script calculations in a safe environment. They should not be able to run native code, access the filesystem or do any other harm to the application. The default InternetZone permission set seems to be nice for that. The calculations run fine, except for the decimal module. The whole idea to have sandbox in ipy.exe was just to make it easier to debug, test and reproduce any problems. I just scratched the app domain setup in pull request 61. But this is only a small first step I thought about to start people looking at what needs to be changed. For example, should the access to IronPython.Runtime.PythonContext. be refactored, or should its reference be marshaled accross app domains? Unfortunately I don't have enough knowledge to do this kind of refactor alone, or at least I don't think the time I would need to implement this alone would pay off... So my question is: is there anyone else interested in implementing sandbox in ipy.exe? If there is more interest, I'll do a branch and we can work together. Thank you a lot for the attention. Best regards Mello On Tue, Mar 27, 2012 at 12:47 PM, Slide wrote: > Moving this to the mailing list.... > > Are you (the OP) developing something that is going to run in ASP.NET? > For this type of thing, I believe you can host the ASP.NET runtime in an > application, so that may be the way to go for that. > > slide > > > On Tue, Mar 27, 2012 at 8:14 AM, Jeff Hardy < > reply+i-3734327-e72caf099069ec510a8bcf5eda4b8e84f5c86061-55871 at reply.github.com > > wrote: > >> Sorry about that, I've been busy the last couple of days. >> >> I think it's a feature that would be really useful, but without knowing >> how to extend it to cover different sandboxes it would be best to hold off. >> What you can do is create a new branch in your git repo, push it to github, >> and then if if you (or someone else) gets ambitious they can take it up and >> run with it. >> >> If you need some help with the git commands let me know. I'm going to >> close this for now, but I really do appreciate the work you've put into >> this. I just don't think the problem space is understood well enough to >> implement it yet. >> >> --- >> Reply to this email directly or view it on GitHub: >> https://github.com/IronLanguages/main/pull/61#issuecomment-4718614 >> > > > > -- > Website: http://earl-of-code.com > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Wed Mar 28 01:32:51 2012 From: cmello at gmail.com (Cesar Mello) Date: Tue, 27 Mar 2012 20:32:51 -0300 Subject: [Ironpython-users] [main] -X:Sandbox command line argument (#61) In-Reply-To: References: Message-ID: And hey if there is no one interested, no problem: I'll start filling work items for the issues using small programs to reproduce. For example, the problem with the decimal module when running with Internet Zone permissions. And then I'll do my best to help fixing those issues. Best regards! Mello On Tue, Mar 27, 2012 at 8:29 PM, Cesar Mello wrote: > Hi, > > Our product is not related to ASP.NET. We only need users to script > calculations in a safe environment. They should not be able to run native > code, access the filesystem or do any other harm to the application. > > The default InternetZone permission set seems to be nice for that. The > calculations run fine, except for the decimal module. The whole idea to > have sandbox in ipy.exe was just to make it easier to debug, test and > reproduce any problems. > > I just scratched the app domain setup in pull request 61. > But this is only a small first step I thought about to start people looking > at what needs to be changed. For example, should the access to > IronPython.Runtime.PythonContext. be refactored, or should its reference > be marshaled accross app domains? Unfortunately I don't have enough > knowledge to do this kind of refactor alone, or at least I don't think the > time I would need to implement this alone would pay off... So my question > is: is there anyone else interested in implementing sandbox in ipy.exe? If > there is more interest, I'll do a branch and we can work together. > > Thank you a lot for the attention. > > Best regards > Mello > > > On Tue, Mar 27, 2012 at 12:47 PM, Slide wrote: > >> Moving this to the mailing list.... >> >> Are you (the OP) developing something that is going to run in ASP.NET? >> For this type of thing, I believe you can host the ASP.NET runtime in an >> application, so that may be the way to go for that. >> >> slide >> >> >> On Tue, Mar 27, 2012 at 8:14 AM, Jeff Hardy < >> reply+i-3734327-e72caf099069ec510a8bcf5eda4b8e84f5c86061-55871 at reply.github.com >> > wrote: >> >>> Sorry about that, I've been busy the last couple of days. >>> >>> I think it's a feature that would be really useful, but without knowing >>> how to extend it to cover different sandboxes it would be best to hold off. >>> What you can do is create a new branch in your git repo, push it to github, >>> and then if if you (or someone else) gets ambitious they can take it up and >>> run with it. >>> >>> If you need some help with the git commands let me know. I'm going to >>> close this for now, but I really do appreciate the work you've put into >>> this. I just don't think the problem space is understood well enough to >>> implement it yet. >>> >>> --- >>> Reply to this email directly or view it on GitHub: >>> https://github.com/IronLanguages/main/pull/61#issuecomment-4718614 >>> >> >> >> >> -- >> Website: http://earl-of-code.com >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Mar 28 09:51:49 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 28 Mar 2012 00:51:49 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/27/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] pyc.py: generates exes which fail on using std python libs 2. [New comment] 2.7.2.1 "load language" problem ---------------------------------------------- ISSUES 1. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "Got a bit further. This latest package is able to get at the packages __init__.py files too and tries m.n....mm.nn.py as well as m.n....mm.py or similarly for __init__.py So I get many more of the needed module... However, if I generate pyc.exe using ipy pyc.py ..... the generated executable seems to contain the needed modules but fails to work as expected. Further I get no errors.... So at this stage I am a bit lost.... I am not claiming this code is the cleanest.... On the samples I tried, it seems that one quickly pulls in quite a lot of the std lib... Making me wonder if, indeed packaging the whole of the stdlib in zip file would not just be right... But is it possible to package this also in the generated executable. My hope is really to get to a single .exe that contains all that's needed.... "----------------- 2. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User eblumenfeld has commented on the issue: "I'm having the same issue... In the GAC I have both IronRuby and IronPython Could be possible that the issue has to do with Microsoft.Dynamic and Microsoft.Scripting dll's, that may be in common between both languages in my case (Win 7) in the GAC the ones that are there date from IronRuby install..." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Mar 29 09:52:07 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 29 Mar 2012 00:52:07 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/28/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] datetime does not handle reverse comparisons correctly 2. [Status update] datetime does not handle reverse comparisons correctly 3. [Status update] Implement rest of datetime module 4. [New comment] [2.7 Beta 2] deepcopy(time(9, 0)) != time(9, 0) 5. [New issue] Restricted AppDomain and os.py module 6. [New comment] pyc.py: generates exes which fail on using std python libs 7. [New comment] pyc.py: generates exes which fail on using std python libs ---------------------------------------------- ISSUES 1. [New issue] datetime does not handle reverse comparisons correctly http://ironpython.codeplex.com/workitem/32501 User jdhardy has proposed the issue: "date can properly handle comparisons such as 'dt == []', but '[] == dt' is incorrect (get NotImplemented, should raise TypeError). I don't think the issue lies with datetime; I think that comparisons aren't quite right for the other types ((), [], {})."----------------- 2. [Status update] datetime does not handle reverse comparisons correctly http://ironpython.codeplex.com/workitem/32501 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "It helps if the branch I'm working in isn't buggy. Whoops."----------------- 3. [Status update] Implement rest of datetime module http://ironpython.codeplex.com/workitem/17470 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "__rdiv__ and __rfloordiv__ are also spurious. Marking this one closed; it's been done for a while."----------------- 4. [New comment] [2.7 Beta 2] deepcopy(time(9, 0)) != time(9, 0) http://ironpython.codeplex.com/workitem/30274 User jdhardy has commented on the issue: "Fixed in 020ef3a. (I promise the next one won't take a year.)"----------------- 5. [New issue] Restricted AppDomain and os.py module http://ironpython.codeplex.com/workitem/32502 User FrankSch1 has proposed the issue: "Hi, it seams that importing os.py in an restricted AppDomain fails with some error in WeakRef. Sample code: using System; using System.Collections.Generic; using System.IO; using System.Security; using System.Security.Policy; using System.Security.Permissions; using System.Reflection; using Microsoft.Scripting.Hosting; using IronPython.Hosting; namespace SimpleAD { class Program { static void Main(string[] args) { string pyLibPath = @""; string code = @" print 'Importing sys and addding lib path' import sys sys.path.append('"+pyLibPath+@"') print 'Importing os' import os print 'OS Name',os.name print 'Done' "; StrongName fullTrustAssembly = typeof(Program).Assembly.Evidence.GetHostEvidence(); Evidence evi = AppDomain.CurrentDomain.Evidence; AppDomainSetup adSetup = new AppDomainSetup(); adSetup.ApplicationBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); /* THIS IS WORKING ! PermissionSet permSet = new PermissionSet(PermissionState.Unrestricted); */ PermissionSet permSet = new PermissionSet(PermissionState.None); permSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); permSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted)); FileIOPermission libPerm = new FileIOPermission(PermissionState.None); libPerm.AddPathList(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, adSetup.ApplicationBase); // Assembly Path libPerm.AddPathList(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, pyLibPath); // Iron-Python Lib Path permSet.AddPermission(libPerm); AppDomain restricted = AppDomain.CreateDomain("Sandbox",evi,adSetup,permSet,fullTrustAssembly); Dictionary options = new Dictionary(); ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(options); ScriptRuntime runtime = ScriptRuntime.CreateRemote(restricted, setup); ScriptEngine engine = runtime.GetEngine("Python"); try { engine.Execute(code); } catch (Exception e) { (new PermissionSet(PermissionState.Unrestricted)).Assert(); Console.WriteLine("Error:" + e.ToString()); CodeAccessPermission.RevertAssert(); } Console.ReadLine(); } } } This is the exception which seams to point at the root cause of the issue: [System.Security.SecurityException] = {"Request failed."} at Microsoft.Scripting.Utils.WeakHandle..ctor(Object target, Boolean trackResurrection) at IronPython.Runtime.WeakRefTracker.CallbackInfo..ctor(Object callback, Object weakRef) at IronPython.Runtime.WeakRefTracker.ChainCallback(Object callback, Object weakRef) at IronPython.Runtime.WeakRefTracker..ctor(Object callback, Object weakRef) at IronPython.Modules.PythonWeakRef.WeakRefHelpers.InitializeWeakRef(Object self, Object target, Object callback) at IronPython.Modules.PythonWeakRef.ref..ctor(Object object, Object callback) at IronPython.Modules.PythonWeakRef.ref..ctor(Object object) at IronPython.Modules.PythonWeakRef.ref.__new__(CodeContext context, PythonType cls, Object object) at System.Func`4.Invoke(T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)"----------------- 6. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User slide_o_mix has commented on the issue: "So you think it would be good to have a way of embedding the stdlib as a zip into the executable instead of compiling it all up?"----------------- 7. [New comment] pyc.py: generates exes which fail on using std python libs http://ironpython.codeplex.com/workitem/32420 User ddewaleffe has commented on the issue: "My primary concern is to be able to produce a real standalone exe. 1 file to copy somewhere. No requirement to copy/install anything else. Dont care if big... This first trial I made sort of partly work. For instance it works on: import os.path print "Hello" print os.path.realpath('.') print "running on", os.name print "Bye" But it does not (no error message at all) for pyc.py. Don't know why at the moment. It surely worth looking at why it fails.... Looking at the list of dependencies pulled in in each case, they are many.... so why not include the whole of stdlib at once instead of trying to analyze it by parsing at every compilation. This compiled version could be cached to avoid doing it every time... Now we have 2 ways to do this: a. package the zip file and rely on zimpimport doing its work b. compile all the files of the library and package them all in the executable" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Fri Mar 30 05:48:47 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 29 Mar 2012 20:48:47 -0700 Subject: [Ironpython-users] Why does this happen? In-Reply-To: References: Message-ID: Is Dino on vacation? He usually has good answers for these sorts of things :-) I still can't get the callsite to end up calling __cmp__ like List.sort does. I'm not sure why that is the case. It looks like even the Python version of bisect has a similar issue though (it never calls __cmp__ either), so I think there is a bug somewhere. On Sat, Mar 24, 2012 at 8:51 PM, Slide wrote: > > I am implementing a module in C#. This module does some comparison operations. One of the tests for this module has something like the following: > > class CmpErr: > ? ? def __cmp__(self, other): > ? ? ? ? raise ZeroDivisionError > > x = [CmpErr(), CmpErr(), CmpErr()] > cSharpMethod(x) > > Inside cSharpMethod is when I do the comparison. The way I am doing the comparison is taken from how its done in List.cs > > IComparer?comparer?=?PythonContext.GetContext(context).GetComparer(null,?GetComparisonType(context,?list)); > > Then I call comparer.Compare on the two items. In List.sort, this eventually calls the __cmp__ method if I try adding a call to x.sort() instead of cSharpMethod, but from inside cSharpMethod, __cmp__ is never called and I can't figure out why. > > Any ideas on why this might be occuring? > > Thanks, > > slide > > -- > Website:?http://earl-of-code.com -- Website:?http://earl-of-code.com From rome at Wintellect.com Fri Mar 30 05:57:24 2012 From: rome at Wintellect.com (Keith Rome) Date: Fri, 30 Mar 2012 03:57:24 +0000 Subject: [Ironpython-users] Detecting source code origination in SetTrace() callbacks Message-ID: <4C554C3A47C5024ABDE00E94DA17BC4D01E57D@BY2PRD0710MB389.namprd07.prod.outlook.com> In our live debugger implementation, I call SetTrace() to hook a TracebackDelegate for processing breakpoints, updating stack frame UI, inspecting watches, etc. I depend on information such as "(int)frame.f_lineno" to track the current execution pointer (and therefore which line to highlight in the source code), and "result" to determine if this was a stack push/pop or not. This works beautifully as long as execution never leaves the current script source. However, when a function is called that references code in some other compiled script source, it will report the line_no from the called script. This causes the "current line" indicator to hop around in our source editor UI, seemingly randomly, because those line_no values are only meaningful in the called function's source script. I do have a solution for this currently. I check the "frame.f_code" on each call to my trace delegate, and compare it to the one that was captured on the very first call of the trace delegate after starting execution of our debugger. This way, I can detect when the runtime is executing a line of code from some other script source (and therefore can know that execution is currently in "external code"). But it isn't as simple as it sounds. I end up casting "frame.f_code" as IronPython.Runtime.FunctionCode, and then I can walk down the property lineage of FunctionCode.PythonCode.GlobalParent.Document. The Document of two compiled scripts will always be different. Note that all of our scripts are compiled from in-memory strings... nothing is ever loaded from .py files. So this was the only way I could find to compare two "frame" values to determine if they originated from the same script. The gotcha is that FunctionCode.PythonCode, Node.GlobalParent, and PythonAst.Document are all internal properties. I can't get to those properties without using Reflection (which is not possible for our scenario). So I have customized our version of IronPython by adding the following simple class to IronPython.dll: using IronPython.Runtime; namespace IronPython { /// /// Provides Assistance to Runtime Debugger Tools. This class is not a part of the standard Python runtime. /// public static class RuntimeDebuggerHelper { /// /// Compares a function to another, returns true if they originate from the same source code document. /// /// /// /// public static bool CompareCodeOrigination(FunctionCode sourceFunction, FunctionCode targetFunction) { var sourceDocument = sourceFunction.PythonCode.GlobalParent.Document; var targetDocument = targetFunction.PythonCode.GlobalParent.Document; return sourceDocument == targetDocument; } } } This works fine, but I would really prefer to not need to customize our distribution. Is there a better way to solve this problem? Or failing that, is this the type of update that could ever make its way back into the main distribution? Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Fri Mar 30 06:15:04 2012 From: rome at Wintellect.com (Keith Rome) Date: Fri, 30 Mar 2012 04:15:04 +0000 Subject: [Ironpython-users] NuGet packaging of IronPython Message-ID: <4C554C3A47C5024ABDE00E94DA17BC4D01E5D6@BY2PRD0710MB389.namprd07.prod.outlook.com> I have a few questions about the contents of the NuGet packages for IronPython. They seem to be up-to-date since the current version listed is 2.7.2 from 3/13. It looks like JD Hardy is the "owner" of both distributions, but I am not sure if he is the one that actually deploys them. And these things might just be common knowledge that I am unaware of... 1. Does this include the Silverlight build? 2. I see there is also an "IronPython Standard Library" package listed. Is this the contents of \lib pre-compiled via pyc.py? Or is this something else entirely? And related to my first question, does it also include a Silverlight version of the binary? Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Mar 30 07:07:48 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Mar 2012 05:07:48 +0000 Subject: [Ironpython-users] Why does this happen? In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54E772E3@TK5EX14MBXC292.redmond.corp.microsoft.com> I'm actually not sure why it would happen. The only thought I have is if you're only doing one comparison, and comparing the same instance, there's an object identity test which would prevent the __cmp__ call from happening. But I'm guessing that's not what's happening... Can you put a breakpoint in PythonProtocol.Operations.cs in MakeSortComparisonRule and see what's returned from the call to bodybuilder.GetMetaObject? That'll give you the full expression tree of the rule for doing the comparison. There's supposed to be some calls to __cmp__ in there - if they're not there maybe what is will provide some enlightenment. > -----Original Message----- > From: ironpython-users-bounces+dinov=microsoft.com at python.org > [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On > Behalf Of Slide > Sent: Thursday, March 29, 2012 8:49 PM > To: ironpython-users at python.org > Subject: Re: [Ironpython-users] Why does this happen? > > Is Dino on vacation? He usually has good answers for these sorts of things :-) I > still can't get the callsite to end up calling __cmp__ like List.sort does. I'm not > sure why that is the case. It looks like even the Python version of bisect has a > similar issue though (it never calls __cmp__ either), so I think there is a bug > somewhere. > > On Sat, Mar 24, 2012 at 8:51 PM, Slide wrote: > > > > I am implementing a module in C#. This module does some comparison > operations. One of the tests for this module has something like the following: > > > > class CmpErr: > > ? ? def __cmp__(self, other): > > ? ? ? ? raise ZeroDivisionError > > > > x = [CmpErr(), CmpErr(), CmpErr()] > > cSharpMethod(x) > > > > Inside cSharpMethod is when I do the comparison. The way I am doing > > the comparison is taken from how its done in List.cs > > > > IComparer?comparer?= > > PythonContext.GetContext(context).GetComparer(null, > > GetComparisonType(context,?list)); > > > > Then I call comparer.Compare on the two items. In List.sort, this eventually > calls the __cmp__ method if I try adding a call to x.sort() instead of > cSharpMethod, but from inside cSharpMethod, __cmp__ is never called and I > can't figure out why. > > > > Any ideas on why this might be occuring? > > > > Thanks, > > > > slide > > > > -- > > Website:?http://earl-of-code.com > > > > > -- > Website:?http://earl-of-code.com > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From slide.o.mix at gmail.com Fri Mar 30 14:08:20 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 30 Mar 2012 05:08:20 -0700 Subject: [Ironpython-users] Why does this happen? In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54E772E3@TK5EX14MBXC292.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54E772E3@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: Here's the expression for my case {IIF(CallSiteBinder(Convert($arg0).__eq__(Convert(Unbox($arg1)))), 0, IIF(CallSiteBinder(op_LessThan(Convert($arg0), Convert(Unbox($arg1)))), -1, IIF(CallSiteBinder(op_GreaterThan(Convert($arg0), Convert(Unbox($arg1)))), 1, IIF((Not(((coerceResult = Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext), Convert(Unbox($arg1)))) Is OldInstance)) AndAlso ((coerceTuple = ValidateCoerceResult(coerceResult)) != null)), {var callres; ... }, Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext), Convert(Unbox($arg1))))))))} Here is the expression for the List.sort case {IIF((Not(((coerceResult = Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext), Convert($arg1))) Is OldInstance)) AndAlso ((coerceTuple = ValidateCoerceResult(coerceResult)) != null)), {var callres; ... }, Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext), Convert($arg1))))} Is there more information from the DynamicMetaObject that would be helpful? Thanks for your time, I appreciate you helping out those like me who don't know much about the internals of IronPython. slide On Thu, Mar 29, 2012 at 10:07 PM, Dino Viehland wrote: > I'm actually not sure why it would happen. ?The only thought I have is if you're > only doing one comparison, and comparing the same instance, there's an object > identity test which would prevent the __cmp__ call from happening. ?But I'm guessing > that's not what's happening... > > Can you put a breakpoint in PythonProtocol.Operations.cs in MakeSortComparisonRule > and see what's returned from the call to bodybuilder.GetMetaObject? ?That'll give you > the full expression tree of the rule for doing the comparison. ?There's supposed to be > some calls to __cmp__ in there - if they're not there maybe what is will provide some > enlightenment. > >> -----Original Message----- >> From: ironpython-users-bounces+dinov=microsoft.com at python.org >> [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On >> Behalf Of Slide >> Sent: Thursday, March 29, 2012 8:49 PM >> To: ironpython-users at python.org >> Subject: Re: [Ironpython-users] Why does this happen? >> >> Is Dino on vacation? He usually has good answers for these sorts of things :-) I >> still can't get the callsite to end up calling __cmp__ like List.sort does. I'm not >> sure why that is the case. It looks like even the Python version of bisect has a >> similar issue though (it never calls __cmp__ either), so I think there is a bug >> somewhere. >> >> On Sat, Mar 24, 2012 at 8:51 PM, Slide wrote: >> > >> > I am implementing a module in C#. This module does some comparison >> operations. One of the tests for this module has something like the following: >> > >> > class CmpErr: >> > ? ? def __cmp__(self, other): >> > ? ? ? ? raise ZeroDivisionError >> > >> > x = [CmpErr(), CmpErr(), CmpErr()] >> > cSharpMethod(x) >> > >> > Inside cSharpMethod is when I do the comparison. The way I am doing >> > the comparison is taken from how its done in List.cs >> > >> > IComparer?comparer?= >> > PythonContext.GetContext(context).GetComparer(null, >> > GetComparisonType(context,?list)); >> > >> > Then I call comparer.Compare on the two items. In List.sort, this eventually >> calls the __cmp__ method if I try adding a call to x.sort() instead of >> cSharpMethod, but from inside cSharpMethod, __cmp__ is never called and I >> can't figure out why. >> > >> > Any ideas on why this might be occuring? >> > >> > Thanks, >> > >> > slide >> > >> > -- >> > Website:?http://earl-of-code.com >> >> >> >> >> -- >> Website:?http://earl-of-code.com >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users > > -- Website:?http://earl-of-code.com From jdhardy at gmail.com Fri Mar 30 17:24:44 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 30 Mar 2012 08:24:44 -0700 Subject: [Ironpython-users] NuGet packaging of IronPython In-Reply-To: <4C554C3A47C5024ABDE00E94DA17BC4D01E5D6@BY2PRD0710MB389.namprd07.prod.outlook.com> References: <4C554C3A47C5024ABDE00E94DA17BC4D01E5D6@BY2PRD0710MB389.namprd07.prod.outlook.com> Message-ID: Hi Keith, On Thu, Mar 29, 2012 at 9:15 PM, Keith Rome wrote: > I have a few questions about the contents of the NuGet packages for > IronPython. They seem to be up-to-date since the current version listed is > 2.7.2 from 3/13. It looks like JD Hardy is the ?owner? of both > distributions, but I am not sure if he is the one that actually deploys > them. And these things might just be common knowledge that I am unaware of? That would be me :) And yes, I do own/deploy them. > 1.?????? Does this include the Silverlight build? Yes, for 4 and 5 (and .NET 4, .NET 3.5, WP71, and Android). I quickly tested with both types of projects, so it should work. > > 2.?????? I see there is also an ?IronPython Standard Library? package > listed. Is this the contents of \lib pre-compiled via pyc.py? Or is this > something else entirely? And related to my first question, does it also > include a Silverlight version of the binary? No, it's the normal standard library, although you touched on the reason why it's separate - eventually there will be compiled and zipped versions as well (I don't think pyc.py can generate Silverlight-compatible assemblies right now). It has a dependency on the other package, so installing it into your project should pull in the IronPython package as well. - Jeff From dinov at microsoft.com Sat Mar 31 02:26:42 2012 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 31 Mar 2012 00:26:42 +0000 Subject: [Ironpython-users] Why does this happen? In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54E772E3@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: <6757ED2748BC0A43B9F3E4DA32D65AB007C606@CH1PRD0310MB357.namprd03.prod.outlook.com> First off just to make your life easier in the future the DebugView property on the expression is much better than the other view - it produces something that looks like C#. Ok, I think the types are actually different and the LHS is succeeding on one of ==, <, or >. I say that because in MakeSortComparisonRule we do: if (xType == yType && cTarget != SlotOrFunction.Empty) { And if they were both old instances we'd do the ShouldCoerce check (which would be true) and we'd generate the code which looks like the list.sort() case. You can check xType and yType in the debugger. Better yet you can drill into the meta objects in the types array and see the actual values the rule is being created for. The problem type I think is xType and it's probably some IronPython runtime type (because it defines __eq__ as well as op_LessThan and op_GreaterThan). But I have no guesses as to what it is - every type I tried still went down the __cmp__ path. So look at xType and those methods... If it somehow is really an OldInstance then something really strange is going on and it'd be interesting to see if xType and yType are somehow different when they should be the same. > -----Original Message----- > From: ironpython-users-bounces+dinov=microsoft.com at python.org > [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On > Behalf Of Slide > Sent: Friday, March 30, 2012 5:08 AM > To: ironpython-users at python.org > Subject: Re: [Ironpython-users] Why does this happen? > > Here's the expression for my case > > {IIF(CallSiteBinder(Convert($arg0).__eq__(Convert(Unbox($arg1)))), 0, > IIF(CallSiteBinder(op_LessThan(Convert($arg0), > Convert(Unbox($arg1)))), -1, > IIF(CallSiteBinder(op_GreaterThan(Convert($arg0), > Convert(Unbox($arg1)))), 1, IIF((Not(((coerceResult = > Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext), > Convert(Unbox($arg1)))) Is OldInstance)) AndAlso ((coerceTuple = > ValidateCoerceResult(coerceResult)) != null)), {var callres; ... }, > Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext), > Convert(Unbox($arg1))))))))} > > Here is the expression for the List.sort case > > {IIF((Not(((coerceResult = > Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext), > Convert($arg1))) Is OldInstance)) AndAlso ((coerceTuple = > ValidateCoerceResult(coerceResult)) != null)), {var callres; ... }, > Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext), > Convert($arg1))))} > > Is there more information from the DynamicMetaObject that would be helpful? > > Thanks for your time, I appreciate you helping out those like me who don't know > much about the internals of IronPython. > > slide > > > On Thu, Mar 29, 2012 at 10:07 PM, Dino Viehland > wrote: > > I'm actually not sure why it would happen. ?The only thought I have is > > if you're only doing one comparison, and comparing the same instance, > > there's an object identity test which would prevent the __cmp__ call > > from happening. ?But I'm guessing that's not what's happening... > > > > Can you put a breakpoint in PythonProtocol.Operations.cs in > > MakeSortComparisonRule and see what's returned from the call to > > bodybuilder.GetMetaObject? ?That'll give you the full expression tree > > of the rule for doing the comparison. ?There's supposed to be some > > calls to __cmp__ in there - if they're not there maybe what is will provide some > enlightenment. > > > >> -----Original Message----- > >> From: ironpython-users-bounces+dinov=microsoft.com at python.org > >> [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On > >> Behalf Of Slide > >> Sent: Thursday, March 29, 2012 8:49 PM > >> To: ironpython-users at python.org > >> Subject: Re: [Ironpython-users] Why does this happen? > >> > >> Is Dino on vacation? He usually has good answers for these sorts of > >> things :-) I still can't get the callsite to end up calling __cmp__ > >> like List.sort does. I'm not sure why that is the case. It looks like > >> even the Python version of bisect has a similar issue though (it > >> never calls __cmp__ either), so I think there is a bug somewhere. > >> > >> On Sat, Mar 24, 2012 at 8:51 PM, Slide wrote: > >> > > >> > I am implementing a module in C#. This module does some comparison > >> operations. One of the tests for this module has something like the following: > >> > > >> > class CmpErr: > >> > ? ? def __cmp__(self, other): > >> > ? ? ? ? raise ZeroDivisionError > >> > > >> > x = [CmpErr(), CmpErr(), CmpErr()] > >> > cSharpMethod(x) > >> > > >> > Inside cSharpMethod is when I do the comparison. The way I am doing > >> > the comparison is taken from how its done in List.cs > >> > > >> > IComparer?comparer?= > >> > PythonContext.GetContext(context).GetComparer(null, > >> > GetComparisonType(context,?list)); > >> > > >> > Then I call comparer.Compare on the two items. In List.sort, this > >> > eventually > >> calls the __cmp__ method if I try adding a call to x.sort() instead > >> of cSharpMethod, but from inside cSharpMethod, __cmp__ is never > >> called and I can't figure out why. > >> > > >> > Any ideas on why this might be occuring? > >> > > >> > Thanks, > >> > > >> > slide > >> > > >> > -- > >> > Website:?http://earl-of-code.com > >> > >> > >> > >> > >> -- > >> Website:?http://earl-of-code.com > >> _______________________________________________ > >> Ironpython-users mailing list > >> Ironpython-users at python.org > >> http://mail.python.org/mailman/listinfo/ironpython-users > > > > > > > > -- > Website:?http://earl-of-code.com > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > From slide.o.mix at gmail.com Sat Mar 31 06:00:41 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 30 Mar 2012 21:00:41 -0700 Subject: [Ironpython-users] Why does this happen? In-Reply-To: <6757ED2748BC0A43B9F3E4DA32D65AB007C606@CH1PRD0310MB357.namprd03.prod.outlook.com> References: <6C7ABA8B4E309440B857D74348836F2E54E772E3@TK5EX14MBXC292.redmond.corp.microsoft.com> <6757ED2748BC0A43B9F3E4DA32D65AB007C606@CH1PRD0310MB357.namprd03.prod.outlook.com> Message-ID: The types that are being compared are as follows: class CmpErr: "Dummy element that always raises an error during comparison" def __cmp__(self, other): raise ZeroDivisionError And an Int32. The bisect test creates a list of the CmpErr objects and then tries to insert the number 10, so a CmpErr instance (OldInstance) is being compared to an Int32. The DebugView IS much easier and explains a lot about what is being generated. I need to review the semantics for the rich comparison in the CPython code, I was looking at it earlier today on my phone (which ends up not being a very good way to view code). I'll compare it to what the IronPython code is doing. Here is some code that reproduces the issue. On CPython this code prints "Pass" and on IronPython it prints "Fail" import bisect class CmpErr: "Dummy element that always raises an error during comparison" def __cmp__(self, other): raise ZeroDivisionError seq = [CmpErr(), CmpErr(), CmpErr()] try: bisect.bisect_left(seq, 10) except ZeroDivisionError: print "Pass" else: print "Fail" I'm going to file an issue on this, because its looks like a compatibility problem. Thanks, slide On Fri, Mar 30, 2012 at 5:26 PM, Dino Viehland wrote: > First off just to make your life easier in the future the DebugView > property on the expression is much better than the other view - it produces > something that looks like C#. > > Ok, I think the types are actually different and the LHS is succeeding on > one of ==, <, or >. ?I say that because in MakeSortComparisonRule we do: > > if (xType == yType && cTarget != SlotOrFunction.Empty) { > > And if they were both old instances we'd do the ShouldCoerce check (which > would be true) and we'd generate the code which looks like the list.sort() > case. ?You can check xType and yType in the debugger. ?Better yet you can > drill into the meta objects in the types array and see the actual values the > rule is being created for. > > The problem type I think is xType and it's probably some IronPython runtime > type (because it defines __eq__ as well as op_LessThan and op_GreaterThan). > But I have no guesses as to what it is - every type I tried still went down the > __cmp__ path. > > So look at xType and those methods... ?If it somehow is really an OldInstance > then something really strange is going on and it'd be interesting to see if xType > and yType are somehow different when they should be the same. > >> -----Original Message----- >> From: ironpython-users-bounces+dinov=microsoft.com at python.org >> [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On >> Behalf Of Slide >> Sent: Friday, March 30, 2012 5:08 AM >> To: ironpython-users at python.org >> Subject: Re: [Ironpython-users] Why does this happen? >> >> Here's the expression for my case >> >> {IIF(CallSiteBinder(Convert($arg0).__eq__(Convert(Unbox($arg1)))), 0, >> IIF(CallSiteBinder(op_LessThan(Convert($arg0), >> Convert(Unbox($arg1)))), -1, >> IIF(CallSiteBinder(op_GreaterThan(Convert($arg0), >> Convert(Unbox($arg1)))), 1, IIF((Not(((coerceResult = >> Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext), >> Convert(Unbox($arg1)))) Is OldInstance)) AndAlso ((coerceTuple = >> ValidateCoerceResult(coerceResult)) != null)), {var callres; ... }, >> Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext), >> Convert(Unbox($arg1))))))))} >> >> Here is the expression for the List.sort case >> >> {IIF((Not(((coerceResult = >> Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext), >> Convert($arg1))) Is OldInstance)) AndAlso ((coerceTuple = >> ValidateCoerceResult(coerceResult)) != null)), {var callres; ... }, >> Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext), >> Convert($arg1))))} >> >> Is there more information from the DynamicMetaObject that would be helpful? >> >> Thanks for your time, I appreciate you helping out those like me who don't know >> much about the internals of IronPython. >> >> slide >> >> >> On Thu, Mar 29, 2012 at 10:07 PM, Dino Viehland >> wrote: >> > I'm actually not sure why it would happen. ?The only thought I have is >> > if you're only doing one comparison, and comparing the same instance, >> > there's an object identity test which would prevent the __cmp__ call >> > from happening. ?But I'm guessing that's not what's happening... >> > >> > Can you put a breakpoint in PythonProtocol.Operations.cs in >> > MakeSortComparisonRule and see what's returned from the call to >> > bodybuilder.GetMetaObject? ?That'll give you the full expression tree >> > of the rule for doing the comparison. ?There's supposed to be some >> > calls to __cmp__ in there - if they're not there maybe what is will provide some >> enlightenment. >> > >> >> -----Original Message----- >> >> From: ironpython-users-bounces+dinov=microsoft.com at python.org >> >> [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On >> >> Behalf Of Slide >> >> Sent: Thursday, March 29, 2012 8:49 PM >> >> To: ironpython-users at python.org >> >> Subject: Re: [Ironpython-users] Why does this happen? >> >> >> >> Is Dino on vacation? He usually has good answers for these sorts of >> >> things :-) I still can't get the callsite to end up calling __cmp__ >> >> like List.sort does. I'm not sure why that is the case. It looks like >> >> even the Python version of bisect has a similar issue though (it >> >> never calls __cmp__ either), so I think there is a bug somewhere. >> >> >> >> On Sat, Mar 24, 2012 at 8:51 PM, Slide wrote: >> >> > >> >> > I am implementing a module in C#. This module does some comparison >> >> operations. One of the tests for this module has something like the following: >> >> > >> >> > class CmpErr: >> >> > ? ? def __cmp__(self, other): >> >> > ? ? ? ? raise ZeroDivisionError >> >> > >> >> > x = [CmpErr(), CmpErr(), CmpErr()] >> >> > cSharpMethod(x) >> >> > >> >> > Inside cSharpMethod is when I do the comparison. The way I am doing >> >> > the comparison is taken from how its done in List.cs >> >> > >> >> > IComparer?comparer?= >> >> > PythonContext.GetContext(context).GetComparer(null, >> >> > GetComparisonType(context,?list)); >> >> > >> >> > Then I call comparer.Compare on the two items. In List.sort, this >> >> > eventually >> >> calls the __cmp__ method if I try adding a call to x.sort() instead >> >> of cSharpMethod, but from inside cSharpMethod, __cmp__ is never >> >> called and I can't figure out why. >> >> > >> >> > Any ideas on why this might be occuring? >> >> > >> >> > Thanks, >> >> > >> >> > slide >> >> > >> >> > -- >> >> > Website:?http://earl-of-code.com >> >> >> >> >> >> >> >> >> >> -- >> >> Website:?http://earl-of-code.com >> >> _______________________________________________ >> >> Ironpython-users mailing list >> >> Ironpython-users at python.org >> >> http://mail.python.org/mailman/listinfo/ironpython-users >> > >> > >> >> >> >> -- >> Website:?http://earl-of-code.com >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > > > -- Website:?http://earl-of-code.com From no_reply at codeplex.com Sat Mar 31 09:53:17 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 31 Mar 2012 00:53:17 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 3/30/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] 2.7.2.1 "load language" problem 2. [New issue] comparison is not always compatible with CPython ---------------------------------------------- ISSUES 1. [New comment] 2.7.2.1 "load language" problem http://ironpython.codeplex.com/workitem/32452 User becio has commented on the issue: "I uninstalled IronRuby then installed again this package and all things went ok. DLL hell is still here, please check the strong names of incompatible dlls."----------------- 2. [New issue] comparison is not always compatible with CPython http://ironpython.codeplex.com/workitem/32513 User slide_o_mix has proposed the issue: "On CPython this code prints "Pass" and on IronPython it prints "Fail". import bisect class CmpErr: "Dummy element that always raises an error during comparison" def __cmp__(self, other): raise ZeroDivisionError seq = [CmpErr(), CmpErr(), CmpErr()] try: bisect.bisect_left(seq, 10) except ZeroDivisionError: print "Pass" else: print "Fail" It looks like the comparison code that is generated is not doing the correct thing compared to the rich comparison in CPython." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: