From fernandez_dan2 at hotmail.com Wed Feb 1 05:54:32 2012 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Tue, 31 Jan 2012 20:54:32 -0800 Subject: [Ironpython-users] type for unicode and str Message-ID: Hi All, I was just playing with unicode strings and I notice a difference with CPython and IronPython. On CPython 2.7.2 I get the following >>> type(u"A") >>> type("A") On Ironpython the latest 2.7.2 Alpha 1 I get the following >>> type(u"A") >>> type("A") I decided to crack open the source and see where this type function is defined. I followed to the builtin.cs with the PythonModule but I got kind lost there. If anyone can provide some helpful hints that would be great. Thanks Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Feb 1 15:55:25 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 1 Feb 2012 06:55:25 -0800 Subject: [Ironpython-users] type for unicode and str In-Reply-To: References: Message-ID: In IronPython str and unicode are the same type, which is .NET's System.String. It's easily the biggest difference between CPython 2 and IronPython. The distinction goes away for Python 3, where strings are always Unicode. - Jeff On Tue, Jan 31, 2012 at 8:54 PM, Daniel Fernandez wrote: > Hi All, > > I was just playing with unicode strings and I notice a difference with > CPython and IronPython. On CPython 2.7.2 I get the following > >>>> type(u"A") > >>>> type("A") > > > On Ironpython the latest 2.7.2 Alpha 1 I get the following > >>>> type(u"A") > >>>> type("A") > > > > I decided to crack open the source and see where this type function is > defined. I followed to the builtin.cs with the PythonModule but I got kind > lost there. If anyone can provide some helpful hints that would be great. > > Thanks > > Danny > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From chaim at chaim.com Wed Feb 1 17:01:16 2012 From: chaim at chaim.com (Chaim Krause) Date: Wed, 1 Feb 2012 10:01:16 -0600 Subject: [Ironpython-users] Looking for IronPython 2.7.x Built for Use with .NET 3.5 SP1 Message-ID: I built my program against the release of IronPython 2.7.1 and that used .NET v4. I found out now that the network I must deploy my program to before the week is over, is running .NET v3.5 SP1 and can/will not update to v4 for the foreseeable future. This means I need to use a version of IronPython that is compatible with v 3.5 or earlier, and I need it done in the next 24-48 hours. Plan A: See if I can get my app to run against an earlier version of IronPython that works with .NET v3.5. I haven't a clue how much work this would take. Plan B: Use a version of IronPython v 2.7.x built for use with .NET 3.5. I don't have the build environment set up to build this myself, and as I have never done it before, I haven't a clue how much worth this would take. So, I will begin on Plan A now and I am asking this list if anybody has a full build of IronPython v2.7.x that was built for use with .NET v 3.5. If you do have such a build, please contact me on or off list and I will make it worth your while. I guess that it would even be quicker to get somebody to build it for me who has a build environment set up already, then do it myself from scratch. So, if that is you, please contact me on or off list as well and I'll try to convince you to build it for me and I'll reward you some how. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 1 18:54:48 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 1 Feb 2012 17:54:48 +0000 Subject: [Ironpython-users] type for unicode and str In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54C7E484@TK5EX14MBXC294.redmond.corp.microsoft.com> Jeff answered the Unicode/str part, so I'll answer the following code part. Ultimately these come from the properties in Builtin.cs: public static PythonType unicode { get { return DynamicHelpers.GetPythonTypeFromType(typeof(string)); } } public static PythonType str { get { return DynamicHelpers.GetPythonTypeFromType(typeof(string)); } } Ultimately we produce a PythonModule which has a PythonDictionary. All of our dictionaries have a storage class which abstracts way how the dictionary is actually implemented. For built-in modules we have a ModuleDictionaryStorage object. The ModuleDictionaryStorage lazily reflects over the module type and caches the result. For properties it'll pull the value out the first time it's accessed. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Daniel Fernandez Sent: Tuesday, January 31, 2012 8:55 PM To: ironpython-users at python.org Subject: [Ironpython-users] type for unicode and str Hi All, I was just playing with unicode strings and I notice a difference with CPython and IronPython. On CPython 2.7.2 I get the following >>> type(u"A") >>> type("A") On Ironpython the latest 2.7.2 Alpha 1 I get the following >>> type(u"A") >>> type("A") I decided to crack open the source and see where this type function is defined. I followed to the builtin.cs with the PythonModule but I got kind lost there. If anyone can provide some helpful hints that would be great. Thanks Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaim at chaim.com Wed Feb 1 18:57:23 2012 From: chaim at chaim.com (Chaim Krause) Date: Wed, 1 Feb 2012 11:57:23 -0600 Subject: [Ironpython-users] Looking for IronPython 2.7.x Built for Use with .NET 3.5 SP1 In-Reply-To: References: Message-ID: Thanks to all on the list. Jeff Hardy hooked me up. - Chaim On Wed, Feb 1, 2012 at 10:01 AM, Chaim Krause wrote: > I built my program against the release of IronPython 2.7.1 and that used > .NET v4. I found out now that the network I must deploy my program to > before the week is over, is running .NET v3.5 SP1 and can/will not update > to v4 for the foreseeable future. This means I need to use a version of > IronPython that is compatible with v 3.5 or earlier, and I need it done in > the next 24-48 hours. > > Plan A: See if I can get my app to run against an earlier version of > IronPython that works with .NET v3.5. I haven't a clue how much work this > would take. > > Plan B: Use a version of IronPython v 2.7.x built for use with .NET 3.5. I > don't have the build environment set up to build this myself, and as I have > never done it before, I haven't a clue how much worth this would take. > > So, I will begin on Plan A now and I am asking this list if anybody has a > full build of IronPython v2.7.x that was built for use with .NET v 3.5. If > you do have such a build, please contact me on or off list and I will make > it worth your while. I guess that it would even be quicker to get somebody > to build it for me who has a build environment set up already, then do it > myself from scratch. So, if that is you, please contact me on or off list > as well and I'll try to convince you to build it for me and I'll reward you > some how. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandez_dan2 at hotmail.com Fri Feb 3 04:31:32 2012 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Thu, 2 Feb 2012 19:31:32 -0800 Subject: [Ironpython-users] type for unicode and str In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54C7E484@TK5EX14MBXC294.redmond.corp.microsoft.com> References: , <6C7ABA8B4E309440B857D74348836F2E54C7E484@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: Dino and Jeff, Thanks alot, that helped alot. I was going crazy trying to step thru the code. Danny From: dinov at microsoft.com To: fernandez_dan2 at hotmail.com; ironpython-users at python.org Subject: RE: [Ironpython-users] type for unicode and str Date: Wed, 1 Feb 2012 17:54:48 +0000 Jeff answered the Unicode/str part, so I?ll answer the following code part. Ultimately these come from the properties in Builtin.cs: public static PythonType unicode { get { return DynamicHelpers.GetPythonTypeFromType(typeof(string)); } } public static PythonType str { get { return DynamicHelpers.GetPythonTypeFromType(typeof(string)); } } Ultimately we produce a PythonModule which has a PythonDictionary. All of our dictionaries have a storage class which abstracts way how the dictionary is actually implemented. For built-in modules we have a ModuleDictionaryStorage object. The ModuleDictionaryStorage lazily reflects over the module type and caches the result. For properties it?ll pull the value out the first time it?s accessed. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Daniel Fernandez Sent: Tuesday, January 31, 2012 8:55 PM To: ironpython-users at python.org Subject: [Ironpython-users] type for unicode and str Hi All, I was just playing with unicode strings and I notice a difference with CPython and IronPython. On CPython 2.7.2 I get the following >>> type(u"A") >>> type("A") On Ironpython the latest 2.7.2 Alpha 1 I get the following >>> type(u"A") >>> type("A") I decided to crack open the source and see where this type function is defined. I followed to the builtin.cs with the PythonModule but I got kind lost there. If anyone can provide some helpful hints that would be great. Thanks Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Feb 3 10:28:29 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 3 Feb 2012 01:28:29 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] Deriving from C# class and interfaces 2. [New comment] IP 2.7.1 xml.etree.Elementree#iterparse is not working ---------------------------------------------- ISSUES 1. [New issue] Deriving from C# class and interfaces http://ironpython.codeplex.com/workitem/32166 User kvncode has proposed the issue: "With IronPython 2.6.2 I can't seem to derive from a C# base class and implement an interface. It seems in this case the property 'Name' does not get attached to the derived type as 'get_Name', which is how the interface will access the property in C#. **** C# namespace superclasstest2 { public interface IAnimal { string Name{ get; } } public class Animal { public virtual string Name { get { return "animal"; } } } public static class proc { public static string who(IAnimal animal) { return animal.Name; } } } **** IronPython import clr clr.AddReferenceToFile("superclasstest2.dll") import superclasstest2 as s class dog(s.Animal, s.IAnimal): def __new__(cls): return s.Animal.__new__(cls) def __init__(self): print "i am dog" d = dog() print dir(d) print "call",s.proc.who(d) **** Output i am dog ['Equals', 'GetHashCode', 'GetType', 'MemberwiseClone', 'Name', 'ReferenceEquals', 'ToString', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__i nit__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__'] callTraceback (most recent call last): File "", line 1, in File "C:\Workspace\KRS\myIronPython\supertest.py", line 16, in AttributeError: 'dog' object has no attribute 'get_Name'"----------------- 2. [New comment] IP 2.7.1 xml.etree.Elementree#iterparse is not working http://ironpython.codeplex.com/workitem/31923 User pekkaklarck has commented on the issue: "It is somewhat weird that this is broken because nowadays IronPython ought to contain a working elementtree implementation [1] that is also available at [2]. What is really weird that this module works fine if I install it separately. [1] http://ironpython.codeplex.com/workitem/31579 [2] http://effbot.org/zone/element-index.htm" ---------------------------------------------- ---------------------------------------------- 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 fernandez_dan2 at hotmail.com Sat Feb 4 02:00:49 2012 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Fri, 3 Feb 2012 17:00:49 -0800 Subject: [Ironpython-users] binary strings in 2.7.2 alpha? Message-ID: Hi All, I'm playing with open source package and I am getting an error with prefix "b" with a string literal with expected str and got bytes. Here is a simple example, IronPython 2.7.2 alpha I get the following >>> type(b"/") In CPython 2.7.2 I get the following >>> type(b"/") I searched for more information on this but I didn't find alot on it. I did find one site indicating that this is a python 3.0 feature, I just wanted to confirm. Thanks. Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Feb 4 02:15:19 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 3 Feb 2012 17:15:19 -0800 Subject: [Ironpython-users] binary strings in 2.7.2 alpha? In-Reply-To: References: Message-ID: On Fri, Feb 3, 2012 at 5:00 PM, Daniel Fernandez wrote: > Hi All, > > I'm playing with open source?package ?and I am getting an error with prefix > "b" with a string literal with expected str and got bytes. Here is a simple > example, IronPython 2.7.2 alpha I get the following > >>>> type(b"/") > > > In CPython 2.7.2 I get the following > >>>> type(b"/") > > > I searched for more information on this but I didn't find alot?on it.?I did > find one site?indicating that this is a python 3.0 feature, I just wanted to > confirm. Yeah, IronPython returns bytes for b'' (like Python 3) because its strings are unicode. On the plus side, it means that what you're testing probably has some changes to be made for Python 3 support. - Jeff From dinov at microsoft.com Sat Feb 4 02:13:58 2012 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 4 Feb 2012 01:13:58 +0000 Subject: [Ironpython-users] binary strings in 2.7.2 alpha? In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54C84D3E@TK5EX14MBXC294.redmond.corp.microsoft.com> This is back to the unicode vs str difference. In addition to Unicode and str being the same starting with IronPython 2.6 we added the bytes type (matching the alias of bytes -> str that CPython added) and made the b'' syntax construct a bytes object. The bytes type works like CPython 2.x's str type. In general when it comes to strings IronPython is like Python 3.x. But there's still some small differences, like indexing into bytes works like CPython 2.x returning a single-char string instead of the ordinal value like Python 3.x. Unfortunately this is IronPython's biggest compatibility minefield :( From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Daniel Fernandez Sent: Friday, February 03, 2012 5:01 PM To: ironpython-users at python.org Subject: [Ironpython-users] binary strings in 2.7.2 alpha? Hi All, I'm playing with open source package and I am getting an error with prefix "b" with a string literal with expected str and got bytes. Here is a simple example, IronPython 2.7.2 alpha I get the following >>> type(b"/") In CPython 2.7.2 I get the following >>> type(b"/") I searched for more information on this but I didn't find alot on it. I did find one site indicating that this is a python 3.0 feature, I just wanted to confirm. Thanks. Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandez_dan2 at hotmail.com Sat Feb 4 02:39:25 2012 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Fri, 3 Feb 2012 17:39:25 -0800 Subject: [Ironpython-users] binary strings in 2.7.2 alpha? In-Reply-To: References: , Message-ID: I was trying to get Requests package to work with IronPython. I just briefly started playing with it and I like the HTTP api syntax. I'm actually starting to look for open source python packages instead of .NET :) Well its been a good learning opportunity navagating thru the IronPython internals. Thanks Danny > Date: Fri, 3 Feb 2012 17:15:19 -0800 > Subject: Re: [Ironpython-users] binary strings in 2.7.2 alpha? > From: jdhardy at gmail.com > To: fernandez_dan2 at hotmail.com > CC: ironpython-users at python.org > > On Fri, Feb 3, 2012 at 5:00 PM, Daniel Fernandez > wrote: > > Hi All, > > > > I'm playing with open source package and I am getting an error with prefix > > "b" with a string literal with expected str and got bytes. Here is a simple > > example, IronPython 2.7.2 alpha I get the following > > > >>>> type(b"/") > > > > > > In CPython 2.7.2 I get the following > > > >>>> type(b"/") > > > > > > I searched for more information on this but I didn't find alot on it. I did > > find one site indicating that this is a python 3.0 feature, I just wanted to > > confirm. > > Yeah, IronPython returns bytes for b'' (like Python 3) because its > strings are unicode. On the plus side, it means that what you're > testing probably has some changes to be made for Python 3 support. > > - Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Feb 4 21:24:18 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 4 Feb 2012 12:24:18 -0800 Subject: [Ironpython-users] binary strings in 2.7.2 alpha? In-Reply-To: References: Message-ID: On Fri, Feb 3, 2012 at 5:39 PM, Daniel Fernandez wrote: > I was?trying?to get?Requests package to work with IronPython. I?just briefly > started playing with it and I like the HTTP api syntax.??I'm actually > starting to look for open source python packages instead of .NET :)? Well > its been a good learning opportunity navagating thru the IronPython > internals. Did you manage to get it to work? I'm pretty sure newer versions of requests support Python 3, so it should be possible. - Jeff From fernandez_dan2 at hotmail.com Sat Feb 4 23:08:08 2012 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Sat, 4 Feb 2012 14:08:08 -0800 Subject: [Ironpython-users] binary strings in 2.7.2 alpha? In-Reply-To: References: , , , Message-ID: Hi Jeff, Kind of. I ran into the first error that IronPython 2.7.2 didn't support idna encoding. I just added code to the StringOps.cs in the RawDecode and RawEncode to support idna. It was a small change just made calls using System.Globalization.IdnMappings class. The issue with this that the Silverlight build would fail. The Silverlight project refeences a mscorlib.dll that doesn't support this System.Globalization.IdnMappings class. I added a conditional complition so it wasn't used in the Silverlight build so I get it to build successfully. The next issue was the binary strings. It was failing with the statement path.split(b"/") and received and error expected str got bytes. I had to remove this binary strings (only a few places) from the script to get it to work. I only done a few tests nothing major but the HTTP GETs seem to be working but I ran into an issue with the SSL certification for HTTPS GET call that I haven't figured out it yet. I haven't done any POSTs yet. Danny > Date: Sat, 4 Feb 2012 12:24:18 -0800 > Subject: Re: [Ironpython-users] binary strings in 2.7.2 alpha? > From: jdhardy at gmail.com > To: fernandez_dan2 at hotmail.com > CC: ironpython-users at python.org > > On Fri, Feb 3, 2012 at 5:39 PM, Daniel Fernandez > wrote: > > I was trying to get Requests package to work with IronPython. I just briefly > > started playing with it and I like the HTTP api syntax. I'm actually > > starting to look for open source python packages instead of .NET :) Well > > its been a good learning opportunity navagating thru the IronPython > > internals. > > Did you manage to get it to work? I'm pretty sure newer versions of > requests support Python 3, so it should be possible. > > - Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Feb 5 11:54:32 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 5 Feb 2012 02:54:32 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] Booleans get converted to ints by str.format 2. [New comment] Connot convert directly from System.Decimal to decimal.Decimal ---------------------------------------------- ISSUES 1. [New comment] Booleans get converted to ints by str.format http://ironpython.codeplex.com/workitem/30412 User jdhardy has commented on the issue: "Fixed in 0849c31."----------------- 2. [New comment] Connot convert directly from System.Decimal to decimal.Decimal http://ironpython.codeplex.com/workitem/18220 User jdhardy has commented on the issue: "Fixed in 21e56eb/de8dfbf." ---------------------------------------------- ---------------------------------------------- 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 nokia1 at gmail.com Sun Feb 5 14:05:57 2012 From: nokia1 at gmail.com (Cash) Date: Sun, 5 Feb 2012 13:05:57 +0000 Subject: [Ironpython-users] Exception handling in VS 2008 Message-ID: Hi, I'm getting issues with try / except blocks in VS 2008, particularly with the following way of catching the errors: try: something except Error as e: do something with e When I try this directly from the IPY console it works fine: >>> try: ... open(fakefile.txt) ... except NameError as e: ... print 'E is: ' + `e` ... E is: NameError("name 'fakefile' is not defined",) When entering the same code into Visual Studio 2008, it doesn?t like the syntax at all and highlights the 'as e' part as a syntax error. Has anyone seen this before and know a way around it at all please? As it works in the IPY console and is valid Python, I'm presuming it is a bug within VS? Thanks, B -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Feb 6 19:01:05 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 6 Feb 2012 10:01:05 -0800 Subject: [Ironpython-users] Exception handling in VS 2008 In-Reply-To: References: Message-ID: The VS2008 integration is old, awful, was built by the VS Integration team and not the IronPython team, and based in IronPython 1.0. That version of IronPython predates the `except ... as ...:` syntax, which is why it's a syntax error. You can run Python Tools for Visual Studio (pytools.codeplex.com) using the free VS 2010 Integrated shell, which is a much better experience if you're only doing Python (mixed projects are a different story - you'll need the full VS 2010 for that). - Jeff On Sun, Feb 5, 2012 at 5:05 AM, Cash wrote: > Hi, > > > > I'm getting issues with try / except blocks in VS 2008, particularly with > the following way of catching the errors: > > > > try: > > ??? something > > except Error as e: > > ??? do something with e > > > > > > When I try this directly from the IPY console it works fine: > > > >>>> try: > ...???????? open(fakefile.txt) > ...???? except NameError as e: > ...???????? print 'E is: ' + `e` > ... > E is: NameError("name 'fakefile' is not defined",) > > > > When entering the same code into Visual Studio 2008, it doesn?t like the > syntax at all and highlights the 'as e' part as a syntax error. > > > > Has anyone seen this before and know a way around it at all please? As it > works in the IPY console and is valid Python, I'm presuming it is a bug > within VS? > > > > Thanks, > > > > B > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From no_reply at codeplex.com Tue Feb 7 16:10:27 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 7 Feb 2012 07:10:27 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/6/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 should skip leading NLToken's in interactive code 2. [New issue] Unable to pass None to a function that accepts another type ---------------------------------------------- ISSUES 1. [New issue] IronPython should skip leading NLToken's in interactive code http://ironpython.codeplex.com/workitem/32188 User dinov has proposed the issue: ">>> import tokenize, cStringIO >>> tokenize.tokenize(cStringIO.StringIO('#foo\n1+2').readline) 1,0-1,4: COMMENT '#foo' 1,4-1,5: NL '\n' 2,0-2,1: NUMBER '1' 2,1-2,2: OP '+' 2,2-2,3: NUMBER '2' 3,0-3,0: ENDMARKER '' This shows that a line of input which first contains a comment line and then contains an expression statement gets tokenized to include a NL token followed by the rest of the expression. IronPython's tokenizer will actually return newline token's here, which is wrong. Instead it should also start off in a "last new line" state so that the initial newlines get reported as NL tokens. Then the parser needs to be updated to ignore them at the beginning: Whenever IronPython's starts parsing it should eat any leading new lines. See also http://pytools.codeplex.com/workitem/649"----------------- 2. [New issue] Unable to pass None to a function that accepts another type http://ironpython.codeplex.com/workitem/32192 User HarryTuttle has proposed the issue: "Having a problem passing 'None' to a COM Interop method that can accept 'Nothing' (in VBA) My code (with considerable snippage): t = System.Type.GetTypeFromProgID("MicroStationDGN.Application") self.ms = System.Activator.CreateInstance(t) elem = self.ms.CreateLineElement2(None, point3d1, point3d2) Now, I know that the point3d objects are working fine, and self.ms is working fine as it is part of a library I am putting together and they are working fine with other methods. The problem is with the 'None' argument. How ever, I run it and get this error: E:\py>ipy titleblocknew.py Traceback (most recent call last): File "titleblocknew.py", line 26, in File "E:\py\ustation.py", line 162, in create_line ValueError: Could not convert argument 2 for call to CreateLineElement2. ILSpy says this about the method: // Bentley.Interop.MicroStationDGN.Application [MethodImpl(4096)] [return: MarshalAs(28)] LineElement CreateLineElement2([MarshalAs(28)] [In] Element Template, [In] [Out] ref Point3d StartPoint, [In] [Out] ref Point3d EndPoint); --- MicroStation documentation says this: Set LineElement = object.CreateLineElement2 (Template, StartPoint, EndPoint) The CreateLineElement2 method syntax has these parts: Part - Description object - A valid object. (Application object) Template - An Element expression. An existing element whose settings are used to initialize the new element. If Nothing, the new element's settings are initialized from MicroStation's active settings. StartPoint A Point3d expression. EndPoint A Point3d expression. --- My basic understanding is that it is trying to convert None into an 'Element' object, but is unable to do so. Is there a way around this?" ---------------------------------------------- ---------------------------------------------- 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 Thu Feb 9 04:55:48 2012 From: slide.o.mix at gmail.com (Slide) Date: Wed, 8 Feb 2012 20:55:48 -0700 Subject: [Ironpython-users] TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper Message-ID: While looking a little bit into [1] I found that the two methods above in UserTypeOps.cs stop when they get to .NET types. If I remove the condition to stop at .NET types, the issue no longer appears. Is there a reason that these two methods are not looking at .NET types? Thanks, slide [1] http://ironpython.codeplex.com/workitem/32166 -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 9 06:36:21 2012 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 9 Feb 2012 05:36:21 +0000 Subject: [Ironpython-users] TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54C9A990@TK5EX14MBXC294.redmond.corp.microsoft.com> The reason we don't keep looking through the type hierarchy is because we should have generated code which does the dispatch to the base method - that's much more efficient then searching at doing a dynamic invoke at runtime. We generate the code in NewTypeMaker.EmitBaseClassCallCheckForProperties which ultimately calls EmitBaseMethodDispatch which checks if we can do the base-method dispatch and emits the code which throws when the method is abstract. I think what's probably happening is that we're overriding the interface slot and the class slot independently. The class slot dispatches to the base virtual method correctly, but we see the interface method as abstract and emit code to throw. EmitBaseMethodDispatch probably just needs to do a Type.GetInterfaceMap on the base type and map it to the correct base method if the method is abstract and the method is declared on an interface type. 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 Slide Sent: Wednesday, February 08, 2012 7:56 PM To: ironpython-users at python.org Subject: [Ironpython-users] TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper While looking a little bit into [1] I found that the two methods above in UserTypeOps.cs stop when they get to .NET types. If I remove the condition to stop at .NET types, the issue no longer appears. Is there a reason that these two methods are not looking at .NET types? Thanks, slide [1] http://ironpython.codeplex.com/workitem/32166 -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Feb 9 09:53:17 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 9 Feb 2012 00:53:17 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/8/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Add StackOverflow to website support page 2. [New comment] IronPython 2.7.1 csv pyc 3. [New comment] Import System does not work when script called from C# 4. [Status update] Test blocking: Cannot kill ipyw processes 5. [New comment] Deriving from C# class and interfaces 6. [New comment] Deriving from C# class and interfaces 7. [New comment] Deriving from C# class and interfaces 8. [Status update] raw_input seems to hang (for winXP ipy 2.0a6) 9. [New issue] strftime does not format %f correctly 10. [New comment] 2.6: datetime.strftime supports %f format code for microseconds zero padded left to six places 11. [Status update] STRESS: test_cominterop.py hangs under "multiple runs" mode 12. [Status update] problem with ironpython2.0.1 and excel 2007 while using interactive mode 13. [Status update] SIGNOFF: test_uuid.py broken on x64 platforms 14. [Status update] System.Int64 should define __hex__ 15. [New comment] Parser: Multi-line command inside a function does not parse (ipy 2.6) 16. [Status update] continue statement in a finally block is not allowed in CPython but works in ipy 17. [Status update] Cannot build the source release of IronPython from within the VS IDE 18. [Status update] IP cannot import modules containing large numbers of variables ---------------------------------------------- ISSUES 1. [New comment] Add StackOverflow to website support page http://ironpython.codeplex.com/workitem/32070 User slide_o_mix has commented on the issue: "Where is the website support page? :-)"----------------- 2. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User slide_o_mix has commented on the issue: "Was this ever resolved?"----------------- 3. [New comment] Import System does not work when script called from C# http://ironpython.codeplex.com/workitem/19249 User slide_o_mix has commented on the issue: "Need some votes on whether we want to do this or not. Could make it an option passed in to CreateEngine or something like that."----------------- 4. [Status update] Test blocking: Cannot kill ipyw processes http://ironpython.codeplex.com/workitem/12900 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "SNAP failure"----------------- 5. [New comment] Deriving from C# class and interfaces http://ironpython.codeplex.com/workitem/32166 User slide_o_mix has commented on the issue: "FYI, your Animal class does not implement the IAnimal interface, there is some sort of shearing going on."----------------- 6. [New comment] Deriving from C# class and interfaces http://ironpython.codeplex.com/workitem/32166 User kvncode has commented on the issue: "Yes I know. This same pattern is possible in C# and therefore I thought IronPython would be capable of supporting this. We have a work-around in place, but this still seems like a bug to me unless it's documented somewhere that this type of design is specifically not supported by IronPython."----------------- 7. [New comment] Deriving from C# class and interfaces http://ironpython.codeplex.com/workitem/32166 User slide_o_mix has commented on the issue: "Ah, I missed the virtual on the Name property of Animal."----------------- 8. [Status update] raw_input seems to hang (for winXP ipy 2.0a6) http://ironpython.codeplex.com/workitem/13803 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce on 2.7.1"----------------- 9. [New issue] strftime does not format %f correctly http://ironpython.codeplex.com/workitem/32215 User slide_o_mix has proposed the issue: "IronPython 3.0 DEBUG (3.0.0.0) on .NET 4.0.30319.237 Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> d = datetime.datetime(2012,2,8,4,5,6,12314) >>> d.strftime('%f') '000314' Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> d = datetime.datetime(2012,2,8,4,5,6,12314) >>> d.strftime('%f') '012314'"----------------- 10. [New comment] 2.6: datetime.strftime supports %f format code for microseconds zero padded left to six places http://ironpython.codeplex.com/workitem/19569 User slide_o_mix has commented on the issue: "strptime looks like it works, but strftime does not format the output correctly in 2.7.1"----------------- 11. [Status update] STRESS: test_cominterop.py hangs under "multiple runs" mode http://ironpython.codeplex.com/workitem/21439 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "No way to reproduce outside MS"----------------- 12. [Status update] problem with ironpython2.0.1 and excel 2007 while using interactive mode http://ironpython.codeplex.com/workitem/22037 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "I'm unable to reproduce this on 2.7.1. "----------------- 13. [Status update] SIGNOFF: test_uuid.py broken on x64 platforms http://ironpython.codeplex.com/workitem/22485 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Ran with both x86 and x64 CLR and both pass the test_uuid.py suite 100%"----------------- 14. [Status update] System.Int64 should define __hex__ http://ironpython.codeplex.com/workitem/26347 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works in 2.7.1"----------------- 15. [New comment] Parser: Multi-line command inside a function does not parse (ipy 2.6) http://ironpython.codeplex.com/workitem/26179 User slide_o_mix has commented on the issue: "Still occurs in 2.7.1"----------------- 16. [Status update] continue statement in a finally block is not allowed in CPython but works in ipy http://ironpython.codeplex.com/workitem/23910 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This works correctly in 2.7.1"----------------- 17. [Status update] Cannot build the source release of IronPython from within the VS IDE http://ironpython.codeplex.com/workitem/24049 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Can not reproduce with clean git clone."----------------- 18. [Status update] IP cannot import modules containing large numbers of variables http://ironpython.codeplex.com/workitem/24123 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Can not 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 slide.o.mix at gmail.com Thu Feb 9 14:11:40 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 9 Feb 2012 06:11:40 -0700 Subject: [Ironpython-users] TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54C9A990@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54C9A990@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: Hmmm, ok, that may be beyond my current knowledge of the internals :-) On Wed, Feb 8, 2012 at 10:36 PM, Dino Viehland wrote: > The reason we don't keep looking through the type hierarchy is because > we should have generated code which does the dispatch to the base method - > that's much more efficient then searching at doing a dynamic invoke at > runtime. We generate the code in > NewTypeMaker.EmitBaseClassCallCheckForProperties which ultimately calls > EmitBaseMethodDispatch which checks if we can do the base-method dispatch > and emits the code which throws when the method is abstract. > > I think what's probably happening is that we're overriding the interface > slot and the class slot independently. The class slot dispatches to the > base virtual method correctly, but we see the interface method as abstract > and emit code to throw. EmitBaseMethodDispatch probably just needs to do a > Type.GetInterfaceMap on the base type and map it to the correct base method > if the method is abstract and the method is declared on an interface type. > > *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 *Slide > *Sent:* Wednesday, February 08, 2012 7:56 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] > TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper > > While looking a little bit into [1] I found that the two methods above in > UserTypeOps.cs stop when they get to .NET types. If I remove the condition > to stop at .NET types, the issue no longer appears. Is there a reason that > these two methods are not looking at .NET types? > > > Thanks, > > slide > > [1] *http://ironpython.codeplex.com/workitem/32166* > > > -- > 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 Fri Feb 10 10:37:43 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 10 Feb 2012 01:37:43 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/9/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Problem with indexers of generic collections 2. [New comment] Import System does not work when script called from C# 3. [Status update] Rename *.cs files to properly reflect the CPython builtin modules they implement 4. [Status update] Place for discussion 5. [Status update] IDLE-like syntax-highlighting editor 6. [Status update] Visual Studio: package did not load correctly 7. [Status update] urllib.quote returns wrong hex values 8. [Status update] Could not add reference to assembly Microsoft.Scripting.Core 9. [New comment] IronPython allows obj.None - should be a SyntaxError 10. [New comment] ipy.exe crashes when launched from a subst UNC path 11. [New comment] ipy.exe hangs with 100% CPU core usage when inserting certain data into DB 12. [New comment] Incorrect line reported in traceback 13. [New comment] pyc fails if a file contains a call to unicode 14. [New comment] 8-bit strings can't contain characters > 0x80 15. [Status update] 1.1.2: Re-adding event handlers broken in 1.1 ---------------------------------------------- ISSUES 1. [New issue] Problem with indexers of generic collections http://ironpython.codeplex.com/workitem/32217 User VitalySavkin has proposed the issue: "For generic .NET types the problem happens when a first access to the indexer is wrong, for example: Right: IronPython 2.7 Alpha 1 (2.7.0.1) on .NET 4.0.30319.1 Type "help", "copyright", "credits" or "license" for more information. >>> import System >>> d = System.Collections.Generic.Dictionary[str, int]() >>> d['0'] Traceback (most recent call last): File "", line 1, in KeyError: The given key was not present in the dictionary. >>> d[0] Traceback (most recent call last): File "", line 1, in TypeError: expected str, got int >>> d['0'] Traceback (most recent call last): File "", line 1, in KeyError: The given key was not present in the dictionary. Wrong: IronPython 2.7 Alpha 1 (2.7.0.1) on .NET 4.0.30319.1 Type "help", "copyright", "credits" or "license" for more information. >>> import System >>> d = System.Collections.Generic.Dictionary[str, int]() >>> d[0] Traceback (most recent call last): File "", line 1, in TypeError: expected str, got int >>> d['0'] Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute '__index__' >>> d.__getitem__('0') Traceback (most recent call last): File "", line 1, in KeyError: The given key was not present in the dictionary."----------------- 2. [New comment] Import System does not work when script called from C# http://ironpython.codeplex.com/workitem/19249 User MarkusSchaber has commented on the issue: "Please keep the amount of implicitly added assembly references down to a minimum in hosted/embedded IronPython environments by default (or at least add an option to do so). In some (sandboxed) environments, we only want to expose explicitly added assemblies to the scripts."----------------- 3. [Status update] Rename *.cs files to properly reflect the CPython builtin modules they implement http://ironpython.codeplex.com/workitem/21026 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed in 2.7.1"----------------- 4. [Status update] Place for discussion http://ironpython.codeplex.com/workitem/30168 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Not an issue."----------------- 5. [Status update] IDLE-like syntax-highlighting editor http://ironpython.codeplex.com/workitem/20293 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Python Tools for Visual Studio is the recommended IPy editor."----------------- 6. [Status update] Visual Studio: package did not load correctly http://ironpython.codeplex.com/workitem/29767 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "IronPython Studio is no longer supported. Please use Python Tools for Visual Studio."----------------- 7. [Status update] urllib.quote returns wrong hex values http://ironpython.codeplex.com/workitem/28233 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Can't reproduce in 2.7.1"----------------- 8. [Status update] Could not add reference to assembly Microsoft.Scripting.Core http://ironpython.codeplex.com/workitem/28397 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "These assemblies are now integrated into System.Core in .NET 4.0"----------------- 9. [New comment] IronPython allows obj.None - should be a SyntaxError http://ironpython.codeplex.com/workitem/669 User slide_o_mix has commented on the issue: "This is still an issue in 2.7.1"----------------- 10. [New comment] ipy.exe crashes when launched from a subst UNC path http://ironpython.codeplex.com/workitem/28905 User slide_o_mix has commented on the issue: "The interesting thing is running ipy.exe from the same server location (not using the subst path) works just fine. "----------------- 11. [New comment] 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 commented on the issue: "I'm unable to reproduce this on 2.7.1 with ipy.exe and SQL Server 2008. I don't have a 2005 instance to play with. Can you try with 2008 and see if the issue still exists? Also, can you do the same thing in a C# app with no issue?"----------------- 12. [New comment] Incorrect line reported in traceback http://ironpython.codeplex.com/workitem/24164 User slide_o_mix has commented on the issue: "Can we close this out as fixed in 2.7?"----------------- 13. [New comment] pyc fails if a file contains a call to unicode http://ironpython.codeplex.com/workitem/26593 User slide_o_mix has commented on the issue: "Can we close this out as working in 2.7.1?"----------------- 14. [New comment] 8-bit strings can't contain characters > 0x80 http://ironpython.codeplex.com/workitem/14104 User slide_o_mix has commented on the issue: "It's failing here: IronPython.Runtime.PythonAsciiEncoding.GetCharCount(Byte[] bytes, Int32 index, Int32 count) There is a check if the byte value is > 0x7f"----------------- 15. [Status update] 1.1.2: Re-adding event handlers broken in 1.1 http://ironpython.codeplex.com/workitem/13685 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works in 2.7.1" ---------------------------------------------- ---------------------------------------------- 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 igor.brejc at gmail.com Fri Feb 10 19:04:15 2012 From: igor.brejc at gmail.com (Igor Brejc) Date: Fri, 10 Feb 2012 19:04:15 +0100 Subject: [Ironpython-users] LightweightScopes and scopes in general Message-ID: Hi, I'm running embedded IronPython scripts (2.6, .NET 3.5) and I was wondering what happens with the stuff allocated within the script after the script has finished? For testing purposes I've been executing the following script s = set() for i in range(0, 1000000): s.add(i) ...and then watching the memory usage of the application. BTW I always shut down the scripting engine and create a new ScriptScope for each run. I've noticed that in the debug mode, the memory increases after each run. When I do a s.clear() before finishing, the increase is unnoticeable, so I assume those Python sets are kept alive (even if I do GC.Collect()). I've also tried running in the release mode and turning on the options["LightweightScopes"] = true mode, which seems to help. But I cannot find any information about what this option actually does and what happens with the scope variables in general. Any info would be appreciated. Thanks, Igor Brejc -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Feb 10 19:15:31 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 10 Feb 2012 10:15:31 -0800 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: References: Message-ID: On Fri, Feb 10, 2012 at 10:04 AM, Igor Brejc wrote: > Hi, > > I'm running embedded IronPython scripts (2.6, .NET 3.5) and I was wondering > what happens with the stuff allocated within the script after the script has > finished? For testing purposes I've been executing the following script > > s = set() > for i in range(0, 1000000): > ? ? s.add(i) > > ...and then watching the memory usage of the application. BTW I always shut > down the scripting engine and create a new ScriptScope for each run. > > I've noticed that in the debug mode, the memory increases after each run. > When I do a s.clear() before finishing, the increase is unnoticeable, so I > assume those Python sets are kept alive (even if I do GC.Collect()). I'm taking a stab off the top of my head based on my limited knowledge of the internals, but I do know that debug code is not collectable. It's possible that the code itself may be holding references that keep objects alive longer than expected. I believe if you run the code in a separate AppDomain you can unload the AppDomain and the code will be collected, which should take everything else with it. > > I've also tried running in the release mode and turning on > the?options["LightweightScopes"] = true mode, which seems to help. But I > cannot find any information about what this option actually does and what > happens with the scope variables in general. Any info would be appreciated. That one I'll have to leave to Dino. - Jeff From igor.brejc at gmail.com Fri Feb 10 19:49:55 2012 From: igor.brejc at gmail.com (Igor Brejc) Date: Fri, 10 Feb 2012 19:49:55 +0100 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: References: Message-ID: On Fri, Feb 10, 2012 at 7:15 PM, Jeff Hardy wrote: > > I believe if you run the code in a separate AppDomain you can unload > the AppDomain and the code will be collected, which should take > everything else with it. > > > Yes, I've seen the http://stackoverflow.com/questions/1664567/embedded-ironpython-memory-leak question, unfortunately a separate AppDomain is not an option, since the scripts need to access the main app objects transparently. Igor -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.brejc at gmail.com Fri Feb 10 19:50:53 2012 From: igor.brejc at gmail.com (Igor Brejc) Date: Fri, 10 Feb 2012 19:50:53 +0100 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: On Fri, Feb 10, 2012 at 7:46 PM, Dino Viehland wrote: > > > Jeff wrote: > > I'm taking a stab off the top of my head based on my limited knowledge > of the > > internals, but I do know that debug code is not collectable. > > It's possible that the code itself may be holding references that keep > objects > > alive longer than expected. > > > > I believe if you run the code in a separate AppDomain you can unload the > > AppDomain and the code will be collected, which should take everything > else > > with it. > > > > > > > > I've also tried running in the release mode and turning on the > > > options["LightweightScopes"] = true mode, which seems to help. But I > > > cannot find any information about what this option actually does and > > > what happens with the scope variables in general. Any info would be > > appreciated. > > > > That one I'll have to leave to Dino. > > The difference between the different types of scopes just comes down to how > we hold onto global variable and call site objects. > > The most efficient way to hold onto these is to use CLR static fields to > store the > global variables. That allows the CLR to generate a direct access to the > field and > we can quickly access the global variables. But it comes at the cost of > not being > able to recover the static fields and leaking the values that are stored > in there. > > The light weight scopes store the variables in a field or an array instead > of storing > them in static fields. To do that we need to pass in the field or close > over it and then > on each access we need to do the field or array access (and if it's an > array access, it > needs to be bounds checked). But the end result is that the only thing > which is keeping > the global variable / call site objects alive are the delegate which > implements the > ScriptCode. Once the ScriptCode goes away all of those call sites and > PythonGlobal > objects can be collected. > > So lightweight scopes come at a performance cost, but they are more > applicable > Where you're actually re-compiling code regularly. > > > Thanks for that explanation, Dino. Another question that pops up: what happens with Disposable objects (like files, GDI+ bitmaps etc.) created within the Py scope (if they are not referenced from the outside)? Igor -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Feb 10 19:46:48 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 10 Feb 2012 18:46:48 +0000 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> Jeff wrote: > I'm taking a stab off the top of my head based on my limited knowledge of the > internals, but I do know that debug code is not collectable. > It's possible that the code itself may be holding references that keep objects > alive longer than expected. > > I believe if you run the code in a separate AppDomain you can unload the > AppDomain and the code will be collected, which should take everything else > with it. > > > > > I've also tried running in the release mode and turning on the > > options["LightweightScopes"] = true mode, which seems to help. But I > > cannot find any information about what this option actually does and > > what happens with the scope variables in general. Any info would be > appreciated. > > That one I'll have to leave to Dino. The difference between the different types of scopes just comes down to how we hold onto global variable and call site objects. The most efficient way to hold onto these is to use CLR static fields to store the global variables. That allows the CLR to generate a direct access to the field and we can quickly access the global variables. But it comes at the cost of not being able to recover the static fields and leaking the values that are stored in there. The light weight scopes store the variables in a field or an array instead of storing them in static fields. To do that we need to pass in the field or close over it and then on each access we need to do the field or array access (and if it's an array access, it needs to be bounds checked). But the end result is that the only thing which is keeping the global variable / call site objects alive are the delegate which implements the ScriptCode. Once the ScriptCode goes away all of those call sites and PythonGlobal objects can be collected. So lightweight scopes come at a performance cost, but they are more applicable Where you're actually re-compiling code regularly. From dinov at microsoft.com Fri Feb 10 22:40:58 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 10 Feb 2012 21:40:58 +0000 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA2A5D@TK5EX14MBXC294.redmond.corp.microsoft.com> We won?t call IDispose on them. Usually they?ll follow the pattern of implementing IDisposable + having a finalizer so they will eventually release their resources. Also they can be used with the ?with? statement so that their Dispose methods are eagerly called. From: Igor Brejc [mailto:igor.brejc at gmail.com] Sent: Friday, February 10, 2012 10:51 AM To: Dino Viehland Cc: Jeff Hardy; Ironpython-users at python.org Subject: Re: [Ironpython-users] LightweightScopes and scopes in general On Fri, Feb 10, 2012 at 7:46 PM, Dino Viehland > wrote: Jeff wrote: > I'm taking a stab off the top of my head based on my limited knowledge of the > internals, but I do know that debug code is not collectable. > It's possible that the code itself may be holding references that keep objects > alive longer than expected. > > I believe if you run the code in a separate AppDomain you can unload the > AppDomain and the code will be collected, which should take everything else > with it. > > > > > I've also tried running in the release mode and turning on the > > options["LightweightScopes"] = true mode, which seems to help. But I > > cannot find any information about what this option actually does and > > what happens with the scope variables in general. Any info would be > appreciated. > > That one I'll have to leave to Dino. The difference between the different types of scopes just comes down to how we hold onto global variable and call site objects. The most efficient way to hold onto these is to use CLR static fields to store the global variables. That allows the CLR to generate a direct access to the field and we can quickly access the global variables. But it comes at the cost of not being able to recover the static fields and leaking the values that are stored in there. The light weight scopes store the variables in a field or an array instead of storing them in static fields. To do that we need to pass in the field or close over it and then on each access we need to do the field or array access (and if it's an array access, it needs to be bounds checked). But the end result is that the only thing which is keeping the global variable / call site objects alive are the delegate which implements the ScriptCode. Once the ScriptCode goes away all of those call sites and PythonGlobal objects can be collected. So lightweight scopes come at a performance cost, but they are more applicable Where you're actually re-compiling code regularly. Thanks for that explanation, Dino. Another question that pops up: what happens with Disposable objects (like files, GDI+ bitmaps etc.) created within the Py scope (if they are not referenced from the outside)? Igor -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Feb 10 23:59:24 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 10 Feb 2012 22:59:24 +0000 Subject: [Ironpython-users] [ANN] Python Tools for Visual Studio 1.1 Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA2E78@TK5EX14MBXC294.redmond.corp.microsoft.com> We're pleased to announce the release of Python Tools for Visual Studio 1.1 http://pytools.codeplex.com/releases/view/76091. Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual Studio which supports programming with the Python programming language. PTVS supports a broad range of features including: * Supports CPython and IronPython * Python editor with advanced member and signature intellisense * Code navigation: "Find all refs", goto definition, and object browser * Local and remote debugging * Profiling with multiple views * Integrated REPL window with inline matplotlib graphics * Support for HPC clusters and MPI, including debugging & Profiling * Interactive parallel computing via integrated IPython REPL This release includes new core IDE features, a couple of new sample libraries for interacting with Kinect and Excel, and many bug fixes for issues reported since the release of 1.0. The 1.1 release altogether contains over 150 bug fixes and new features since 1.0. For the core IDE features we've added many new features which improve the basic editing experience. This includes a smart tag feature for automatically adding imports, a command for cleaning up unused imports, support for recognizing isinstance() calls and using them for providing improved completions. We've also updated goto definition to go to members defined in the standard library. We've also made several improvements to the project system. Some improvements which should help just about everyone include support for linked files that live outside of the project directory. This makes it easy to keep your project file separate from your code files. For IronPython users you can now add references to .NET projects or .NET assemblies and we'll automatically reload and re-analyze the references when they're rebuilt. For CPython users you can now add a reference to a .pyd extension module enabling analysis of the extension to provide completions. We've also improved intellisense across multiple Python projects in the same solution. This release also includes some improvements to the interactive REPL window. This includes improvements to IPython REPL support including support for inline graphs and proper support for IPython's numbered prompts. We've added support for using IPython mode w/o PyLab - this enables out-of-line graphs and improves the startup time of the interactive window. The debugger has also seen several small improvements in this release. There's a new option to step into the Python standard library while debugging, another option to not break on SystemExit exception with exit codes of zero. Finally we've added support for displaying Python thread name in the threads window. We've also improved the Debug->Attach support and made it easier to attach to a process which is not actively running Python code. Another major addition to 1.1 includes the addition of two additional sample libraries available as separate downloads: PyKinect for working with the Kinect Beta SDK and Pyvot for working with Excel spreadsheets. Once downloaded and installed these plug-in to Visual Studio and provide templates; and they provide built-in support for installing into one of the recognized Python interpreters via Tools->Python Tools->Samples. We'd like to thank all of the users who took the time to report issues and feedback for this release: 445363200, adv12, Andrew, AphexSA, benpmorgan, chadbr, dgkbny, drgn, holmboe, hyh, jimpeak, juanalumni, kingnaoufal, lblanchon, liuzhenhai, mahpour, MichaelBaker, po6856, pztrick44, RobertMcGinley, salerio, slide_o_mix, somini, SoonStudios, stakemura, stephenkennedy, sumitbasu, swift_dev, synergetic, teebot, tiphon, timeisaparallax, tonyandrewmeyer, xavier_grundus, and Zooba. Thanks, The Python Tools for Visual Studio Team From no_reply at codeplex.com Sat Feb 11 13:02:23 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 11 Feb 2012 04:02:23 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] IronPython 2.0 Beta3 has memory leak in WCF programming 2. [Status update] 1.1.3: AttributeError in property getter (1.1.2 only) 3. [New comment] Quoting in MSBuild files 4. [New comment] Ctl-Z doesn't throw EOF error in raw_input() 5. [Status update] sys.ps1, sys.ps2 should change the prompt displayed in the interactive command window 6. [New comment] Memory leak in IP 2.0B5 when using N ScriptRuntimes 7. [New comment] (Legacy) test_numtypes.py runs very slowly against IronPython 2.x 8. [Status update] IronPython allows "del ()" 9. [New comment] IronPython allows yield in class definition if nested in a function def 10. [Status update] ValueError: Length cannot be less than 0 or exceed input length 11. [Status update] Legacy test_dllsite.py fails with SystemError exception on bad import (should be ImportError) 12. [Status update] IronPython: test_weakref.py fails on merlin-18 13. [New comment] test_delegate.py broken on 2k3 and XP 14. [Status update] test_delegate.py broken on 2k3 and XP 15. [New comment] test_strptime function of the (CPython) test_time.py test fails 16. [Status update] Ironpython throw "EOFError: Unable to read beyond the end of the stream." but Cpython does not throw. 17. [New comment] ImportError: No module named __hello__,__phello__ 18. [Status update] Empty module has more items 19. [Status update] Hosting: Import a module on a ScriptScope 20. [New comment] Hosting: Import a module on a ScriptScope 21. [Status update] Hosting: Import a module on a ScriptScope 22. [New comment] IP 2.7.1 xml.etree.Elementree#iterparse is not working ---------------------------------------------- ISSUES 1. [Status update] IronPython 2.0 Beta3 has memory leak in WCF programming http://ironpython.codeplex.com/workitem/17331 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Can't reproduce"----------------- 2. [Status update] 1.1.3: AttributeError in property getter (1.1.2 only) http://ironpython.codeplex.com/workitem/18618 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works in 2.7.1"----------------- 3. [New comment] Quoting in MSBuild files http://ironpython.codeplex.com/workitem/20262 User slide_o_mix has commented on the issue: "Jeff since you've recently redone the build can you double check this?"----------------- 4. [New comment] Ctl-Z doesn't throw EOF error in raw_input() http://ironpython.codeplex.com/workitem/22140 User slide_o_mix has commented on the issue: "The issue is in PythonFile::ReadLine // Read characters up to and including a '\r\n', converted to '\n' (or until EOF or the given size, in // which case the string will not be newline terminated). public override String ReadLine(int size) { StringBuilder sb = null; // start off w/ some text if (_bufPos >= _bufLen) ReadBuffer(); if (_bufLen == 0) return String.Empty; That last item should probably be: if(_bufLen == 0) throw PythonOps.EofError(string.Empty); "----------------- 5. [Status update] sys.ps1, sys.ps2 should change the prompt displayed in the interactive command window http://ironpython.codeplex.com/workitem/4299 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This works in 2.7.1"----------------- 6. [New comment] Memory leak in IP 2.0B5 when using N ScriptRuntimes http://ironpython.codeplex.com/workitem/20296 User slide_o_mix has commented on the issue: "Need a test case to reproduce this with."----------------- 7. [New comment] (Legacy) test_numtypes.py runs very slowly against IronPython 2.x http://ironpython.codeplex.com/workitem/24011 User slide_o_mix has commented on the issue: "This took 8 minutes on the following setup: OS: x64 Windows 7 CPU: Intel Core i5 Memory: 6GB"----------------- 8. [Status update] IronPython allows "del ()" http://ironpython.codeplex.com/workitem/24756 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works in 2.7.1 test_filename (__main__.CodeopTests) ... ok test_incomplete (__main__.CodeopTests) ... ok test_invalid (__main__.CodeopTests) ... ok test_valid (__main__.CodeopTests) ... ok ---------------------------------------------------------------------- Ran 4 tests in 0.124s OK"----------------- 9. [New comment] IronPython allows yield in class definition if nested in a function def http://ironpython.codeplex.com/workitem/26496 User slide_o_mix has commented on the issue: ">>> def f(): ... class C: ... yield 42 ... return C ... >>> f().next() Traceback (most recent call last): File "", line 1, in File "", line 2, in f NotImplementedError: The method or operation is not implemented. >>> Unhandled Exception: System.NotImplementedException: The method or operation is not implemented. 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.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.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.CompileTryExpression(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush(Expression expr) at Microsoft.Scripting.Interpreter.LightCompiler.Compile(Expression expr) 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.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.CompileTop(LightLambdaExpression node) at Microsoft.Scripting.Ast.LightLambdaExpression.Compile(Int32 compilationThreshold) at IronPython.Runtime.FunctionCode.CompileLambda(LightLambdaExpression code, EventHandler`1 handler) at IronPython.Runtime.FunctionCode.UpdateDelegate(PythonContext context, Boolean forceCreation) at IronPython.Compiler.Ast.ClassDefinition.<>c__DisplayClass2.b__0(Object x) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, B oolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()"----------------- 10. [Status update] ValueError: Length cannot be less than 0 or exceed input length http://ironpython.codeplex.com/workitem/23768 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "While we don't pass the re test suite, there is no longer a ValueError raised."----------------- 11. [Status update] Legacy test_dllsite.py fails with SystemError exception on bad import (should be ImportError) http://ironpython.codeplex.com/workitem/23710 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This raises ImportError on 2.7.1"----------------- 12. [Status update] IronPython: test_weakref.py fails on merlin-18 http://ironpython.codeplex.com/workitem/24056 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Unable to reproduce."----------------- 13. [New comment] test_delegate.py broken on 2k3 and XP http://ironpython.codeplex.com/workitem/23719 User slide_o_mix has commented on the issue: "Works with 2.7.1 on my XP machine >>> 0.00s testing test_AddDelegateFromCSharpAndRemoveFromPython >>> 0.01s testing test_AddRemoveDelegateFromPython >>> 0.02s testing test_basic >>> 0.10s testing test_bound_builtin_functions >>> 0.13s testing test_combine >>> 0.14s testing test_delegate___call__ >>> 0.20s testing test_error_message >>> 0.21s testing test_event_as_attribute_disallowed_ops >>> 0.21s testing test_event_handler_add_removal_sequence >>> 0.22s testing test_event_lifetime >>> 0.79s testing test_handler_get_invoked >>> 0.80s testing test_python_code_as_event_handler >>> 0.80s testing test_reflected_event_ops >>> 0.81s testing test_strongly_typed_events 14 tests passed"----------------- 14. [Status update] test_delegate.py broken on 2k3 and XP http://ironpython.codeplex.com/workitem/23719 User slide_o_mix has updated the issue: Status has changed from Active to Closed. ----------------- 15. [New comment] test_strptime function of the (CPython) test_time.py test fails http://ironpython.codeplex.com/workitem/23712 User slide_o_mix has commented on the issue: "Different errors now. test_asctime (__main__.TimeTestCase) ... ok test_clock (__main__.TimeTestCase) ... ok test_conversions (__main__.TimeTestCase) ... ok test_ctime_without_arg (__main__.TimeTestCase) ... ok test_data_attributes (__main__.TimeTestCase) ... ok test_default_values_for_zero (__main__.TimeTestCase) ... ERROR test_gmtime_without_arg (__main__.TimeTestCase) ... ok test_insane_timestamps (__main__.TimeTestCase) ... ok test_localtime_without_arg (__main__.TimeTestCase) ... ok test_sleep (__main__.TimeTestCase) ... ok test_strftime (__main__.TimeTestCase) ... ok test_strftime_bounds_checking (__main__.TimeTestCase) ... ok test_strptime (__main__.TimeTestCase) ... FAIL test_tzset (__main__.TimeTestCase) ... ok ====================================================================== ERROR: test_default_values_for_zero (__main__.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\acearl\Code\IronLanguagesMain\External.LCA_RESTRICTED\Languages\CPython\27\Lib\test\test_time.py", line 96, in test_default_values_for_zero result = time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9) ValueError: Year, Month, and Day parameters describe an un-representable DateTime. ====================================================================== FAIL: test_strptime (__main__.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\acearl\Code\IronLanguagesMain\External.LCA_RESTRICTED\Languages\CPython\27\Lib\test\test_time.py", line 111, in test_strptime self.fail("conversion specifier %r failed with '%s' input." % AssertionError: conversion specifier '%a' failed with 'Fri' input. ---------------------------------------------------------------------- Ran 14 tests in 1.470s FAILED (failures=1, errors=1) Traceback (most recent call last): File "C:\Users\acearl\Code\IronLanguagesMain\External.LCA_RESTRICTED\Languages\CPython\27\Lib\test\test_time.py", line 221, in File "C:\Users\acearl\Code\IronLanguagesMain\External.LCA_RESTRICTED\Languages\CPython\27\Lib\test\test_time.py", line 217, in test_main File "C:\Users\acearl\Applications\IronPython-2.7.1\Lib\test\test_support.py", line 1078, in run_unittest File "C:\Users\acearl\Applications\IronPython-2.7.1\Lib\test\test_support.py", line 1061, in _run_suite"----------------- 16. [Status update] Ironpython throw "EOFError: Unable to read beyond the end of the stream." but Cpython does not throw. http://ironpython.codeplex.com/workitem/23779 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works on 2.7.1"----------------- 17. [New comment] ImportError: No module named __hello__,__phello__ http://ironpython.codeplex.com/workitem/23797 User slide_o_mix has commented on the issue: "Could implement this directly, but these modules are frozen modules, so to be completely compatible, we would need to implement frozen code marshaling."----------------- 18. [Status update] Empty module has more items http://ironpython.codeplex.com/workitem/812 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239 Type "help", "copyright", "credits" or "license" for more information. >>> import py1 >>> vars(py1).keys() ['__name__', '__file__', '__doc__', '__builtins__', '__package__'] 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 >>> import py1 >>> vars(py1).keys() ['__builtins__', '__name__', '__file__', '__doc__', '__package__']" for more information."----------------- 19. [Status update] Hosting: Import a module on a ScriptScope http://ironpython.codeplex.com/workitem/26505 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed in 8e94cc19a05eea0c0b1f5a32a0ae0c9cf1a4ffab"----------------- 20. [New comment] Hosting: Import a module on a ScriptScope http://ironpython.codeplex.com/workitem/26505 User slide_o_mix has commented on the issue: "Fixed in 8e94cc19a05eea0c0b1f5a32a0ae0c9cf1a4ffab ** Closed by slide_o_mix 2/10/2012 11:14 AM"----------------- 21. [Status update] Hosting: Import a module on a ScriptScope http://ironpython.codeplex.com/workitem/26505 User slide_o_mix has updated the issue: Status has changed from Closed to Proposed with the following comment, "Moving to fixed instead of closed"----------------- 22. [New comment] IP 2.7.1 xml.etree.Elementree#iterparse is not working http://ironpython.codeplex.com/workitem/31923 User jdhardy has commented on the issue: "It turns out that iterparse is closely tied to the expat-based XML reader. Once http://ironpython.codeplex.com/workitem/20023 is fixed then this one can be as well. I improved the error message in 7f9fc2a." ---------------------------------------------- ---------------------------------------------- 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 igor.brejc at gmail.com Sat Feb 11 16:11:03 2012 From: igor.brejc at gmail.com (Igor Brejc) Date: Sat, 11 Feb 2012 16:11:03 +0100 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CA2A5D@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54CA2A5D@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: I'm thinking of this scenario: my host application allows users to run their own Py scripts. OK, in the ideal case, their scripts should take care of the disposal of the reserved resources, but a lot of times user will write trail-and-error scripts which will often fail. Is there a mechanism for the host application to somehow track (and possibly dispose) of the stuff that has been allocated in a failed user script? Using SetTrace() or by simply examining the ScriptScope after the script has finished? Or should I simply ignore this? I'm wondering how other people who use IronPython as an embedded scripting engine deal with these issues (if at all). Thanks, Igor On Fri, Feb 10, 2012 at 10:40 PM, Dino Viehland wrote: > We won?t call IDispose on them. Usually they?ll follow the pattern of > implementing IDisposable + having a finalizer so they will eventually > release their resources. Also they can be used with the ?with? statement > so that their Dispose methods are eagerly called.**** > > ** ** > > *From:* Igor Brejc [mailto:igor.brejc at gmail.com] > *Sent:* Friday, February 10, 2012 10:51 AM > *To:* Dino Viehland > *Cc:* Jeff Hardy; Ironpython-users at python.org > *Subject:* Re: [Ironpython-users] LightweightScopes and scopes in general* > *** > > ** ** > > ** ** > > On Fri, Feb 10, 2012 at 7:46 PM, Dino Viehland > wrote:**** > > > > Jeff wrote: > > I'm taking a stab off the top of my head based on my limited knowledge > of the > > internals, but I do know that debug code is not collectable. > > It's possible that the code itself may be holding references that keep > objects > > alive longer than expected. > > > > I believe if you run the code in a separate AppDomain you can unload the > > AppDomain and the code will be collected, which should take everything > else > > with it. > > > > > > > > I've also tried running in the release mode and turning on the > > > options["LightweightScopes"] = true mode, which seems to help. But I > > > cannot find any information about what this option actually does and > > > what happens with the scope variables in general. Any info would be > > appreciated. > > > > That one I'll have to leave to Dino.**** > > The difference between the different types of scopes just comes down to how > we hold onto global variable and call site objects. > > The most efficient way to hold onto these is to use CLR static fields to > store the > global variables. That allows the CLR to generate a direct access to the > field and > we can quickly access the global variables. But it comes at the cost of > not being > able to recover the static fields and leaking the values that are stored > in there. > > The light weight scopes store the variables in a field or an array instead > of storing > them in static fields. To do that we need to pass in the field or close > over it and then > on each access we need to do the field or array access (and if it's an > array access, it > needs to be bounds checked). But the end result is that the only thing > which is keeping > the global variable / call site objects alive are the delegate which > implements the > ScriptCode. Once the ScriptCode goes away all of those call sites and > PythonGlobal > objects can be collected. > > So lightweight scopes come at a performance cost, but they are more > applicable > Where you're actually re-compiling code regularly. > > **** > > ** ** > > Thanks for that explanation, Dino.**** > > ** ** > > Another question that pops up: what happens with Disposable objects (like > files, GDI+ bitmaps etc.) created within the Py scope (if they are not > referenced from the outside)? **** > > ** ** > > Igor**** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Feb 12 09:51:41 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 12 Feb 2012 00:51:41 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/11/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 Android Support 2. [New issue] IronPython iOS Support 3. [New comment] Implement _sqlite3 module 4. [Status update] Quoting in MSBuild files ---------------------------------------------- ISSUES 1. [New issue] IronPython Android Support http://ironpython.codeplex.com/workitem/32232 User jdhardy has proposed the issue: "Similar to [workitem:26534], allow IronPython scripts to run on Android devices (via Mono for Android)."----------------- 2. [New issue] IronPython iOS Support http://ironpython.codeplex.com/workitem/32231 User jdhardy has proposed the issue: "Similar to [workitem:26534], allow IronPython scripts to run on iOS devices (via MonoTouch)."----------------- 3. [New comment] Implement _sqlite3 module http://ironpython.codeplex.com/workitem/21410 User jdhardy has commented on the issue: "Added in 21b81ae."----------------- 4. [Status update] Quoting in MSBuild files http://ironpython.codeplex.com/workitem/20262 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "Yeah, this has been fixed for a while. xbuild works just fine." ---------------------------------------------- ---------------------------------------------- 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 rome at Wintellect.com Sun Feb 12 18:44:54 2012 From: rome at Wintellect.com (Keith Rome) Date: Sun, 12 Feb 2012 09:44:54 -0800 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54CA2A5D@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3C9655AC@VA3DIAXVS461.RED001.local> I am fairly sure it is no different than when using disposable objects in any .NET application. If you don?t call IDisposable.Dispose() directly (or via the ?using()? statement), then those objects will be disposed via their finalizer when the GC collects them. This happens automatically and fairly frequently in a .NET application. Those objects will be cleaned up for you ? assuming you really aren?t holding references to them. If you find they never seem to go away, then I highly recommend attaching a memory profiler (SciTech?s MemProfiler is superb) and exploring the heap graph for the root paths that are responsible for pinning them. Take note that your ScriptScope itself is holding references to all of the objects contained within. You will need to discard all references to that ScriptScope if you want it (and its contents) to be collected by the runtime. If you conclude that they truly are eligible for collection, and you just can?t wait for the system to clean up on its own, then you can always call GC.Collect() directly. I really don?t recommend that kind of brute force approach though. There are very few situations where calling GC.Collect() is really the right thing to do. 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 Igor Brejc Sent: Saturday, February 11, 2012 10:11 AM To: Dino Viehland Cc: Ironpython-users at python.org Subject: Re: [Ironpython-users] LightweightScopes and scopes in general I'm thinking of this scenario: my host application allows users to run their own Py scripts. OK, in the ideal case, their scripts should take care of the disposal of the reserved resources, but a lot of times user will write trail-and-error scripts which will often fail. Is there a mechanism for the host application to somehow track (and possibly dispose) of the stuff that has been allocated in a failed user script? Using SetTrace() or by simply examining the ScriptScope after the script has finished? Or should I simply ignore this? I'm wondering how other people who use IronPython as an embedded scripting engine deal with these issues (if at all). Thanks, Igor On Fri, Feb 10, 2012 at 10:40 PM, Dino Viehland > wrote: We won?t call IDispose on them. Usually they?ll follow the pattern of implementing IDisposable + having a finalizer so they will eventually release their resources. Also they can be used with the ?with? statement so that their Dispose methods are eagerly called. From: Igor Brejc [mailto:igor.brejc at gmail.com] Sent: Friday, February 10, 2012 10:51 AM To: Dino Viehland Cc: Jeff Hardy; Ironpython-users at python.org Subject: Re: [Ironpython-users] LightweightScopes and scopes in general On Fri, Feb 10, 2012 at 7:46 PM, Dino Viehland > wrote: Jeff wrote: > I'm taking a stab off the top of my head based on my limited knowledge of the > internals, but I do know that debug code is not collectable. > It's possible that the code itself may be holding references that keep objects > alive longer than expected. > > I believe if you run the code in a separate AppDomain you can unload the > AppDomain and the code will be collected, which should take everything else > with it. > > > > > I've also tried running in the release mode and turning on the > > options["LightweightScopes"] = true mode, which seems to help. But I > > cannot find any information about what this option actually does and > > what happens with the scope variables in general. Any info would be > appreciated. > > That one I'll have to leave to Dino. The difference between the different types of scopes just comes down to how we hold onto global variable and call site objects. The most efficient way to hold onto these is to use CLR static fields to store the global variables. That allows the CLR to generate a direct access to the field and we can quickly access the global variables. But it comes at the cost of not being able to recover the static fields and leaking the values that are stored in there. The light weight scopes store the variables in a field or an array instead of storing them in static fields. To do that we need to pass in the field or close over it and then on each access we need to do the field or array access (and if it's an array access, it needs to be bounds checked). But the end result is that the only thing which is keeping the global variable / call site objects alive are the delegate which implements the ScriptCode. Once the ScriptCode goes away all of those call sites and PythonGlobal objects can be collected. So lightweight scopes come at a performance cost, but they are more applicable Where you're actually re-compiling code regularly. Thanks for that explanation, Dino. Another question that pops up: what happens with Disposable objects (like files, GDI+ bitmaps etc.) created within the Py scope (if they are not referenced from the outside)? Igor -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor.brejc at gmail.com Sun Feb 12 20:03:53 2012 From: igor.brejc at gmail.com (Igor Brejc) Date: Sun, 12 Feb 2012 20:03:53 +0100 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: <7737799D90E55E4BB9C9F7E40D161E110E3C9655AC@VA3DIAXVS461.RED001.local> References: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54CA2A5D@TK5EX14MBXC294.redmond.corp.microsoft.com> <7737799D90E55E4BB9C9F7E40D161E110E3C9655AC@VA3DIAXVS461.RED001.local> Message-ID: On Sun, Feb 12, 2012 at 6:44 PM, Keith Rome wrote: > I am fairly sure it is no different than when using disposable objects in > any .NET application. If you don?t call IDisposable.Dispose() directly (or > via the ?using()? statement), then those objects will be disposed via their > finalizer when the GC collects them. This happens automatically and fairly > frequently in a .NET application. Those objects will be cleaned up for you > ? assuming you really aren?t holding references to them. If you find they > never seem to go away, then I highly recommend attaching a memory profiler > (SciTech?s MemProfiler is superb) and exploring the heap graph for the root > paths that are responsible for pinning them. > I'm not a GC expert, but if I understand correctly, GC doesn't really call Dispose(), you have to implement the finalizer explicitly to do this ( http://stackoverflow.com/questions/45036/will-the-garbage-collector-call-idisposable-dispose-for-me). Since (from my experience) most user-written disposable classes don't implement finalizers, this means that if you don't call Dispose() explicitly or using "using", the resource won't be released until the process stops. Even FxCop doesn't suggest writing finalizers, it just recommends using the proper Disposable pattern ( http://geekswithblogs.net/sdorman/archive/2010/05/25/the-dispose-pattern-and-fxcop-warnings.aspx ). On the other hand, I notice .NET Framework classes do seem to implement finalizers (FileStream, Image...): http://msdn.microsoft.com/en-us/library/system.io.filestream.finalize.aspx > **** > > ** ** > > Take note that your ScriptScope itself is holding references to all of the > objects contained within. You will need to discard all references to that > ScriptScope if you want it (and its contents) to be collected by the > runtime. > Good suggestion, thanks. > **** > > ** ** > > If you conclude that they truly are eligible for collection, and you just > can?t wait for the system to clean up on its own, then you can always call > GC.Collect() directly. I really don?t recommend that kind of brute force > approach though. There are very few situations where calling GC.Collect() > is really the right thing to do.**** > > ** > I agree. > ** > > ** ** > > *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 *Igor > Brejc > *Sent:* Saturday, February 11, 2012 10:11 AM > *To:* Dino Viehland > *Cc:* Ironpython-users at python.org > > *Subject:* Re: [Ironpython-users] LightweightScopes and scopes in general* > *** > > ** ** > > I'm thinking of this scenario: my host application allows users to run > their own Py scripts. OK, in the ideal case, their scripts should take care > of the disposal of the reserved resources, but a lot of times user will > write trail-and-error scripts which will often fail. Is there a mechanism > for the host application to somehow track (and possibly dispose) of the > stuff that has been allocated in a failed user script? Using SetTrace() or > by simply examining the ScriptScope after the script has finished? Or > should I simply ignore this?**** > > ** ** > > I'm wondering how other people who use IronPython as an embedded scripting > engine deal with these issues (if at all).**** > > ** ** > > Thanks,**** > > Igor**** > > ** ** > > On Fri, Feb 10, 2012 at 10:40 PM, Dino Viehland > wrote:**** > > We won?t call IDispose on them. Usually they?ll follow the pattern of > implementing IDisposable + having a finalizer so they will eventually > release their resources. Also they can be used with the ?with? statement > so that their Dispose methods are eagerly called.**** > > **** > > *From:* Igor Brejc [mailto:igor.brejc at gmail.com] > *Sent:* Friday, February 10, 2012 10:51 AM > *To:* Dino Viehland > *Cc:* Jeff Hardy; Ironpython-users at python.org > *Subject:* Re: [Ironpython-users] LightweightScopes and scopes in general* > *** > > **** > > **** > > On Fri, Feb 10, 2012 at 7:46 PM, Dino Viehland > wrote:**** > > > > Jeff wrote: > > I'm taking a stab off the top of my head based on my limited knowledge > of the > > internals, but I do know that debug code is not collectable. > > It's possible that the code itself may be holding references that keep > objects > > alive longer than expected. > > > > I believe if you run the code in a separate AppDomain you can unload the > > AppDomain and the code will be collected, which should take everything > else > > with it. > > > > > > > > I've also tried running in the release mode and turning on the > > > options["LightweightScopes"] = true mode, which seems to help. But I > > > cannot find any information about what this option actually does and > > > what happens with the scope variables in general. Any info would be > > appreciated. > > > > That one I'll have to leave to Dino.**** > > The difference between the different types of scopes just comes down to how > we hold onto global variable and call site objects. > > The most efficient way to hold onto these is to use CLR static fields to > store the > global variables. That allows the CLR to generate a direct access to the > field and > we can quickly access the global variables. But it comes at the cost of > not being > able to recover the static fields and leaking the values that are stored > in there. > > The light weight scopes store the variables in a field or an array instead > of storing > them in static fields. To do that we need to pass in the field or close > over it and then > on each access we need to do the field or array access (and if it's an > array access, it > needs to be bounds checked). But the end result is that the only thing > which is keeping > the global variable / call site objects alive are the delegate which > implements the > ScriptCode. Once the ScriptCode goes away all of those call sites and > PythonGlobal > objects can be collected. > > So lightweight scopes come at a performance cost, but they are more > applicable > Where you're actually re-compiling code regularly.**** > > **** > > Thanks for that explanation, Dino.**** > > **** > > Another question that pops up: what happens with Disposable objects (like > files, GDI+ bitmaps etc.) created within the Py scope (if they are not > referenced from the outside)? **** > > **** > > Igor**** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Sun Feb 12 20:42:35 2012 From: rome at Wintellect.com (Keith Rome) Date: Sun, 12 Feb 2012 11:42:35 -0800 Subject: [Ironpython-users] LightweightScopes and scopes in general In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54CA225C@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54CA2A5D@TK5EX14MBXC294.redmond.corp.microsoft.com> <7737799D90E55E4BB9C9F7E40D161E110E3C9655AC@VA3DIAXVS461.RED001.local> Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3C9655B6@VA3DIAXVS461.RED001.local> If you implement IDisposable, then it is generally expected that you would also implement a finalizer. Implementing one without the other is usually not a good idea. http://msdn.microsoft.com/en-us/library/b1yfkh5e(v=vs.100).aspx 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: Igor Brejc [mailto:igor.brejc at gmail.com] Sent: Sunday, February 12, 2012 2:04 PM To: Keith Rome Cc: Ironpython-users at python.org Subject: Re: [Ironpython-users] LightweightScopes and scopes in general On Sun, Feb 12, 2012 at 6:44 PM, Keith Rome > wrote: I am fairly sure it is no different than when using disposable objects in any .NET application. If you don?t call IDisposable.Dispose() directly (or via the ?using()? statement), then those objects will be disposed via their finalizer when the GC collects them. This happens automatically and fairly frequently in a .NET application. Those objects will be cleaned up for you ? assuming you really aren?t holding references to them. If you find they never seem to go away, then I highly recommend attaching a memory profiler (SciTech?s MemProfiler is superb) and exploring the heap graph for the root paths that are responsible for pinning them. I'm not a GC expert, but if I understand correctly, GC doesn't really call Dispose(), you have to implement the finalizer explicitly to do this (http://stackoverflow.com/questions/45036/will-the-garbage-collector-call-idisposable-dispose-for-me). Since (from my experience) most user-written disposable classes don't implement finalizers, this means that if you don't call Dispose() explicitly or using "using", the resource won't be released until the process stops. Even FxCop doesn't suggest writing finalizers, it just recommends using the proper Disposable pattern (http://geekswithblogs.net/sdorman/archive/2010/05/25/the-dispose-pattern-and-fxcop-warnings.aspx). On the other hand, I notice .NET Framework classes do seem to implement finalizers (FileStream, Image...): http://msdn.microsoft.com/en-us/library/system.io.filestream.finalize.aspx Take note that your ScriptScope itself is holding references to all of the objects contained within. You will need to discard all references to that ScriptScope if you want it (and its contents) to be collected by the runtime. Good suggestion, thanks. If you conclude that they truly are eligible for collection, and you just can?t wait for the system to clean up on its own, then you can always call GC.Collect() directly. I really don?t recommend that kind of brute force approach though. There are very few situations where calling GC.Collect() is really the right thing to do. I agree. 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 Igor Brejc Sent: Saturday, February 11, 2012 10:11 AM To: Dino Viehland Cc: Ironpython-users at python.org Subject: Re: [Ironpython-users] LightweightScopes and scopes in general I'm thinking of this scenario: my host application allows users to run their own Py scripts. OK, in the ideal case, their scripts should take care of the disposal of the reserved resources, but a lot of times user will write trail-and-error scripts which will often fail. Is there a mechanism for the host application to somehow track (and possibly dispose) of the stuff that has been allocated in a failed user script? Using SetTrace() or by simply examining the ScriptScope after the script has finished? Or should I simply ignore this? I'm wondering how other people who use IronPython as an embedded scripting engine deal with these issues (if at all). Thanks, Igor On Fri, Feb 10, 2012 at 10:40 PM, Dino Viehland > wrote: We won?t call IDispose on them. Usually they?ll follow the pattern of implementing IDisposable + having a finalizer so they will eventually release their resources. Also they can be used with the ?with? statement so that their Dispose methods are eagerly called. From: Igor Brejc [mailto:igor.brejc at gmail.com] Sent: Friday, February 10, 2012 10:51 AM To: Dino Viehland Cc: Jeff Hardy; Ironpython-users at python.org Subject: Re: [Ironpython-users] LightweightScopes and scopes in general On Fri, Feb 10, 2012 at 7:46 PM, Dino Viehland > wrote: Jeff wrote: > I'm taking a stab off the top of my head based on my limited knowledge of the > internals, but I do know that debug code is not collectable. > It's possible that the code itself may be holding references that keep objects > alive longer than expected. > > I believe if you run the code in a separate AppDomain you can unload the > AppDomain and the code will be collected, which should take everything else > with it. > > > > > I've also tried running in the release mode and turning on the > > options["LightweightScopes"] = true mode, which seems to help. But I > > cannot find any information about what this option actually does and > > what happens with the scope variables in general. Any info would be > appreciated. > > That one I'll have to leave to Dino. The difference between the different types of scopes just comes down to how we hold onto global variable and call site objects. The most efficient way to hold onto these is to use CLR static fields to store the global variables. That allows the CLR to generate a direct access to the field and we can quickly access the global variables. But it comes at the cost of not being able to recover the static fields and leaking the values that are stored in there. The light weight scopes store the variables in a field or an array instead of storing them in static fields. To do that we need to pass in the field or close over it and then on each access we need to do the field or array access (and if it's an array access, it needs to be bounds checked). But the end result is that the only thing which is keeping the global variable / call site objects alive are the delegate which implements the ScriptCode. Once the ScriptCode goes away all of those call sites and PythonGlobal objects can be collected. So lightweight scopes come at a performance cost, but they are more applicable Where you're actually re-compiling code regularly. Thanks for that explanation, Dino. Another question that pops up: what happens with Disposable objects (like files, GDI+ bitmaps etc.) created within the Py scope (if they are not referenced from the outside)? Igor -------------- next part -------------- An HTML attachment was scrubbed... URL: From ps at peter-schwalm.de Mon Feb 13 01:09:26 2012 From: ps at peter-schwalm.de (Peter Schwalm) Date: Mon, 13 Feb 2012 01:09:26 +0100 Subject: [Ironpython-users] fix for problem with lost working directory in compiled ironPython Message-ID: <4F3854B6.4030102@peter-schwalm.de> Hello, I reported a problem of compiled IronPython some weeks ago. The problem was: the current working from the ipy script is lost and replaced by the directory of the generated assembly. I have found a fix for that problem. It consists of a change of the generateExe() function in the compile-script pyc.py. How can I submit it to the developpers so that it can be included in the next release of IronPython? For those who are interested I have attached the modified version (called pycNew.py for the moment). Thank you Peter Schwalm -------------- next part -------------- A non-text attachment was scrubbed... Name: pycNew.zip Type: application/x-zip-compressed Size: 2702 bytes Desc: not available URL: From no_reply at codeplex.com Mon Feb 13 12:29:37 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 13 Feb 2012 03:29:37 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/12/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Enable running Python scripts on Windows Phone 7 2. [Status update] Tracking: Windows Mobile Support 3. [Status update] Add numpy ---------------------------------------------- ISSUES 1. [New comment] Enable running Python scripts on Windows Phone 7 http://ironpython.codeplex.com/workitem/26534 User jdhardy has commented on the issue: "Added in c0b7c80. Any specific problems with it should be opened as new issues."----------------- 2. [Status update] Tracking: Windows Mobile Support http://ironpython.codeplex.com/workitem/9191 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "Windows Mobile no longer exists. See http://ironpython.codeplex.com/workitem/26534 for Windows Phone support."----------------- 3. [Status update] Add numpy http://ironpython.codeplex.com/workitem/30381 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "This won't happen. The schedules don't sync up, and it doesn't make sense for either team to tie them together." ---------------------------------------------- ---------------------------------------------- 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 Feb 13 17:26:55 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 13 Feb 2012 08:26:55 -0800 Subject: [Ironpython-users] fix for problem with lost working directory in compiled ironPython In-Reply-To: <4F3854B6.4030102@peter-schwalm.de> References: <4F3854B6.4030102@peter-schwalm.de> Message-ID: On Sun, Feb 12, 2012 at 4:09 PM, Peter Schwalm wrote: > How can I submit it to the developpers so that it can be included in the > next release of IronPython? Ideally, the steps are similar to http://www.hanselman.com/blog/GetInvolvedInOpenSourceTodayHowToContributeAPatchToAGitHubHostedOpenSourceProjectLikeCode52.aspx, but for IronPython. I thought we had some IronPython-specific notes, but they are horribly out of date. One more thing for the TODO list, I guess. But that's a lot to get set up for a small fix, if you don't already have git et al. installed. Next best is a patch (or diff) that can be easily applied. Finally, if only one fie is changed, just the modified file is OK. Please attach it to the appropriate issue as well, as it will get forgotten in the email archives (and reply with the issue number as well). Thanks for fixing this. I'll make sure it gets into the next beta. - Jeff P.S. For any one else reading who's looking for a simple way to contribute, updating the docs on the wiki (https://github.com/IronLanguages/main/wiki) would be a great place to start. All you should need is a github account. From jdhardy at gmail.com Mon Feb 13 17:28:19 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 13 Feb 2012 08:28:19 -0800 Subject: [Ironpython-users] IronPython 2.7.2 Alpha 2 Available Message-ID: On behalf of the IronPython team, I'm happy to announce the second preview release of IronPython 2.7.2 is available at 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 Alpha 2 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. The intent is to add support for MonoTouch prior to the final release of 2.7.2, but it is a much bigger challenge. Windows 8 "Metro" apps may also be supported, but the previews release is rather close to the 2.7.2 target date. Otherwise, the biggest improvement in IronPython 2.7.2 is support for the zipimport module, thanks to Alex Earl, and the sqlite3 module. A bunch of other bugs have been fixed as well. The final release of IronPython 2.7.2 is currently set for March 11. Any fixes should be made available prior to the release of the RC on March 4th. - Jeff From jdhardy at gmail.com Mon Feb 13 17:42:33 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 13 Feb 2012 08:42:33 -0800 Subject: [Ironpython-users] IronPython Mobile Support Message-ID: The latest version of IronPython includes support for Android and Window Phone 7.5 devices. These are some rough notes for anyone who's interested: Android ---------- Supports full code generation and almost every feature. WP7 ----- Does not support creating types at runtime. The biggest limitation is that you cannot inherit from .NET types (except System.Object). A lot of platform pieces are also missing, like sockets. iOS --- Not supported - MonoTouch supports NO runtime code generation at all (not even DynamicMethod). I need to look deeper to see if it's possible to run without it. Obviously, the limitations need to be spelled out better. My inclination right now is to label the mobile platforms as "preview only" for 2.7.2 and improve them for 2.7.3 (due in June). Those who know these platforms better than I do, especially Android and WP7, should still give them a spin and open issues for any difficulties that they find. And, as always, patches are welcome. - Jeff From vernondcole at gmail.com Mon Feb 13 22:37:51 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 13 Feb 2012 14:37:51 -0700 Subject: [Ironpython-users] How can I detect whether I am running ipy.exe or ipy64.exe? Message-ID: I am testing adodbapi with IPy 2.7.2a2 -- using my new laptop which I have set up as an everything in 64-bit test bed. My default test database is an .mdb (so-called ACCESS database) file. Microsoft has decided that the JET engine, which has historically been used to read and write that format is to be deprecated, so there is no 64 bit version of it. It is replaced by the Access Database Engine 2010 redistributable.Of course, the new software requires a different connection string, one containing "Provider=Microsoft.ACE.OLEDB.12.0;". So, how can I tell which width of IronPython I am running, so I know which connection string to use? -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Feb 13 23:32:49 2012 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 13 Feb 2012 22:32:49 +0000 Subject: [Ironpython-users] How can I detect whether I am running ipy.exe or ipy64.exe? In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA5FA5@TK5EX14MBXC294.redmond.corp.microsoft.com> You can either check System.IntPtr.Size and see if it's 4 or 8 (which is what I've usually done in the past and works on all versions of .NET) or you can check System.Environment.Is64BitProcess (this will read a little better, but is new in .NET 4). From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Vernon Cole Sent: Monday, February 13, 2012 1:38 PM To: ironpython-users at python.org Subject: [Ironpython-users] How can I detect whether I am running ipy.exe or ipy64.exe? I am testing adodbapi with IPy 2.7.2a2 -- using my new laptop which I have set up as an everything in 64-bit test bed. My default test database is an .mdb (so-called ACCESS database) file. Microsoft has decided that the JET engine, which has historically been used to read and write that format is to be deprecated, so there is no 64 bit version of it. It is replaced by the Access Database Engine 2010 redistributable. Of course, the new software requires a different connection string, one containing "Provider=Microsoft.ACE.OLEDB.12.0;". So, how can I tell which width of IronPython I am running, so I know which connection string to use? -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Tue Feb 14 09:23:06 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Tue, 14 Feb 2012 08:23:06 +0000 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: References: Message-ID: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> Hi, Von: Jeff Hardy > The latest version of IronPython includes support for Android and Window Phone 7.5 devices. These are some rough notes for anyone who's interested: > Android > ---------- > Supports full code generation and almost every feature. Great news, thanks! > WP7 > ----- > Does not support creating types at runtime. The biggest limitation is that you cannot inherit from .NET types (except System.Object). A lot of platform pieces are also missing, like sockets. Something like this was to be expected. > iOS > --- > Not supported - MonoTouch supports NO runtime code generation at all (not even DynamicMethod). I need to look deeper to see if it's possible to run without it. The problem with the runtime code generation is a legal restriction by Apple, AFAIR. I just remembered that there was a pure interpreter mode in ancient times, but AFAIR, interpreters are also forbidden by the same license restrictions. Maybe a form of precompiled scripts could run there? But I don't know whether it's worth the effort... > Obviously, the limitations need to be spelled out better. My inclination right now is to label the mobile platforms as "preview only" for 2.7.2 and improve them for 2.7.3 (due in June). Those who know these platforms better than I do, especially Android and WP7, should still give them a spin and open issues for any difficulties that they find. > And, as always, patches are welcome. - Jeff _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users 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 no_reply at codeplex.com Tue Feb 14 16:00:22 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 14 Feb 2012 07:00:22 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/13/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] IronPython Android Support ---------------------------------------------- ISSUES 1. [New comment] IronPython Android Support http://ironpython.codeplex.com/workitem/32232 User jdhardy has commented on the issue: "Any bugs with Android support should have their own 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 jdhardy at gmail.com Tue Feb 14 19:08:34 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 14 Feb 2012 10:08:34 -0800 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> References: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> Message-ID: On Tue, Feb 14, 2012 at 12:23 AM, Markus Schaber wrote: >> iOS >> --- >> Not supported - MonoTouch supports NO runtime code generation at all (not even DynamicMethod). I need to look deeper to see if it's possible to run without it. > > The problem with the runtime code generation is a legal restriction by Apple, AFAIR. > > I just remembered that there was a pure interpreter mode in ancient times, but AFAIR, interpreters are also forbidden by the same license restrictions. > > Maybe a form of precompiled scripts could run there? But I don't know whether it's worth the effort... I'm pretty sure Apple does allow interpreters now; I believe EA embeds Lua in most of their games. The problem is that I'm not sure the interpreter mode is "pure" anymore, since every other platform has DynamicMethods, and I haven't had a chance to really dig into it. Alex has something cooking that might help, though. If not, then precompiling is an interesting thought - it would mean running everything through pyc first, but it might make it possible. I'm not sure pyc removes enough of the dynamicism though. One of my post-2.7.2 projects will be to write a very simple game (Coin-tossing or roulette or something) and port is to all of these platforms, which will ensure that they will work and that an IronPython app can get into the various stores. - Jeff From slide.o.mix at gmail.com Wed Feb 15 01:02:18 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 14 Feb 2012 17:02:18 -0700 Subject: [Ironpython-users] Work Item 19249 Message-ID: I'd like to get the thoughts of the community on work item 19249 [1]. I am thinking we want to either make it an option, or just leave it as is. I prefer the latter. Thanks, slide [1] http://ironpython.codeplex.com/workitem/19249 -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dblank at cs.brynmawr.edu Wed Feb 15 02:12:10 2012 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Tue, 14 Feb 2012 20:12:10 -0500 (EST) Subject: [Ironpython-users] Work Item 19249 In-Reply-To: References: Message-ID: <55969.76.98.34.255.1329268330.squirrel@cs.brynmawr.edu> > I'd like to get the thoughts of the community on work item 19249 [1]. I am > thinking we want to either make it an option, or just leave it as is. I > prefer the latter. I'd vote to leave as-is. There are was to make the request work, but as that deviates from standard Python, it is a signal to user and system that this is IronPython. -Doug > Thanks, > > slide > > [1] http://ironpython.codeplex.com/workitem/19249 > > -- > Website: http://earl-of-code.com > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From dinov at microsoft.com Wed Feb 15 02:06:58 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 15 Feb 2012 01:06:58 +0000 Subject: [Ironpython-users] Work Item 19249 In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA8706@TK5EX14MBXC294.redmond.corp.microsoft.com> I'm fine w/ either, but if it's an option it should be an option which disables adding the references for scenarios like Markus wants (otherwise there really is no reason to do it). 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, February 14, 2012 4:02 PM To: ironpython-users at python.org Subject: [Ironpython-users] Work Item 19249 I'd like to get the thoughts of the community on work item 19249 [1]. I am thinking we want to either make it an option, or just leave it as is. I prefer the latter. Thanks, slide [1] http://ironpython.codeplex.com/workitem/19249 -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Feb 15 02:38:39 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 14 Feb 2012 18:38:39 -0700 Subject: [Ironpython-users] Work Item 19249 In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CA8706@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CA8706@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: I was planning on making it an option to load assemblies, the current behavior would be the default. I am thinking it would be best to leave as-is though. Either that, or allow passing in assemblies to CreateEngine to add references to. On Tue, Feb 14, 2012 at 6:06 PM, Dino Viehland wrote: > I?m fine w/ either, but if it?s an option it should be an option which > disables adding the references for scenarios like Markus wants (otherwise > there really is no reason to do it).**** > > ** ** > > *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, February 14, 2012 4:02 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] Work Item 19249**** > > ** ** > > I'd like to get the thoughts of the community on work item 19249 [1]. I am > thinking we want to either make it an option, or just leave it as is. I > prefer the latter.**** > > ** ** > > Thanks,**** > > ** ** > > slide**** > > ** ** > > [1] http://ironpython.codeplex.com/workitem/19249 > **** > > ** ** > > -- > Website: http://earl-of-code.com**** > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Feb 15 02:06:10 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 15 Feb 2012 01:06:10 +0000 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: References: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> Message-ID: <9597F4A19BFDB342B6E90963100C33082F91C0D9@BY2PRD0310MB354.namprd03.prod.outlook.com> IronRuby does work with no IL generation whatsoever. The trick is to interpret all dynamic site rules. Tomas -----Original Message----- 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 Jeff Hardy Sent: Tuesday, February 14, 2012 10:09 AM To: Markus Schaber Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] IronPython Mobile Support On Tue, Feb 14, 2012 at 12:23 AM, Markus Schaber wrote: >> iOS >> --- >> Not supported - MonoTouch supports NO runtime code generation at all (not even DynamicMethod). I need to look deeper to see if it's possible to run without it. > > The problem with the runtime code generation is a legal restriction by Apple, AFAIR. > > I just remembered that there was a pure interpreter mode in ancient times, but AFAIR, interpreters are also forbidden by the same license restrictions. > > Maybe a form of precompiled scripts could run there? But I don't know whether it's worth the effort... I'm pretty sure Apple does allow interpreters now; I believe EA embeds Lua in most of their games. The problem is that I'm not sure the interpreter mode is "pure" anymore, since every other platform has DynamicMethods, and I haven't had a chance to really dig into it. Alex has something cooking that might help, though. If not, then precompiling is an interesting thought - it would mean running everything through pyc first, but it might make it possible. I'm not sure pyc removes enough of the dynamicism though. One of my post-2.7.2 projects will be to write a very simple game (Coin-tossing or roulette or something) and port is to all of these platforms, which will ensure that they will work and that an IronPython app can get into the various stores. - Jeff _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users From dinov at microsoft.com Wed Feb 15 03:27:48 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 15 Feb 2012 02:27:48 +0000 Subject: [Ironpython-users] Work Item 19249 In-Reply-To: References: <6C7ABA8B4E309440B857D74348836F2E54CA8706@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA890B@TK5EX14MBXC294.redmond.corp.microsoft.com> If it's an option to load the assemblies then users may as well just add the code to load it themselves. I think the point of fixing the bug was reducing the frustration factor when first using the hosting APIs and having it just work. So I'm fine w/ just closing it. From: Slide [mailto:slide.o.mix at gmail.com] Sent: Tuesday, February 14, 2012 5:39 PM To: Dino Viehland Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Work Item 19249 I was planning on making it an option to load assemblies, the current behavior would be the default. I am thinking it would be best to leave as-is though. Either that, or allow passing in assemblies to CreateEngine to add references to. On Tue, Feb 14, 2012 at 6:06 PM, Dino Viehland > wrote: I'm fine w/ either, but if it's an option it should be an option which disables adding the references for scenarios like Markus wants (otherwise there really is no reason to do it). 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, February 14, 2012 4:02 PM To: ironpython-users at python.org Subject: [Ironpython-users] Work Item 19249 I'd like to get the thoughts of the community on work item 19249 [1]. I am thinking we want to either make it an option, or just leave it as is. I prefer the latter. Thanks, slide [1] http://ironpython.codeplex.com/workitem/19249 -- Website: http://earl-of-code.com -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 15 03:29:39 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 15 Feb 2012 02:29:39 +0000 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: <9597F4A19BFDB342B6E90963100C33082F91C0D9@BY2PRD0310MB354.namprd03.prod.outlook.com> References: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> <9597F4A19BFDB342B6E90963100C33082F91C0D9@BY2PRD0310MB354.namprd03.prod.outlook.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CA8932@TK5EX14MBXC294.redmond.corp.microsoft.com> There's still subclassing after that which Ruby has a different trick for :) But interpreting call sites should be pretty easy, isn't it just override BindDelegate and call into a helper? > -----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 Tomas Matousek > Sent: Tuesday, February 14, 2012 5:06 PM > To: Jeff Hardy; Markus Schaber > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] IronPython Mobile Support > > IronRuby does work with no IL generation whatsoever. The trick is to interpret > all dynamic site rules. > > Tomas > > -----Original Message----- > 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 Jeff > Hardy > Sent: Tuesday, February 14, 2012 10:09 AM > To: Markus Schaber > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] IronPython Mobile Support > > On Tue, Feb 14, 2012 at 12:23 AM, Markus Schaber software.com> wrote: > >> iOS > >> --- > >> Not supported - MonoTouch supports NO runtime code generation at all (not > even DynamicMethod). I need to look deeper to see if it's possible to run > without it. > > > > The problem with the runtime code generation is a legal restriction by Apple, > AFAIR. > > > > I just remembered that there was a pure interpreter mode in ancient times, but > AFAIR, interpreters are also forbidden by the same license restrictions. > > > > Maybe a form of precompiled scripts could run there? But I don't know > whether it's worth the effort... > > I'm pretty sure Apple does allow interpreters now; I believe EA embeds Lua in > most of their games. The problem is that I'm not sure the interpreter mode is > "pure" anymore, since every other platform has DynamicMethods, and I haven't > had a chance to really dig into it. Alex has something cooking that might help, > though. > > If not, then precompiling is an interesting thought - it would mean running > everything through pyc first, but it might make it possible. > I'm not sure pyc removes enough of the dynamicism though. > > One of my post-2.7.2 projects will be to write a very simple game (Coin-tossing > or roulette or something) and port is to all of these platforms, which will ensure > that they will work and that an IronPython app can get into the various stores. > > - Jeff > _______________________________________________ > 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 From jdhardy at gmail.com Wed Feb 15 05:14:47 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 14 Feb 2012 20:14:47 -0800 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CA8932@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> <9597F4A19BFDB342B6E90963100C33082F91C0D9@BY2PRD0310MB354.namprd03.prod.outlook.com> <6C7ABA8B4E309440B857D74348836F2E54CA8932@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: On Tue, Feb 14, 2012 at 6:29 PM, Dino Viehland wrote: > There's still subclassing after that which Ruby has a different trick for :) > > But interpreting call sites should be pretty easy, isn't it just override BindDelegate and call into a helper? I think so, but I haven't had a chance to dig into yet. - Jeff >> -----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 Tomas Matousek >> Sent: Tuesday, February 14, 2012 5:06 PM >> To: Jeff Hardy; Markus Schaber >> Cc: ironpython-users at python.org >> Subject: Re: [Ironpython-users] IronPython Mobile Support >> >> IronRuby does work with no IL generation whatsoever. The trick is to interpret >> all dynamic site rules. >> >> Tomas >> >> -----Original Message----- >> 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 Jeff >> Hardy >> Sent: Tuesday, February 14, 2012 10:09 AM >> To: Markus Schaber >> Cc: ironpython-users at python.org >> Subject: Re: [Ironpython-users] IronPython Mobile Support >> >> On Tue, Feb 14, 2012 at 12:23 AM, Markus Schaber > software.com> wrote: >> >> iOS >> >> --- >> >> Not supported - MonoTouch supports NO runtime code generation at all (not >> even DynamicMethod). I need to look deeper to see if it's possible to run >> without it. >> > >> > The problem with the runtime code generation is a legal restriction by Apple, >> AFAIR. >> > >> > I just remembered that there was a pure interpreter mode in ancient times, but >> AFAIR, interpreters are also forbidden by the same license restrictions. >> > >> > Maybe a form of precompiled scripts could run there? But I don't know >> whether it's worth the effort... >> >> I'm pretty sure Apple does allow interpreters now; I believe EA embeds Lua in >> most of their games. The problem is that I'm not sure the interpreter mode is >> "pure" anymore, since every other platform has DynamicMethods, and I haven't >> had a chance to really dig into it. Alex has something cooking that might help, >> though. >> >> If not, then precompiling is an interesting thought - it would mean running >> everything through pyc first, but it might make it possible. >> I'm not sure pyc removes enough of the dynamicism though. >> >> One of my post-2.7.2 projects will be to write a very simple game (Coin-tossing >> or roulette or something) and port is to all of these platforms, which will ensure >> that they will work and that an IronPython app can get into the various stores. >> >> - Jeff >> _______________________________________________ >> 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 > > From bernd.viehmann at googlemail.com Wed Feb 15 11:07:39 2012 From: bernd.viehmann at googlemail.com (Bernd Viehmann) Date: Wed, 15 Feb 2012 11:07:39 +0100 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: References: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> <9597F4A19BFDB342B6E90963100C33082F91C0D9@BY2PRD0310MB354.namprd03.prod.outlook.com> <6C7ABA8B4E309440B857D74348836F2E54CA8932@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: Hello. Is there any web-resource to get an idea how to develop mobile solutions with iron-python. That would be very interesting for me. Thanks and kind regards Bernd Viehmann 2012/2/15 Jeff Hardy > On Tue, Feb 14, 2012 at 6:29 PM, Dino Viehland > wrote: > > There's still subclassing after that which Ruby has a different trick > for :) > > > > But interpreting call sites should be pretty easy, isn't it just > override BindDelegate and call into a helper? > > I think so, but I haven't had a chance to dig into yet. > > - Jeff > > >> -----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 Tomas Matousek > >> Sent: Tuesday, February 14, 2012 5:06 PM > >> To: Jeff Hardy; Markus Schaber > >> Cc: ironpython-users at python.org > >> Subject: Re: [Ironpython-users] IronPython Mobile Support > >> > >> IronRuby does work with no IL generation whatsoever. The trick is to > interpret > >> all dynamic site rules. > >> > >> Tomas > >> > >> -----Original Message----- > >> 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 Jeff > >> Hardy > >> Sent: Tuesday, February 14, 2012 10:09 AM > >> To: Markus Schaber > >> Cc: ironpython-users at python.org > >> Subject: Re: [Ironpython-users] IronPython Mobile Support > >> > >> On Tue, Feb 14, 2012 at 12:23 AM, Markus Schaber >> software.com> wrote: > >> >> iOS > >> >> --- > >> >> Not supported - MonoTouch supports NO runtime code generation at all > (not > >> even DynamicMethod). I need to look deeper to see if it's possible to > run > >> without it. > >> > > >> > The problem with the runtime code generation is a legal restriction > by Apple, > >> AFAIR. > >> > > >> > I just remembered that there was a pure interpreter mode in ancient > times, but > >> AFAIR, interpreters are also forbidden by the same license restrictions. > >> > > >> > Maybe a form of precompiled scripts could run there? But I don't know > >> whether it's worth the effort... > >> > >> I'm pretty sure Apple does allow interpreters now; I believe EA embeds > Lua in > >> most of their games. The problem is that I'm not sure the interpreter > mode is > >> "pure" anymore, since every other platform has DynamicMethods, and I > haven't > >> had a chance to really dig into it. Alex has something cooking that > might help, > >> though. > >> > >> If not, then precompiling is an interesting thought - it would mean > running > >> everything through pyc first, but it might make it possible. > >> I'm not sure pyc removes enough of the dynamicism though. > >> > >> One of my post-2.7.2 projects will be to write a very simple game > (Coin-tossing > >> or roulette or something) and port is to all of these platforms, which > will ensure > >> that they will work and that an IronPython app can get into the various > stores. > >> > >> - Jeff > >> _______________________________________________ > >> 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 > > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- Mit freundlichen Gr??en www.it-viehmann.de Bernd Viehmann Mahrweg 46 41836 H?ckelhoven Tel.: 02433 9640 100 Fax: 02433 9640 109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Feb 15 11:28:07 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 15 Feb 2012 02:28:07 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/14/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] ImportError: No module named Tkinter 2. [Status update] Import System does not work when script called from C# ---------------------------------------------- ISSUES 1. [New comment] ImportError: No module named Tkinter http://ironpython.codeplex.com/workitem/23875 User slide_o_mix has commented on the issue: "I'm not sure we should fix this :-)"----------------- 2. [Status update] Import System does not work when script called from C# http://ironpython.codeplex.com/workitem/19249 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This will not be changed." ---------------------------------------------- ---------------------------------------------- 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 Wed Feb 15 20:25:08 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 15 Feb 2012 11:25:08 -0800 Subject: [Ironpython-users] IronPython Mobile Support In-Reply-To: References: <727D8E16AE957149B447FE368139F2B50D72755C@SERVER10> <9597F4A19BFDB342B6E90963100C33082F91C0D9@BY2PRD0310MB354.namprd03.prod.outlook.com> <6C7ABA8B4E309440B857D74348836F2E54CA8932@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: On Wed, Feb 15, 2012 at 2:07 AM, Bernd Viehmann wrote: > Hello. > > Is there any web-resource to get an idea how to develop mobile solutions > with iron-python. That would be very interesting for me. Sort of, but not really. Embedding IronPython in a mobile app is exactly like embedding it in a desktop app (and AFAIK you'll always have to embed it in a C# stub, but in the future we'll provide a boilerplate stub), so that's a good place to start and there are plenty of docs on how to do that. However, there are issues around packaging & deployment for mobiles (esp. the standard library) that I haven't worked through yet. If you (or anyone else reading this!) re willing to endure some difficulties, and you're already experienced with one of the mobile platforms or planning on learning, it would be great to have some help testing this out and figuring out the best way to do it. Better mobile-focused docs will probably have to wait until the 2.7.3-ish timeframe, but I wouldn't consider the mobile platforms "production-ready" until around then anyway. For 2.7.2 they'll be very, very beta. - Jeff From vernondcole at gmail.com Wed Feb 15 20:53:21 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 15 Feb 2012 12:53:21 -0700 Subject: [Ironpython-users] should 64 bit sys.maxsize be fixed? In-Reply-To: References: Message-ID: Should this be fixed in a future version? C:\Users\vernon>c:\python32\python.exe Python 3.2.2 (default, Sep 4 2011, 09:07:29) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxsize 9223372036854775807 >>> exit() C:\Users\vernon>"c:\program files (x86)\IronPython 2.7\ipy64" IronPython 2.7.2a2 (2.7.0.40) on .NET 4.0.30319.239 (64-bit) Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxsize 2147483647 C:\Users\vernon>c:\python27\python.exe Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxsize 9223372036854775807L >>> -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Feb 15 21:32:08 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 15 Feb 2012 12:32:08 -0800 Subject: [Ironpython-users] should 64 bit sys.maxsize be fixed? In-Reply-To: References: Message-ID: It's actually correct. Arrays in .NET 64-bit are still limited to 2147483647 elements[1], so the value is accurate. - Jeff [1] http://stackoverflow.com/questions/2338778/what-is-the-maximum-length-of-an-array-in-net-on-64-bit-windows On Wed, Feb 15, 2012 at 11:53 AM, Vernon Cole wrote: > > Should this be fixed in a future version? > > > C:\Users\vernon>c:\python32\python.exe > Python 3.2.2 (default, Sep? 4 2011, 09:07:29) [MSC v.1500 64 bit (AMD64)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> import sys >>>> sys.maxsize > 9223372036854775807 >>>> exit() > > C:\Users\vernon>"c:\program files (x86)\IronPython 2.7\ipy64" > IronPython 2.7.2a2 (2.7.0.40) on .NET 4.0.30319.239 (64-bit) > Type "help", "copyright", "credits" or "license" for more information. >>>> import sys >>>> sys.maxsize > 2147483647 > > C:\Users\vernon>c:\python27\python.exe > Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> import sys >>>> sys.maxsize > 9223372036854775807L >>>> > > -- > Vernon > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From vernondcole at gmail.com Thu Feb 16 03:37:16 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 15 Feb 2012 19:37:16 -0700 Subject: [Ironpython-users] should 64 bit sys.maxsize be fixed? In-Reply-To: References: Message-ID: Thanks, Jeff, that sheds proper light on the subject. I now have it through my head what "maxsize" means. I was hoping for a single test which would detect 64-bit-ed-ness in both Iron and C Python, but it was not to be. Looks like I'll have to detect platform first before testing for word size. But I am going to blindly assume that any Python which does not define sys.maxsize is 32 bit -- I think that will be safe enough. By the way -- to help thick headed persons like me who might occasionally slip and use the old address, it would be nice if the "you screwed up" message which is automatically sent to the sender... were changed to a "you screwed up but I am fixing it for you" message. That way no one else will post the same message twice when he tries to fix his own mistake. -- Vernon On Wed, Feb 15, 2012 at 1:32 PM, Jeff Hardy wrote: > It's actually correct. Arrays in .NET 64-bit are still limited to > 2147483647 elements[1], so the value is accurate. > > - Jeff > > [1] > http://stackoverflow.com/questions/2338778/what-is-the-maximum-length-of-an-array-in-net-on-64-bit-windows > > On Wed, Feb 15, 2012 at 11:53 AM, Vernon Cole > wrote: > > > > Should this be fixed in a future version? > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Feb 16 09:53:33 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 16 Feb 2012 00:53:33 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/15/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] ImportError: No module named Tkinter 2. [Status update] visual studio integration __name__ setting - Issue with Static compilation 3. [Status update] PythonEngine initialization 4. [Status update] Icons for ipy.exe and ipyw.exe both have 'ipy' image 5. [Status update] output exe from visual studio 6. [Status update] inronclad running in code error, whose problem? 7. [New comment] Issues installing IronPython 2.6.1 on windows 7 64 bit 8. [Status update] Provide ClearScreen functionality for IronPython Shell 9. [Status update] 2.6.2 has wrong version info 10. [New comment] COM objects unusable from ipy.exe on x64 platforms 11. [New comment] Support .ipy extension for IronPython files 12. [Status update] Support .ipy extension for IronPython files 13. [New comment] %reset is missing newline when using reset button 14. [Status update] %reset is missing newline when using reset button 15. [New comment] current working directory lost in compiled script ---------------------------------------------- ISSUES 1. [Status update] ImportError: No module named Tkinter http://ironpython.codeplex.com/workitem/23875 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "I concur."----------------- 2. [Status update] visual studio integration __name__ setting - Issue with Static compilation http://ironpython.codeplex.com/workitem/2537 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Deprecated in favor of Python Tools for Visual Studio"----------------- 3. [Status update] PythonEngine initialization http://ironpython.codeplex.com/workitem/20022 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Not an issue."----------------- 4. [Status update] Icons for ipy.exe and ipyw.exe both have 'ipy' image http://ironpython.codeplex.com/workitem/23334 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This is the same as CPython, both python.exe and pythonw.exe have the same icon."----------------- 5. [Status update] output exe from visual studio http://ironpython.codeplex.com/workitem/28474 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Not a bug"----------------- 6. [Status update] inronclad running in code error, whose problem? http://ironpython.codeplex.com/workitem/28305 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Closing as asked by submitter"----------------- 7. [New comment] Issues installing IronPython 2.6.1 on windows 7 64 bit http://ironpython.codeplex.com/workitem/28657 User slide_o_mix has commented on the issue: "Is this still an issue?"----------------- 8. [Status update] Provide ClearScreen functionality for IronPython Shell http://ironpython.codeplex.com/workitem/622 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Deprecated in favor of Python Tools for Visual Studio."----------------- 9. [Status update] 2.6.2 has wrong version info http://ironpython.codeplex.com/workitem/29498 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Works on 2.7.1"----------------- 10. [New comment] COM objects unusable from ipy.exe on x64 platforms http://ironpython.codeplex.com/workitem/23587 User slide_o_mix has commented on the issue: "I don't get the same error now: IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239 Type "help", "copyright", "credits" or "license" for more information. >>> com_type_name = "DlrComLibrary.DlrComServer" >>> from System import Activator, Type >>> temp_type = Type.GetTypeFromProgID(com_type_name) >>> instance = Activator.CreateInstance(temp_type) Traceback (most recent call last): File "", line 1, in TypeError: Multiple targets could match: CreateInstance(ActivationContext), CreateInstance(Type), CreateInstance(Type, Array[object])"----------------- 11. [New comment] Support .ipy extension for IronPython files http://ironpython.codeplex.com/workitem/20292 User slide_o_mix has commented on the issue: "I'm not sure we should fix this."----------------- 12. [Status update] Support .ipy extension for IronPython files http://ironpython.codeplex.com/workitem/20292 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "PEP 397 (http://www.python.org/dev/peps/pep-0397/) takes care of the launcher problem, so no, this won't be implemented."----------------- 13. [New comment] %reset is missing newline when using reset button http://ironpython.codeplex.com/workitem/27857 User slide_o_mix has commented on the issue: "Should this be closed then?"----------------- 14. [Status update] %reset is missing newline when using reset button http://ironpython.codeplex.com/workitem/27857 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "IPyTools is no longer under development."----------------- 15. [New comment] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32045 User jdhardy has commented on the issue: "Fixed in 83d4d1f." ---------------------------------------------- ---------------------------------------------- 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 Fri Feb 17 13:16:05 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 17 Feb 2012 04:16:05 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/16/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] Silverlight Projects should default to SL4 2. [Status update] newline-and-indent within delimiters should indent to the tightest open delimiter 3. [Status update] Need some error reporting when F5 cannot even load code 4. [Status update] Please give CLR2 and CLR4 versions of the DLR different assembly version numbers, or different names 5. [Status update] DLR DLLs versioning moving backward 6. [Status update] PERF: Internal checkin 1258456 caused a 27% degrade in Pybench(Exceptions) 7. [Status update] Implement PEP-342 (coroutines implemented via enhanced generator support) 8. [Status update] perf degrade (SFC startup) caused by checkin# 361128 9. [Status update] perf degrade (shootout: chameneos...) caused by checkin# 330828 (fix exception stack management) 10. [Status update] perf degrade (Pybench Lookups: NormalInstanceAttribute) caused by checkin# 193711 11. [Status update] perf degrade (Pybench Calls: PythonMethodCalls) caused by checkin# 193711 12. [Status update] perf: changeset 233942 caused perf2_call_splat degrade 13. [Status update] Checkin 444180 caused a couple of 30%+ degrades in IP benchmarks 14. [Status update] tf changeset 804842 caused significant perf degrades in IronPython 15. [Status update] tf changeset 867352 caused a 21% perf degrade in Micro\method_binder 16. [Status update] tf changeset 955994 caused significant perf degrades in a couple of IP benchmarks 17. [Status update] tf changeset 960670 caused 60% perf degrade in cross language interop 18. [Status update] test blocking: undo checkin 305298 (disable dst related tests failed in main queue) 19. [Status update] tf changeset 6566583 broke SunSpider (IP) tests in the CLR Perf lab 20. [New comment] IronPython 2.7.1 csv pyc 21. [New issue] problem parsing quoted arguments ending in \ 22. [New comment] problem parsing quoted arguments ending in \ 23. [New comment] problem parsing quoted arguments ending in \ 24. [New comment] problem parsing quoted arguments ending in \ 25. [New comment] problem parsing quoted arguments ending in \ 26. [New comment] problem parsing quoted arguments ending in \ 27. [New comment] problem parsing quoted arguments ending in \ 28. [New comment] problem parsing quoted arguments ending in \ 29. [Status update] problem parsing quoted arguments ending in \ ---------------------------------------------- ISSUES 1. [Status update] Silverlight Projects should default to SL4 http://ironpython.codeplex.com/workitem/30084 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "IronPython Tools is no longer developed. Use Python Tools for Visual Studio (pytools.codeplex.com) instead."----------------- 2. [Status update] newline-and-indent within delimiters should indent to the tightest open delimiter http://ironpython.codeplex.com/workitem/28527 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "IronPython Tools is no longer developed. Use Python Tools for Visual Studio (pytools.codeplex.com) instead."----------------- 3. [Status update] Need some error reporting when F5 cannot even load code http://ironpython.codeplex.com/workitem/28322 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "IronPython Tools is no longer developed. Use Python Tools for Visual Studio (pytools.codeplex.com) instead."----------------- 4. [Status update] Please give CLR2 and CLR4 versions of the DLR different assembly version numbers, or different names http://ironpython.codeplex.com/workitem/30210 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "I can't see how this would help. I'd recommend putting each version of the depending assembly (and the DLR dependencies) in its own folder. If there's another use-case leave a comment and I'll re-open."----------------- 5. [Status update] DLR DLLs versioning moving backward http://ironpython.codeplex.com/workitem/30208 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "The DLR assemblies got re-numbered for 2.7 to make them more consistent. Future releases will be numbered the way you suggest."----------------- 6. [Status update] PERF: Internal checkin 1258456 caused a 27% degrade in Pybench(Exceptions) http://ironpython.codeplex.com/workitem/25277 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what internal checking this refers to."----------------- 7. [Status update] Implement PEP-342 (coroutines implemented via enhanced generator support) http://ironpython.codeplex.com/workitem/375 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "PEP 342 has been supported for a while."----------------- 8. [Status update] perf degrade (SFC startup) caused by checkin# 361128 http://ironpython.codeplex.com/workitem/23951 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 9. [Status update] perf degrade (shootout: chameneos...) caused by checkin# 330828 (fix exception stack management) http://ironpython.codeplex.com/workitem/23953 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 10. [Status update] perf degrade (Pybench Lookups: NormalInstanceAttribute) caused by checkin# 193711 http://ironpython.codeplex.com/workitem/23955 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 11. [Status update] perf degrade (Pybench Calls: PythonMethodCalls) caused by checkin# 193711 http://ironpython.codeplex.com/workitem/23958 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 12. [Status update] perf: changeset 233942 caused perf2_call_splat degrade http://ironpython.codeplex.com/workitem/23996 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 13. [Status update] Checkin 444180 caused a couple of 30%+ degrades in IP benchmarks http://ironpython.codeplex.com/workitem/24052 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 14. [Status update] tf changeset 804842 caused significant perf degrades in IronPython http://ironpython.codeplex.com/workitem/24095 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 15. [Status update] tf changeset 867352 caused a 21% perf degrade in Micro\method_binder http://ironpython.codeplex.com/workitem/24096 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 16. [Status update] tf changeset 955994 caused significant perf degrades in a couple of IP benchmarks http://ironpython.codeplex.com/workitem/24098 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 17. [Status update] tf changeset 960670 caused 60% perf degrade in cross language interop http://ironpython.codeplex.com/workitem/24099 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 18. [Status update] test blocking: undo checkin 305298 (disable dst related tests failed in main queue) http://ironpython.codeplex.com/workitem/23817 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 19. [Status update] tf changeset 6566583 broke SunSpider (IP) tests in the CLR Perf lab http://ironpython.codeplex.com/workitem/24081 User jdhardy has updated the issue: Status has changed from Active to Closed with the following comment, "No way to know what change an internal changeset corresponds to."----------------- 20. [New comment] IronPython 2.7.1 csv pyc http://ironpython.codeplex.com/workitem/31800 User slide_o_mix has commented on the issue: "FYI, to get csv to import correctly with 2.7.1, you can do the following: >ipy pyc.py /main:test.py /target:exe test.py \csv.py \functools.py (functools is required by csv) "----------------- 21. [New issue] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User markheath has proposed the issue: "If you have the following ironpython script, called test.py: import sys for arg in sys.argv: print '{0}'.format(arg) and then you call it using: ipy test.py "C:\hello world\" "D:\number two\" the output is: test.py C:\hello world" D:\number two" to workaround you have to call: ipy test.py "C:\hello world\\" "D:\number two\\" this is a pain when calling ipy in a post-build step from Visual Studio with macros as the arguments"----------------- 22. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User markheath has commented on the issue: "I should add, this problem was with ipy 2.7.1"----------------- 23. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User jdhardy has commented on the issue: "Running on a Mac (zsh shell, mono 2.10): % mono bin/Debug/ipy.exe test.py "D:\foo\" "E:\Foo\" test.py D:\foo" E:Foo" % mono bin/Debug/ipy.exe test.py 'D:\foo\' 'E:\Foo\' test.py D:\foo\ E:\Foo\ % I'll try a Windows machine when I get a chance. "----------------- 24. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User slide_o_mix has commented on the issue: "The following C# program has similar output, as does the C++ application below. This has to do with how Windows parses the arguments, not anything specific to IronPython. class Program { static void Main(string[] args) { foreach (string arg in args) { System.Console.WriteLine(arg); } } } C# Output: C:\hello world" D:\number two" Press any key to continue . . . #include int main(int argc, char* argv[]) { for(int i = 0; i < argc; i++) { std::cout << argv[i] << std::endl; } return 0; } C++ Output: TestCPP.exe C:\hello world" D:\number two" Press any key to continue . . . "----------------- 25. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User slide_o_mix has commented on the issue: "This is not a bug, it's standard Windows argument parsing."----------------- 26. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User slide_o_mix has commented on the issue: "Python also behaves this way on windows >python.exe args.py "C:\hello world\" "D:\number two\" args.py C:\hello world" D:\number two""----------------- 27. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User markheath has commented on the issue: "wow, that's weird. I was try to replace a batch file that somehow managed to sort out those arguments just fine. But I'll take your word for it, and sorry for false alarm. I had been thrown by the discovery that in python a string can't end with a single \ even if it is prefixed with r."----------------- 28. [New comment] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User slide_o_mix has commented on the issue: "Yeah, the following works as you were expecting: test.bat @echo off FOR %%A IN (%*) DO ( echo %%A ) >test.bat "C:\hello world\" "D:\number two\" "C:\hello world\" "D:\number two\" "----------------- 29. [Status update] problem parsing quoted arguments ending in \ http://ironpython.codeplex.com/workitem/32264 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Not a bug" ---------------------------------------------- ---------------------------------------------- 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 desleo at gmail.com Sat Feb 18 05:33:10 2012 From: desleo at gmail.com (Leo Carbajal) Date: Fri, 17 Feb 2012 22:33:10 -0600 Subject: [Ironpython-users] [IronPython] NuGet packaging In-Reply-To: References: Message-ID: Sorry to revive an old thread, so to speak, but I noticed IPy is still listed at 2.6.1 in the Nuget packet manager. Are there still plans to update this? On Mon, Feb 7, 2011 at 8:48 AM, Jeff Hardy wrote: > I'm already the owner of that package; I just need to build an > updated. I forgot that it was still on 2.6.1. > > The .nuspec file should also be added to the repo and eventually just > part of the build process. > > - Jeff > > On Mon, Feb 7, 2011 at 5:32 AM, Richard Nienaber > wrote: > > I searched in the NuGet gallery for IronPython and found that the > version is > > still 2.6.1. It might be good to find out the process for updating this > > before the 2.7 release. > > > > Is there someone we can contact to update this or is this something we > can > > do ourselves? > > > > Richard > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sat Feb 18 16:19:38 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 18 Feb 2012 07:19:38 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] zipimport does not correctly import submodules 2. [New comment] PYC - Allow the Setting of the Icon if generating EXE 3. [New comment] Visual Studio 2010 crashes when Iron Python 2.7A1 is installed and you try to attach process (normal C# desktop program) ---------------------------------------------- ISSUES 1. [New issue] zipimport does not correctly import submodules http://ironpython.codeplex.com/workitem/32274 User slide_o_mix has proposed the issue: "When trying to import a submodule from an egg, zipimport fails to find the module in the implementation."----------------- 2. [New comment] PYC - Allow the Setting of the Icon if generating EXE http://ironpython.codeplex.com/workitem/22138 User slide_o_mix has commented on the issue: "This might take some doing since it would require setting up an unmanaged resource (DefineUnmanagedResource) on the resulting executable. The res file format is documented, but would need some library behind it, or a pure python module that could generate it from an icon file."----------------- 3. [New comment] Visual Studio 2010 crashes when Iron Python 2.7A1 is installed and you try to attach process (normal C# desktop program) http://ironpython.codeplex.com/workitem/29021 User slide_o_mix has commented on the issue: "I can't reproduce this, can you give some more information?" ---------------------------------------------- ---------------------------------------------- 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 Sat Feb 18 16:37:47 2012 From: slide.o.mix at gmail.com (Slide) Date: Sat, 18 Feb 2012 08:37:47 -0700 Subject: [Ironpython-users] [IronPython] NuGet packaging In-Reply-To: References: Message-ID: The short answer is yes :-) I think Jeff is working on this, we had lost the nuget packaging file at one point but were able to retrieve it. Jeff would be able to give you a better idea as to when and so forth. On Fri, Feb 17, 2012 at 9:33 PM, Leo Carbajal wrote: > Sorry to revive an old thread, so to speak, but I noticed IPy is still > listed at 2.6.1 in the Nuget packet manager. Are there still plans to > update this? > > > On Mon, Feb 7, 2011 at 8:48 AM, Jeff Hardy wrote: > >> I'm already the owner of that package; I just need to build an >> updated. I forgot that it was still on 2.6.1. >> >> The .nuspec file should also be added to the repo and eventually just >> part of the build process. >> >> - Jeff >> >> On Mon, Feb 7, 2011 at 5:32 AM, Richard Nienaber >> wrote: >> > I searched in the NuGet gallery for IronPython and found that the >> version is >> > still 2.6.1. It might be good to find out the process for updating this >> > before the 2.7 release. >> > >> > Is there someone we can contact to update this or is this something we >> can >> > do ourselves? >> > >> > Richard >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > _______________________________________________ > 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 vernondcole at gmail.com Sat Feb 18 17:42:52 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Sat, 18 Feb 2012 09:42:52 -0700 Subject: [Ironpython-users] How can I detect whether I am running a 64.bit version of Windows? Message-ID: Thanks for your help, everyone. The following appears to do what I asked for: """is64bit() returns boolean value of detected Python word size""" def is64bit(): import sys if sys.platform == 'cli': # IronPython import System return System.IntPtr.Size == 8 else: # CPython try: return sys.maxsize > 2147483647 except AttributeError: return False # assume old versions of Python are 32 bit. if __name__ == "__main__": print ("is64bit =", is64bit()) Unfortunately I did not ask for what I actaully _needed_ : The correct question should have been: How do I detect whether I am running on a 64 bit version of Windows (even though I might be using 32 bit Python)? -- Vernon On Mon, Feb 13, 2012 at 3:32 PM, Dino Viehland wrote: > You can either check System.IntPtr.Size and see if it?s 4 or 8 (which is > what I?ve usually done in the past and works on all versions of .NET) or > you can check System.Environment.Is64BitProcess (this will read a little > better, but is new in .NET 4).**** > > ** ** > > *From:* ironpython-users-bounces+dinov=microsoft.com at python.org [mailto: > ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Vernon > Cole > *Sent:* Monday, February 13, 2012 1:38 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] How can I detect whether I am running > ipy.exe or ipy64.exe?**** > > ** ** > > I am testing adodbapi with IPy 2.7.2a2 -- using my new laptop which I have > set up as an everything in 64-bit test bed. > > My default test database is an .mdb (so-called ACCESS database) file. > Microsoft has decided that the JET engine, which has historically been used > to read and write that format is to be deprecated, so there is no 64 bit > version of it. It is replaced by the Access Database Engine 2010 > redistributable.Of course, the new software requires a different connection string, one > containing "Provider=Microsoft.ACE.OLEDB.12.0;". > > So, how can I tell which width of IronPython I am running, so I know which > connection string to use? > -- > Vernon**** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Feb 18 18:29:54 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 18 Feb 2012 09:29:54 -0800 Subject: [Ironpython-users] [IronPython] NuGet packaging In-Reply-To: References: Message-ID: Yeah, the nuget packaging almost works again. It'll definitely be updated for 2.7.2. - Jeff On Sat, Feb 18, 2012 at 7:37 AM, Slide wrote: > The short answer is yes :-) I think Jeff is working on this, we had lost the > nuget packaging file at one point but were able to retrieve it. Jeff would > be able to give you a better idea as to when and so forth. > > On Fri, Feb 17, 2012 at 9:33 PM, Leo Carbajal wrote: >> >> Sorry to revive an old thread, so to speak, but I noticed IPy is still >> listed at 2.6.1 in the Nuget packet manager. Are there still plans to update >> this? >> >> >> On Mon, Feb 7, 2011 at 8:48 AM, Jeff Hardy wrote: >>> >>> I'm already the owner of that package; I just need to build an >>> updated. I forgot that it was still on 2.6.1. >>> >>> The .nuspec file should also be added to the repo and eventually just >>> part of the build process. >>> >>> - Jeff >>> >>> On Mon, Feb 7, 2011 at 5:32 AM, Richard Nienaber >>> wrote: >>> > I searched in the NuGet gallery for IronPython and found that the >>> > version is >>> > still 2.6.1. It might be good to find out the process for updating this >>> > before the 2.7 release. >>> > >>> > Is there someone we can contact to update this or is this something we >>> > can >>> > do ourselves? >>> > >>> > Richard >>> > >>> > _______________________________________________ >>> > Users mailing list >>> > Users at lists.ironpython.com >>> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> > >>> > >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> _______________________________________________ >> 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 jdhardy at gmail.com Sat Feb 18 22:35:58 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 18 Feb 2012 13:35:58 -0800 Subject: [Ironpython-users] How can I detect whether I am running a 64.bit version of Windows? In-Reply-To: References: Message-ID: IsWow64Process() (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684139(v=vs.85).aspx) is the function you want, and you should be able to use ctypes to call it from CPython and IronPython. - Jeff On Sat, Feb 18, 2012 at 8:42 AM, Vernon Cole wrote: > Thanks for your help, everyone. > > The following appears to do what I asked for: > > """is64bit() returns boolean value of detected Python word size""" > def is64bit(): > ??? import sys > ??? if sys.platform == 'cli': # IronPython > ??????? import System > ??????? return System.IntPtr.Size == 8 > ??? else:? # CPython > ??????? try: > ??????????? return sys.maxsize > 2147483647 > ??????? except AttributeError: > ??????????? return False? # assume old versions of Python are 32 bit. > > if __name__ == "__main__": > ??? print ("is64bit =", is64bit()) > > > Unfortunately ? I did not ask > for what I actaully _needed_? : > > The correct question should have been: > How do I detect whether I am running on a 64 bit version of Windows (even > though I might be using 32 bit Python)? > -- > Vernon > > On Mon, Feb 13, 2012 at 3:32 PM, Dino Viehland wrote: >> >> You can either check System.IntPtr.Size and see if it?s 4 or 8 (which is >> what I?ve usually done in the past and works on all versions of .NET) or you >> can check System.Environment.Is64BitProcess (this will read a little better, >> but is new in .NET 4). >> >> >> >> From: ironpython-users-bounces+dinov=microsoft.com at python.org >> [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf >> Of Vernon Cole >> Sent: Monday, February 13, 2012 1:38 PM >> To: ironpython-users at python.org >> Subject: [Ironpython-users] How can I detect whether I am running ipy.exe >> or ipy64.exe? >> >> >> >> I am testing adodbapi with IPy 2.7.2a2 -- using my new laptop which I have >> set up as an everything in 64-bit test bed. >> >> My default test database is an .mdb (so-called ACCESS database) file. >> Microsoft has decided that the JET engine, which has historically been used >> to read and write that format is to be deprecated, so there is no 64 bit >> version of it.? It is replaced by the Access Database Engine 2010 >> redistributable. Of course, the new software requires a different connection >> string, one containing "Provider=Microsoft.ACE.OLEDB.12.0;". >> >> So, how can I tell which width of IronPython I am running, so I know which >> connection string to use? >> -- >> Vernon > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From gbantle at gmail.com Sun Feb 19 00:07:06 2012 From: gbantle at gmail.com (Geoffrey Bantle) Date: Sat, 18 Feb 2012 18:07:06 -0500 Subject: [Ironpython-users] Dotted assembly names and import Message-ID: Hello, I have a question about assemblies compiled with pyc.py. If you just name them normally like, "Foobar.dll" or "Snafu.dll" you can add a reference to them and import them into IronPython as one would expect. If however you name them like "Foobar.Snafu.dll" you can add a reference to them but it does not seem like you can import them at all. You are given the error: "ImportError: No module named Snafu" Is this intended behavior? My understanding is that dotted assembly names are quite common in .Net and I have a project where I would like to have assemblies compiled by pyc.py to sit side by side with assemblies written in C#. Maybe this is not the natural way to do things? Any help is appreciated. Best Regards, Geoffrey Bantle gbantle at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Sun Feb 19 00:41:35 2012 From: rome at Wintellect.com (Keith Rome) Date: Sat, 18 Feb 2012 15:41:35 -0800 Subject: [Ironpython-users] Dotted assembly names and import In-Reply-To: References: Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3C9660B9@VA3DIAXVS461.RED001.local> The import statement is used for namespaces, which usually (but don't have to) match the assembly names. You reference the assembly once, and import whatever types/namespaces you need from it. Thinking of it in another way, referencing the assembly grants the ability to import from that assembly. But in itself it does nothing apparent from the perspective of the consuming script. This is similar to how C#/VB work where you reference the assembly once for your project, and then you place using/import statements at the top of individual code files to bring the types contained within the assembly into scope. 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 Geoffrey Bantle Sent: Saturday, February 18, 2012 6:07 PM To: ironpython-users at python.org Subject: [Ironpython-users] Dotted assembly names and import Hello, I have a question about assemblies compiled with pyc.py. If you just name them normally like, "Foobar.dll" or "Snafu.dll" you can add a reference to them and import them into IronPython as one would expect. If however you name them like "Foobar.Snafu.dll" you can add a reference to them but it does not seem like you can import them at all. You are given the error: "ImportError: No module named Snafu" Is this intended behavior? My understanding is that dotted assembly names are quite common in .Net and I have a project where I would like to have assemblies compiled by pyc.py to sit side by side with assemblies written in C#. Maybe this is not the natural way to do things? Any help is appreciated. Best Regards, Geoffrey Bantle gbantle at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From gbantle at gmail.com Sun Feb 19 01:27:39 2012 From: gbantle at gmail.com (Geoffrey Bantle) Date: Sat, 18 Feb 2012 19:27:39 -0500 Subject: [Ironpython-users] Dotted assembly names and import In-Reply-To: <7737799D90E55E4BB9C9F7E40D161E110E3C9660B9@VA3DIAXVS461.RED001.local> References: <7737799D90E55E4BB9C9F7E40D161E110E3C9660B9@VA3DIAXVS461.RED001.local> Message-ID: Hi Keith, Thanks for your response. I actually am familiar with python's import statement as I have been programming in python for years now :) I'm afraid I don't see how your response answers my question about dotted assembly names and python code compiled with pyc.py. Could you maybe clarify for me? Maybe this is all by design and I just shouldn't be trying this. But it seems to me that in order to make pyc.py useful there should be the possibility to implement package/module hierarchies and unless I am mistaken the only way you can do that now is if your application runs from source. Best Regards, Geoffrey Bantle On Sat, Feb 18, 2012 at 6:41 PM, Keith Rome wrote: > The import statement is used for namespaces, which usually (but don?t have > to) match the assembly names. You reference the assembly once, and import > whatever types/namespaces you need from it. Thinking of it in another way, > referencing the assembly grants the ability to import from that assembly. > But in itself it does nothing apparent from the perspective of the > consuming script.**** > > ** ** > > This is similar to how C#/VB work where you reference the assembly once > for your project, and then you place using/import statements at the top of > individual code files to bring the types contained within the assembly into > scope.**** > > ** ** > > ** ** > > ** ** > > *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 *Geoffrey > Bantle > *Sent:* Saturday, February 18, 2012 6:07 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] Dotted assembly names and import**** > > ** ** > > Hello, > > I have a question about assemblies compiled with pyc.py. If you just name > them normally like, "Foobar.dll" or "Snafu.dll" you can add a reference > to them and import them into IronPython as one would expect. If however > you name them like "Foobar.Snafu.dll" you can add a reference to them > but it does not seem like you can import them at all. You are given the > error: > > "ImportError: No module named Snafu" > > Is this intended behavior? My understanding is that dotted assembly names > are quite common in .Net and I have a project where I would like to have > assemblies compiled by pyc.py to sit side by side with assemblies written > in C#. Maybe this is not the natural way to do things? > > Any help is appreciated. > > Best Regards, > Geoffrey Bantle > gbantle at gmail.com**** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Sun Feb 19 01:56:39 2012 From: rome at Wintellect.com (Keith Rome) Date: Sat, 18 Feb 2012 16:56:39 -0800 Subject: [Ironpython-users] Dotted assembly names and import In-Reply-To: References: <7737799D90E55E4BB9C9F7E40D161E110E3C9660B9@VA3DIAXVS461.RED001.local> Message-ID: <7737799D90E55E4BB9C9F7E40D161E110E3C9660BA@VA3DIAXVS461.RED001.local> The point I was trying to make is that the assembly name (dots or no dots) has nothing to do with the contents of the assembly. It is simply a unique moniker. As far as I know, pyc.py emits the same MSIL into the resulting assembly no matter what you name the final file. And the namespaces within that assembly (which are what you would import) are associated with the source py file names. At least that's how it worked a few years ago, as described in this old ML thread: http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/008195.html If you compile to Snafu.dll (or Foobar.dll) and then simply rename the resulting assembly file to Foobar.Snafu.dll, does your consuming code work? Also, what is the name of the py file you are compiling, and what does the import statement that is failing look like? 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 Geoffrey Bantle Sent: Saturday, February 18, 2012 7:28 PM To: ironpython-users at python.org Subject: [Ironpython-users] Dotted assembly names and import Hi Keith, Thanks for your response. I actually am familiar with python's import statement as I have been programming in python for years now :) I'm afraid I don't see how your response answers my question about dotted assembly names and python code compiled with pyc.py. Could you maybe clarify for me? Maybe this is all by design and I just shouldn't be trying this. But it seems to me that in order to make pyc.py useful there should be the possibility to implement package/module hierarchies and unless I am mistaken the only way you can do that now is if your application runs from source. Best Regards, Geoffrey Bantle On Sat, Feb 18, 2012 at 6:41 PM, Keith Rome > wrote: The import statement is used for namespaces, which usually (but don't have to) match the assembly names. You reference the assembly once, and import whatever types/namespaces you need from it. Thinking of it in another way, referencing the assembly grants the ability to import from that assembly. But in itself it does nothing apparent from the perspective of the consuming script. This is similar to how C#/VB work where you reference the assembly once for your project, and then you place using/import statements at the top of individual code files to bring the types contained within the assembly into scope. 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 Geoffrey Bantle Sent: Saturday, February 18, 2012 6:07 PM To: ironpython-users at python.org Subject: [Ironpython-users] Dotted assembly names and import Hello, I have a question about assemblies compiled with pyc.py. If you just name them normally like, "Foobar.dll" or "Snafu.dll" you can add a reference to them and import them into IronPython as one would expect. If however you name them like "Foobar.Snafu.dll" you can add a reference to them but it does not seem like you can import them at all. You are given the error: "ImportError: No module named Snafu" Is this intended behavior? My understanding is that dotted assembly names are quite common in .Net and I have a project where I would like to have assemblies compiled by pyc.py to sit side by side with assemblies written in C#. Maybe this is not the natural way to do things? Any help is appreciated. Best Regards, Geoffrey Bantle gbantle at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Feb 19 11:22:05 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 19 Feb 2012 02:22:05 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] Issues installing IronPython 2.6.1 on windows 7 64 bit 2. [Status update] Trivial: makefile patch 3. [New comment] ImportError: No module named setuptools.command.easy_install 4. [New comment] Ctrl-Z dosn't work right after KeyboardInterrupt 5. [New comment] nt.system(some garbage command) should return a non-zero exit code; not throw a WindowsError ---------------------------------------------- ISSUES 1. [New comment] Issues installing IronPython 2.6.1 on windows 7 64 bit http://ironpython.codeplex.com/workitem/28657 User slide_o_mix has commented on the issue: "I am unable to reproduce this, I just installed on a Windows 7 x64 VM with no issues."----------------- 2. [Status update] Trivial: makefile patch http://ironpython.codeplex.com/workitem/15023 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This makefile no longer exists."----------------- 3. [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: "Working on this."----------------- 4. [New comment] Ctrl-Z dosn't work right after KeyboardInterrupt http://ironpython.codeplex.com/workitem/9135 User slide_o_mix has commented on the issue: "This still fails in 2.7.2 beta"----------------- 5. [New comment] nt.system(some garbage command) should return a non-zero exit code; not throw a WindowsError http://ironpython.codeplex.com/workitem/23205 User slide_o_mix has commented on the issue: "It seems like in PythonWin the call returns 1, but in the console (python.exe) it returns -1. Does it matter what it returns as long as it's non-zero?" ---------------------------------------------- ---------------------------------------------- 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 Feb 20 16:30:48 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 20 Feb 2012 07:30:48 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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 generates a *.dll regardless of "/target:..." usage 2. [New comment] Add Option To Pyc To Modify Stub EXE to load DLL from EXEs Path 3. [Status update] Pyc bug: parameter /target will be ignored if it appears before /main 4. [New comment] Pyc bug: parameter /target will be ignored if it appears before /main 5. [Status update] Pyc bug: parameter /target will be ignored if it appears before /main 6. [New comment] Pyc bug: parameter /target will be ignored if it appears before /main 7. [Status update] pyc fails if a file contains a call to unicode 8. [New comment] Pyc.py and FolderBrowserDialog 9. [Status update] pyc.py Compile of Dictionary with tuple values generates error "CompileToMethod cannot compile constant" 10. [New comment] ipy.exe / pyc.py fails to create working WPF .exe on Windows Server 2008-64, .NET 4.0 11. [New issue] reinterpret cast of UInt32 to Int32 does not work properly 12. [New issue] reinterpret cast of UInt32 to Int32 does not work properly 13. [Status update] reinterpret cast of UInt32 to Int32 does not work properly 14. [Status update] Trivial: IronPython.Hosting.ResourceFile appears to be dead code 15. [New comment] IRONPYTHONPATH not respected for pyc.py compiled assemblies 16. [New comment] implement clr.GetString and clr.GetBytes as helper to convert strings to and from bytes 17. [Status update] Improve debugging experience 18. [New comment] _winreg doesn't support key names which are 256 chars long 19. [New comment] Need a way to have a base class in an extension which is not exposed to Python 20. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 21. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 22. [New comment] sys.args[0] dissapears in ipy-script compiled with pyc.py 23. [New comment] compile('#foo\n', '', 'single') throws null ref exception 24. [New comment] Some path ops are not done through PlatformAdaptationLayer in IronPython.Runtime.Importer 25. [Status update] Desktop IronPython debugging failure - Error: Reading old stack frames, should match 3 ---------------------------------------------- ISSUES 1. [New comment] Pyc generates a *.dll regardless of "/target:..." usage http://ironpython.codeplex.com/workitem/19456 User slide_o_mix has commented on the issue: "Fixed in 88d48b9"----------------- 2. [New comment] Add Option To Pyc To Modify Stub EXE to load DLL from EXEs Path http://ironpython.codeplex.com/workitem/21987 User slide_o_mix has commented on the issue: "Fixed in 83d4d1f"----------------- 3. [Status update] Pyc bug: parameter /target will be ignored if it appears before /main http://ironpython.codeplex.com/workitem/29696 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed in 88d48b9"----------------- 4. [New comment] Pyc bug: parameter /target will be ignored if it appears before /main http://ironpython.codeplex.com/workitem/29696 User slide_o_mix has commented on the issue: "Fixed in 88d48b9 ** Closed by slide_o_mix 2/19/2012 3:48 AM"----------------- 5. [Status update] Pyc bug: parameter /target will be ignored if it appears before /main http://ironpython.codeplex.com/workitem/29696 User slide_o_mix has updated the issue: Status has changed from Closed to Proposed with the following comment, "Forgot to move to fixed instead of closing..."----------------- 6. [New comment] Pyc bug: parameter /target will be ignored if it appears before /main http://ironpython.codeplex.com/workitem/29696 User slide_o_mix has commented on the issue: "Fixed in 88d48b9"----------------- 7. [Status update] pyc fails if a file contains a call to unicode http://ironpython.codeplex.com/workitem/26593 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works in 2.7.1"----------------- 8. [New comment] Pyc.py and FolderBrowserDialog http://ironpython.codeplex.com/workitem/27118 User slide_o_mix has commented on the issue: "Can you please add a test case? I am wondering if this has to do with STAThread attribute on the main of the stub exe."----------------- 9. [Status update] pyc.py Compile of Dictionary with tuple values generates error "CompileToMethod cannot compile constant" http://ironpython.codeplex.com/workitem/29390 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "This works in 2.7.1"----------------- 10. [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: "Have you tried on 2.7.1?"----------------- 11. [New issue] reinterpret cast of UInt32 to Int32 does not work properly http://ironpython.codeplex.com/workitem/32285 User lastonogoe has proposed the issue: "If you need to reinterpret typed unsigned integer value as signed one, the following code is supposed to use: a = UInt16.MaxValue #65535, 0xFFFF b = Int16(a) # -1, 0xFFFF print b, type(b) The code works fine for pairs of UInt64/Int64 and UInt16/Int16. But in case of UInt32/Int32 it produces unexpected result. It seems that "Int32(value)" statement behaves similar to built-in int() function. More precisely, when the passed argument is bigger then max signed integer the result will be of type "long" and its value will be outside the integer range."----------------- 12. [New issue] reinterpret cast of UInt32 to Int32 does not work properly http://ironpython.codeplex.com/workitem/32286 User lastonogoe has proposed the issue: "If you need to reinterpret typed unsigned integer value as signed one, the following code is supposed to use: a = UInt16.MaxValue #65535, 0xFFFF b = Int16(a) # -1, 0xFFFF print b, type(b) The code works fine for pairs of UInt64/Int64 and UInt16/Int16. But in case of UInt32/Int32 it produces unexpected result. It seems that "Int32(value)" statement behaves similar to built-in int() function. More precisely, when the passed argument is bigger then max signed integer the result will be of type "long" and its value will be outside the integer range."----------------- 13. [Status update] reinterpret cast of UInt32 to Int32 does not work properly http://ironpython.codeplex.com/workitem/32286 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of http://ironpython.codeplex.com/workitem/32285"----------------- 14. [Status update] Trivial: IronPython.Hosting.ResourceFile appears to be dead code http://ironpython.codeplex.com/workitem/23717 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "File does not exist anymore."----------------- 15. [New comment] IRONPYTHONPATH not respected for pyc.py compiled assemblies http://ironpython.codeplex.com/workitem/26706 User slide_o_mix has commented on the issue: "What other environment variables would be useful?"----------------- 16. [New comment] implement clr.GetString and clr.GetBytes as helper to convert strings to and from bytes http://ironpython.codeplex.com/workitem/7159 User slide_o_mix has commented on the issue: "StringOps.FromByteArray no longer exists?"----------------- 17. [Status update] Improve debugging experience http://ironpython.codeplex.com/workitem/22035 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "IronPython Tools deprecated in favor of Python Tools for Visual Studio"----------------- 18. [New comment] _winreg doesn't support key names which are 256 chars long http://ironpython.codeplex.com/workitem/28743 User slide_o_mix has commented on the issue: "Please provide a test case if possible."----------------- 19. [New comment] Need a way to have a base class in an extension which is not exposed to Python http://ironpython.codeplex.com/workitem/28891 User slide_o_mix has commented on the issue: "Does the PythonHiddenBaseClass not work? [PythonHiddenBaseClass] public class Wrapper : IDisposable { } /// /// Marks a class as being hidden from the Python hierarchy. This is applied to the base class /// and then all derived types will not see the base class in their hierarchy and will not be /// able to access members declaredo on the base class. /// [AttributeUsage(AttributeTargets.Class)] public sealed class PythonHiddenBaseClassAttribute : Attribute { }"----------------- 20. [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: "It looks like the first argument is explicitly removed in the method called by the stub executable: PythonOps.InitializeModule: Dictionary options = new Dictionary(); options["Arguments"] = ArrayUtils.RemoveFirst(Environment.GetCommandLineArgs()); // remove the EXE I'm not sure why this is the case."----------------- 21. [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 figured that out too. Perhaps I would suggest, to remove the "RemoveFirst", but I could not figure out if this code is also run if the code is not compiled (with pyc.py). I suppose it is, because if the script is run with ipy.exe the "ipy.exe" is the first command line argument and it makes sense to remove it, so that the script name becomes the first entry in sys.argv. A "good" version should probably something like this: if (runningInCompiledEnvironment ...) options["Arguments"] = ArrayUtils.Environment.GetCommandLineArgs(); else options["Arguments"] = ArrayUtils.RemoveFirst(Environment.GetCommandLineArgs()); // remove the EXE But I do not have an idea how "runningInCompiledEnvironment" could be implemented in this startup environment. "----------------- 22. [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: "I'm fairly sure that InitializeModule (this override anyway) is not called by anything but the pyc generated stub executable, but I will make sure."----------------- 23. [New comment] compile('#foo\n', '', 'single') throws null ref exception http://ironpython.codeplex.com/workitem/30940 User slide_o_mix has commented on the issue: "NRE comes from here: internal static FunctionCode FromSourceUnit(SourceUnit sourceUnit, PythonCompilerOptions options, bool register) { var code = PythonContext.CompilePythonCode(sourceUnit, options, ThrowingErrorSink.Default); return ((RunnableScriptCode)code).GetFunctionCode(register); } code is null for this statement after parsing because its an empty statement."----------------- 24. [New comment] Some path ops are not done through PlatformAdaptationLayer in IronPython.Runtime.Importer http://ironpython.codeplex.com/workitem/31603 User slide_o_mix has commented on the issue: "This looks to be fixed."----------------- 25. [Status update] Desktop IronPython debugging failure - Error: Reading old stack frames, should match 3 http://ironpython.codeplex.com/workitem/24046 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "SNAP failure." ---------------------------------------------- ---------------------------------------------- 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 Wed Feb 22 18:44:12 2012 From: slide.o.mix at gmail.com (Slide) Date: Wed, 22 Feb 2012 10:44:12 -0700 Subject: [Ironpython-users] Pyc.py dependencies Message-ID: Currently pyc.py only uses .NET imports and classes, I'm looking at adding support for an embedded icon and win32 (native) resources in general. Are people opposed to adding a dependency on the struct module, or ctypes to accomplish that stuff? Thanks, Slide -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Feb 22 20:07:48 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 22 Feb 2012 11:07:48 -0800 Subject: [Ironpython-users] Pyc.py dependencies In-Reply-To: References: Message-ID: On Wed, Feb 22, 2012 at 9:44 AM, Slide wrote: > Currently pyc.py only uses .NET imports and classes, I'm looking at adding > support for an embedded icon and win32 (native) resources in general. Are > people opposed to adding a dependency on the struct module, or ctypes to > accomplish that stuff? It's weird to me that it's not possible to do that through pure .NET, but if that's the only way go ahead. We can safely assume a stdlib will be present. - Jeff From slide.o.mix at gmail.com Wed Feb 22 20:22:24 2012 From: slide.o.mix at gmail.com (Slide) Date: Wed, 22 Feb 2012 12:22:24 -0700 Subject: [Ironpython-users] Pyc.py dependencies In-Reply-To: References: Message-ID: The icon has to be part of unmanaged resources, which can be defined using DefineUnmanagedResource, but that function expects a compiled resource file, not a .ico file. So, I have to generate the compiled resource file from the .ico file to embed as the unmanaged resource. Unless I am completely missing something. slide On Wed, Feb 22, 2012 at 12:07 PM, Jeff Hardy wrote: > On Wed, Feb 22, 2012 at 9:44 AM, Slide wrote: > > Currently pyc.py only uses .NET imports and classes, I'm looking at > adding > > support for an embedded icon and win32 (native) resources in general. Are > > people opposed to adding a dependency on the struct module, or ctypes to > > accomplish that stuff? > > It's weird to me that it's not possible to do that through pure .NET, > but if that's the only way go ahead. We can safely assume a stdlib > will be present. > > - Jeff > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Feb 22 22:07:19 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 22 Feb 2012 13:07:19 -0800 Subject: [Ironpython-users] Pyc.py dependencies In-Reply-To: References: Message-ID: On Wed, Feb 22, 2012 at 11:22 AM, Slide wrote: > The icon has to be part of unmanaged resources, which can be defined using > DefineUnmanagedResource, but that function expects a compiled resource file, > not a .ico file. So, I have to generate the compiled resource file from the > .ico file to embed as the unmanaged resource. Unless I am completely missing > something. No, that looks right to me. You could shell out to rc.exe. Just write a temporary .rc file, compile, and pass the .res to DefineUnmanagedResource. I think. I only had to use rc once, in the distant past. :) Downside is that rc.exe require VS or the Windows SDK, neither of which are small. If you can write it in Python without too much work, go for it. - Jeff From lucasvickers at gmail.com Wed Feb 22 22:43:39 2012 From: lucasvickers at gmail.com (Lucas Vickers) Date: Wed, 22 Feb 2012 16:43:39 -0500 Subject: [Ironpython-users] Understanding CPython and IronPython linkage Message-ID: Hello, I am OS X and I am working with a pre-compiled version of IronPython (it is hosted by Rhino 3d to be specific). I am attempting to import standard CPython libraries, such as pycurl. I am confused as the FAQ states compatibility between IronPython 2.7 and CPython 2.7, but using the following code which works on CPython 2.7.2 fails on IronPython 2.7.0. sys.path[0:0] = [ '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ] import pycurl It claims no module pycurl. A little more reading shows attempts to allow linkage between IronPython and CPython such as ironclad ( http://code.google.com/p/ironclad/ ), but then why the claimed compatibility in the first place? Can anyone help me understand? thanks Lucas -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucasvickers at gmail.com Wed Feb 22 22:44:03 2012 From: lucasvickers at gmail.com (Lucas Vickers) Date: Wed, 22 Feb 2012 16:44:03 -0500 Subject: [Ironpython-users] IronPython debugging on OS X Message-ID: Hello, I'm trying to find some information on what debugging capabilities exist for IronPython. I read in depth about the mono level debugger, but this is probably too low level for what I want. I also found some mention of work being done on Windows specific IronPython debuggers, but I am hoping to do this in OS X. Does anyone have any info on the state of things? Worst case I will do all heavy lifting in CPython, use a debugger, and then finally pickle objects into a minimized IronPython environment, but this is far from ideal. thanks, Lucas -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Feb 22 23:03:58 2012 From: slide.o.mix at gmail.com (Slide) Date: Wed, 22 Feb 2012 15:03:58 -0700 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: References: Message-ID: If the module is a C based module, it will not import into IronPython. The compatibility is in most of the standard library, pycurl is not part of the standard library. There are even issues in parts of the standard library as you can see if you look at the bug tracker on CodePlex. slide On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers wrote: > Hello, > > I am OS X and I am working with a pre-compiled version of IronPython (it > is hosted by Rhino 3d to be specific). > > I am attempting to import standard CPython libraries, such as pycurl. I > am confused as the FAQ states compatibility between IronPython 2.7 and > CPython 2.7, but using the following code which works on CPython 2.7.2 > fails on IronPython 2.7.0. > > sys.path[0:0] = [ > '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ] > import pycurl > > It claims no module pycurl. A little more reading shows attempts to allow > linkage between IronPython and CPython such as ironclad ( > http://code.google.com/p/ironclad/ ), but then why the claimed > compatibility in the first place? > > Can anyone help me understand? thanks > > Lucas > > _______________________________________________ > 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 lucasvickers at gmail.com Wed Feb 22 23:06:28 2012 From: lucasvickers at gmail.com (Lucas Vickers) Date: Wed, 22 Feb 2012 17:06:28 -0500 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: References: Message-ID: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> Got it. Makes more sense. Sounds like I'll be pickling objects back and forth between cpy and ipy. Thanks On Feb 22, 2012, at 5:03 PM, Slide wrote: > If the module is a C based module, it will not import into IronPython. The compatibility is in most of the standard library, pycurl is not part of the standard library. There are even issues in parts of the standard library as you can see if you look at the bug tracker on CodePlex. > > slide > > On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers wrote: > Hello, > > I am OS X and I am working with a pre-compiled version of IronPython (it is hosted by Rhino 3d to be specific). > > I am attempting to import standard CPython libraries, such as pycurl. I am confused as the FAQ states compatibility between IronPython 2.7 and CPython 2.7, but using the following code which works on CPython 2.7.2 fails on IronPython 2.7.0. > > sys.path[0:0] = [ '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ] > import pycurl > > It claims no module pycurl. A little more reading shows attempts to allow linkage between IronPython and CPython such as ironclad (http://code.google.com/p/ironclad/ ), but then why the claimed compatibility in the first place? > > Can anyone help me understand? thanks > > Lucas > > _______________________________________________ > 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 slide.o.mix at gmail.com Wed Feb 22 23:09:58 2012 From: slide.o.mix at gmail.com (Slide) Date: Wed, 22 Feb 2012 15:09:58 -0700 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> References: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> Message-ID: Be careful with that too :-) IronPython is obviously still a work in progress and we're trying hard to implement features and become more CPython compatible; we've still got a lot of work to do, but you can do some really cool stuff with IronPython. slide On Wed, Feb 22, 2012 at 3:06 PM, Lucas Vickers wrote: > Got it. Makes more sense. > > Sounds like I'll be pickling objects back and forth between cpy and ipy. > > Thanks > > > On Feb 22, 2012, at 5:03 PM, Slide wrote: > > If the module is a C based module, it will not import into IronPython. The > compatibility is in most of the standard library, pycurl is not part of the > standard library. There are even issues in parts of the standard library as > you can see if you look at the bug tracker on CodePlex. > > slide > > On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers wrote: > >> Hello, >> >> I am OS X and I am working with a pre-compiled version of IronPython (it >> is hosted by Rhino 3d to be specific). >> >> I am attempting to import standard CPython libraries, such as pycurl. I >> am confused as the FAQ states compatibility between IronPython 2.7 and >> CPython 2.7, but using the following code which works on CPython 2.7.2 >> fails on IronPython 2.7.0. >> >> sys.path[0:0] = [ >> '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ] >> import pycurl >> >> It claims no module pycurl. A little more reading shows attempts to >> allow linkage between IronPython and CPython such as ironclad ( >> http://code.google.com/p/ironclad/ ), but then why the claimed >> compatibility in the first place? >> >> Can anyone help me understand? thanks >> >> Lucas >> >> _______________________________________________ >> 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 lucasvickers at gmail.com Wed Feb 22 23:28:17 2012 From: lucasvickers at gmail.com (Lucas Vickers) Date: Wed, 22 Feb 2012 17:28:17 -0500 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: References: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> Message-ID: <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> Lol now you're scaring me ;) Rhino3d uses IronPython to let us control low level .net Rhino APIs using python. Super cool. But what about pickle do u need to watch out for? Due to the Rhino infrastructure it seems difficult to impossible to really debug an IronPython script hosted within rhino, so tracing low level bugs will be a nightmare. On Feb 22, 2012, at 5:09 PM, Slide wrote: > Be careful with that too :-) IronPython is obviously still a work in progress and we're trying hard to implement features and become more CPython compatible; we've still got a lot of work to do, but you can do some really cool stuff with IronPython. > > > slide > > On Wed, Feb 22, 2012 at 3:06 PM, Lucas Vickers wrote: > Got it. Makes more sense. > > Sounds like I'll be pickling objects back and forth between cpy and ipy. > > Thanks > > > On Feb 22, 2012, at 5:03 PM, Slide wrote: > >> If the module is a C based module, it will not import into IronPython. The compatibility is in most of the standard library, pycurl is not part of the standard library. There are even issues in parts of the standard library as you can see if you look at the bug tracker on CodePlex. >> >> slide >> >> On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers wrote: >> Hello, >> >> I am OS X and I am working with a pre-compiled version of IronPython (it is hosted by Rhino 3d to be specific). >> >> I am attempting to import standard CPython libraries, such as pycurl. I am confused as the FAQ states compatibility between IronPython 2.7 and CPython 2.7, but using the following code which works on CPython 2.7.2 fails on IronPython 2.7.0. >> >> sys.path[0:0] = [ '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ] >> import pycurl >> >> It claims no module pycurl. A little more reading shows attempts to allow linkage between IronPython and CPython such as ironclad (http://code.google.com/p/ironclad/ ), but then why the claimed compatibility in the first place? >> >> Can anyone help me understand? thanks >> >> Lucas >> >> _______________________________________________ >> 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 jdhardy at gmail.com Wed Feb 22 23:47:00 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 22 Feb 2012 14:47:00 -0800 Subject: [Ironpython-users] IronPython debugging on OS X In-Reply-To: References: Message-ID: On Wed, Feb 22, 2012 at 1:44 PM, Lucas Vickers wrote: > Hello, > > I'm trying to find some information on what debugging capabilities exist for > IronPython. ?I read in depth about the mono level debugger, but this is > probably too low level for what I want. > > I also found some mention of work being done on Windows specific IronPython > debuggers, but I am hoping to do this in OS X. > > Does anyone have any info on the state of things? ?Worst case I will do all > heavy lifting in CPython, use a debugger, and then finally pickle objects > into a minimized IronPython environment, but this is far from ideal. pdb is a bit wonky on IronPython, but it does somewhat work. I don't know if MonoDevelop understands the debug information emitted when using -X:Debug, but if it does, that could be an option as well. - Jeff From jdhardy at gmail.com Wed Feb 22 23:48:02 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 22 Feb 2012 14:48:02 -0800 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> References: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> Message-ID: On Wed, Feb 22, 2012 at 2:28 PM, Lucas Vickers wrote: > Rhino3d uses IronPython to let us control low level .net Rhino APIs using > python. Super cool. But what about pickle do u need to watch out for? Pickled code objects. - Jeff From dinov at microsoft.com Wed Feb 22 22:47:21 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 22 Feb 2012 21:47:21 +0000 Subject: [Ironpython-users] IronPython debugging on OS X In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CB87E9@TK5EX14MBXC294.redmond.corp.microsoft.com> If you're down w/ Eclipse PyDev supports IronPython debugging. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Lucas Vickers Sent: Wednesday, February 22, 2012 1:44 PM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython debugging on OS X Hello, I'm trying to find some information on what debugging capabilities exist for IronPython. I read in depth about the mono level debugger, but this is probably too low level for what I want. I also found some mention of work being done on Windows specific IronPython debuggers, but I am hoping to do this in OS X. Does anyone have any info on the state of things? Worst case I will do all heavy lifting in CPython, use a debugger, and then finally pickle objects into a minimized IronPython environment, but this is far from ideal. thanks, Lucas -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 22 23:36:02 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 22 Feb 2012 22:36:02 +0000 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> References: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CB89F3@TK5EX14MBXC294.redmond.corp.microsoft.com> I?m not sure there?s much to worry about with pickle. I think the biggest issue is that in IronPython we?ll serialize strings as Unicode where CPython would serialize them as ASCII strings. Once they?re deserialized though everyone should treat them (mostly) the same. I use pickle to store the completion database for PTVS ? there I have CPython and IronPython writing the files and I have a modified version of IronPython?s cPickle implementation to also read/write them from PTVS. I don?t really do much reading from the CPython side in the product, but I do it all the time for debugging. I haven?t run into any issues with it. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Lucas Vickers Sent: Wednesday, February 22, 2012 2:28 PM To: Slide Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Understanding CPython and IronPython linkage Lol now you're scaring me ;) Rhino3d uses IronPython to let us control low level .net Rhino APIs using python. Super cool. But what about pickle do u need to watch out for? Due to the Rhino infrastructure it seems difficult to impossible to really debug an IronPython script hosted within rhino, so tracing low level bugs will be a nightmare. On Feb 22, 2012, at 5:09 PM, Slide > wrote: Be careful with that too :-) IronPython is obviously still a work in progress and we're trying hard to implement features and become more CPython compatible; we've still got a lot of work to do, but you can do some really cool stuff with IronPython. slide On Wed, Feb 22, 2012 at 3:06 PM, Lucas Vickers > wrote: Got it. Makes more sense. Sounds like I'll be pickling objects back and forth between cpy and ipy. Thanks On Feb 22, 2012, at 5:03 PM, Slide > wrote: If the module is a C based module, it will not import into IronPython. The compatibility is in most of the standard library, pycurl is not part of the standard library. There are even issues in parts of the standard library as you can see if you look at the bug tracker on CodePlex. slide On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers > wrote: Hello, I am OS X and I am working with a pre-compiled version of IronPython (it is hosted by Rhino 3d to be specific). I am attempting to import standard CPython libraries, such as pycurl. I am confused as the FAQ states compatibility between IronPython 2.7 and CPython 2.7, but using the following code which works on CPython 2.7.2 fails on IronPython 2.7.0. sys.path[0:0] = [ '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ] import pycurl It claims no module pycurl. A little more reading shows attempts to allow linkage between IronPython and CPython such as ironclad (http://code.google.com/p/ironclad/ ), but then why the claimed compatibility in the first place? Can anyone help me understand? thanks Lucas _______________________________________________ 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 steve at mcneel.com Thu Feb 23 00:00:04 2012 From: steve at mcneel.com (Steve Baer) Date: Wed, 22 Feb 2012 15:00:04 -0800 Subject: [Ironpython-users] IronPython debugging on OS X In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CB87E9@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CB87E9@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <179E8A27614B415C82319F34DFC359D7@mcneel.com> Hi Lucas, If this question is targeted toward Rhino3d, the Windows version has a script debugger built in. I haven?t had the time to put anything together for the OSX implementation; and I really want to see if I can figure out how to get python remote debugging working so you can use tools like eclipse to do your debugging. -Steve From: Dino Viehland Sent: Wednesday, February 22, 2012 1:47 PM To: Lucas Vickers ; ironpython-users at python.org Subject: Re: [Ironpython-users] IronPython debugging on OS X If you?re down w/ Eclipse PyDev supports IronPython debugging. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Lucas Vickers Sent: Wednesday, February 22, 2012 1:44 PM To: ironpython-users at python.org Subject: [Ironpython-users] IronPython debugging on OS X Hello, I'm trying to find some information on what debugging capabilities exist for IronPython. I read in depth about the mono level debugger, but this is probably too low level for what I want. I also found some mention of work being done on Windows specific IronPython debuggers, but I am hoping to do this in OS X. Does anyone have any info on the state of things? Worst case I will do all heavy lifting in CPython, use a debugger, and then finally pickle objects into a minimized IronPython environment, but this is far from ideal. thanks, Lucas -------------------------------------------------------------------------------- _______________________________________________ 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 lucasvickers at gmail.com Thu Feb 23 01:08:43 2012 From: lucasvickers at gmail.com (Lucas Vickers) Date: Wed, 22 Feb 2012 19:08:43 -0500 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: References: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> Message-ID: lol thanks :) Well this I can deal with. I'll make a communication method that takes a pickled object, and as a response slightly modifies the object then re-pickles it. I can then more or less confirm nothing is corrupt. I won't be dealing with unicode / ascii text, mostly numbers (3d structure analysis etc) thanks guys On Wed, Feb 22, 2012 at 5:48 PM, Jeff Hardy wrote: > On Wed, Feb 22, 2012 at 2:28 PM, Lucas Vickers > wrote: > > Rhino3d uses IronPython to let us control low level .net Rhino APIs using > > python. Super cool. But what about pickle do u need to watch out for? > > Pickled code objects. > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 23 03:26:19 2012 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 23 Feb 2012 02:26:19 +0000 Subject: [Ironpython-users] Understanding CPython and IronPython linkage In-Reply-To: References: <5CE3BFA9-384E-49B0-B7A7-6FAEB4038FF9@gmail.com> <49658909-20AA-44DB-8F55-A8316D47D5D4@gmail.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CB8FE3@TK5EX14MBXC294.redmond.corp.microsoft.com> That's actually only an incompatibility w/ marshal, not pickle. Functions are always pickled by reference (module name + function name) and if you try and pickle a code object directly it fails: 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 cPickle >>> cPickle.dumps((lambda x:42).func_code) Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\copy_reg.py", line 70, in _reduce_ex raise TypeError, "can't pickle %s objects" % base.__name__ TypeError: can't pickle code objects >>> > -----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: Wednesday, February 22, 2012 2:48 PM > To: Lucas Vickers > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] Understanding CPython and IronPython linkage > > On Wed, Feb 22, 2012 at 2:28 PM, Lucas Vickers > wrote: > > Rhino3d uses IronPython to let us control low level .net Rhino APIs > > using python. Super cool. But what about pickle do u need to watch out for? > > Pickled code objects. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From no_reply at codeplex.com Thu Feb 23 11:53:17 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 23 Feb 2012 02:53:17 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] Add option to pyc.py to embed IronPython assemblies 2. [New comment] Add option to pyc.py to embed IronPython assemblies 3. [New comment] Allow resources when compiling with pyc.py ---------------------------------------------- ISSUES 1. [New comment] Add option to pyc.py to embed IronPython assemblies http://ironpython.codeplex.com/workitem/32288 User slide_o_mix has commented on the issue: "I implemented this, though it does require a change to the sys module as well (the GetPrefix method throws an exception because the .Location of the Assembly is empty when loading from a resource stream). I'll continue to test with some heftier examples to make sure nothing else is broken when doing this."----------------- 2. [New comment] Add option to pyc.py to embed IronPython assemblies http://ironpython.codeplex.com/workitem/32288 User slide_o_mix has commented on the issue: "Here's a version to play with, in your local sys.cs just add another catch for ArgumentException and set previx to String.Empty there too."----------------- 3. [New comment] Allow resources when compiling with pyc.py http://ironpython.codeplex.com/workitem/32289 User slide_o_mix has commented on the issue: "How would a normal script not compiled through pyc.py load resources? If the script has to change to load resources when in compiled form, it makes it less desirable to have this feature." ---------------------------------------------- ---------------------------------------------- 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 Thu Feb 23 16:05:35 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 23 Feb 2012 08:05:35 -0700 Subject: [Ironpython-users] Pyc.py dependencies In-Reply-To: References: Message-ID: I'm feeling pretty masochistic lately, so maybe I'll write it in pure Python :-) The other option is pulling in something like wrc.exe from WINE depending on the license winres from binutils is another option. I can check into those options as well. What license would we want in order to redistribute with IP, I am terrible with licenses. slide On Wed, Feb 22, 2012 at 2:07 PM, Jeff Hardy wrote: > On Wed, Feb 22, 2012 at 11:22 AM, Slide wrote: > > The icon has to be part of unmanaged resources, which can be defined > using > > DefineUnmanagedResource, but that function expects a compiled resource > file, > > not a .ico file. So, I have to generate the compiled resource file from > the > > .ico file to embed as the unmanaged resource. Unless I am completely > missing > > something. > > No, that looks right to me. > > You could shell out to rc.exe. Just write a temporary .rc file, > compile, and pass the .res to DefineUnmanagedResource. I think. I only > had to use rc once, in the distant past. :) Downside is that rc.exe > require VS or the Windows SDK, neither of which are small. > > If you can write it in Python without too much work, go for it. > > - Jeff > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Thu Feb 23 17:28:16 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 23 Feb 2012 08:28:16 -0800 Subject: [Ironpython-users] Pyc.py dependencies In-Reply-To: References: Message-ID: On Thu, Feb 23, 2012 at 7:05 AM, Slide wrote: > I'm feeling pretty masochistic lately, so maybe I'll write it in pure Python > :-) The other option is pulling in something like wrc.exe from WINE > depending on the license?winres from binutils is another option. I can check > into those options as well. What license would we want in order to > redistribute with IP, I am terrible with licenses. I'd prefer not to distribute anything that might be platform specific*. I'm fine with saying "you want to embed unmanaged resources, go install X, Y, or Z," except for the simple case of setting an Icon. I don't know the details of the resource format, but I can't imagine it's too complicated for that one simple case. - Jeff * Yes, there's stuff in there already. Doesn't mean I like it :). From slide.o.mix at gmail.com Thu Feb 23 17:37:29 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 23 Feb 2012 09:37:29 -0700 Subject: [Ironpython-users] Pyc.py dependencies In-Reply-To: References: Message-ID: On Thu, Feb 23, 2012 at 9:28 AM, Jeff Hardy wrote: > On Thu, Feb 23, 2012 at 7:05 AM, Slide wrote: > > I'm feeling pretty masochistic lately, so maybe I'll write it in pure > Python > > :-) The other option is pulling in something like wrc.exe from WINE > > depending on the license winres from binutils is another option. I can > check > > into those options as well. What license would we want in order to > > redistribute with IP, I am terrible with licenses. > > I'd prefer not to distribute anything that might be platform > specific*. I'm fine with saying "you want to embed unmanaged > resources, go install X, Y, or Z," except for the simple case of > setting an Icon. I don't know the details of the resource format, but > I can't imagine it's too complicated for that one simple case. > > - Jeff > > * Yes, there's stuff in there already. Doesn't mean I like it :). > I agree about distributing stuff that is platform specific*. For an icon, it probably won't be that difficult. slide * winres should run on any platform that binutils is ported to since it's part of that package. -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Fri Feb 24 04:55:06 2012 From: slide.o.mix at gmail.com (Slide) Date: Thu, 23 Feb 2012 20:55:06 -0700 Subject: [Ironpython-users] Patch Message-ID: Just wanted to get this out for review before I push it. I would have done it through my fork on github and issued a pull request, but my fork is currently messed up. Let me know if you see anything out of the ordinary. Fixes 32288 and 26706 Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Fix-32288-and-26706.patch Type: application/octet-stream Size: 11414 bytes Desc: not available URL: From jdhardy at gmail.com Fri Feb 24 05:32:57 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 23 Feb 2012 20:32:57 -0800 Subject: [Ironpython-users] Patch In-Reply-To: References: Message-ID: On Thu, Feb 23, 2012 at 7:55 PM, Slide wrote: > Just wanted to get this out for review before I push it. I would have done > it through my fork on github and issued a pull request, but my fork is > currently messed up. Let me know if you see anything out of the ordinary. > > Fixes 32288 and 26706 The change to InitializeModule won't work, sorry. Default params don't work under v2 compilers, and I think they break binary compatibility. Better to add a new method that processes the envvars and emit a call to it in pyc.py. - Jeff From dinov at microsoft.com Fri Feb 24 07:16:25 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 24 Feb 2012 06:16:25 +0000 Subject: [Ironpython-users] Patch In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CBC1CE@TK5EX14MBXC294.redmond.corp.microsoft.com> This is awesome, a couple comments: Can AssemblyResolve be moved into PythonOps? It looks like it keys off of Assembly.GetEntryAssembly() and so doesn't rely on anything in the generated assembly. That'd make it easier to read and update the code. Maybe I missed something that depends upon the assembly, but if that's the case the assembly could be passed into a class which has the AssemblyResolve method. I think the GlobalAssemblyCache check is too strong. Ipy install via the MSI will go into the GAC and so I think it won't be embedded. This should probably exclude the known Ipy/Dlr assemblies from the GAC check. +1 on what Jeff said as well, I'd just add an overload instead of doing the default value thing. Now I'm going to have to think more about pyc support for PTVS. 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, February 23, 2012 7:55 PM To: ironpython-users at python.org Subject: [Ironpython-users] Patch Just wanted to get this out for review before I push it. I would have done it through my fork on github and issued a pull request, but my fork is currently messed up. Let me know if you see anything out of the ordinary. Fixes 32288 and 26706 Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Feb 24 07:20:11 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 24 Feb 2012 06:20:11 +0000 Subject: [Ironpython-users] Patch In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CBC1CE@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CBC1CE@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E54CBC203@TK5EX14MBXC294.redmond.corp.microsoft.com> Forget that moving AssemblyResolve to PythonOps comment... chicken, egg, etc... :) From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Dino Viehland Sent: Thursday, February 23, 2012 10:16 PM To: Slide; ironpython-users at python.org Subject: Re: [Ironpython-users] Patch This is awesome, a couple comments: Can AssemblyResolve be moved into PythonOps? It looks like it keys off of Assembly.GetEntryAssembly() and so doesn't rely on anything in the generated assembly. That'd make it easier to read and update the code. Maybe I missed something that depends upon the assembly, but if that's the case the assembly could be passed into a class which has the AssemblyResolve method. I think the GlobalAssemblyCache check is too strong. Ipy install via the MSI will go into the GAC and so I think it won't be embedded. This should probably exclude the known Ipy/Dlr assemblies from the GAC check. +1 on what Jeff said as well, I'd just add an overload instead of doing the default value thing. Now I'm going to have to think more about pyc support for PTVS. 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, February 23, 2012 7:55 PM To: ironpython-users at python.org Subject: [Ironpython-users] Patch Just wanted to get this out for review before I push it. I would have done it through my fork on github and issued a pull request, but my fork is currently messed up. Let me know if you see anything out of the ordinary. Fixes 32288 and 26706 Thanks, slide -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Feb 24 14:06:11 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 24 Feb 2012 05:06:11 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/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] sys.float_info field values are inconsistent with those of CPython 2. [New comment] Better handling of binding failure due to .Net version 3. [New comment] Better error message when trying to load downloaded DLLs ---------------------------------------------- ISSUES 1. [New comment] sys.float_info field values are inconsistent with those of CPython http://ironpython.codeplex.com/workitem/27840 User Gleno has commented on the issue: "See http://stackoverflow.com/questions/9406185/how-do-i-clip-a-floating-point-number-to-just-below-a-limit/9406218#9406218"----------------- 2. [New comment] Better handling of binding failure due to .Net version http://ironpython.codeplex.com/workitem/31383 User jdhardy has commented on the issue: "Fixed in 86b3dd4."----------------- 3. [New comment] Better error message when trying to load downloaded DLLs http://ironpython.codeplex.com/workitem/31006 User jdhardy has commented on the issue: "Fixed in 1755fbd." ---------------------------------------------- ---------------------------------------------- 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 Feb 24 16:54:28 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 24 Feb 2012 08:54:28 -0700 Subject: [Ironpython-users] Patch In-Reply-To: References: Message-ID: Good point, I'll make the change before pushing. On Thu, Feb 23, 2012 at 9:32 PM, Jeff Hardy wrote: > On Thu, Feb 23, 2012 at 7:55 PM, Slide wrote: > > Just wanted to get this out for review before I push it. I would have > done > > it through my fork on github and issued a pull request, but my fork is > > currently messed up. Let me know if you see anything out of the ordinary. > > > > Fixes 32288 and 26706 > > The change to InitializeModule won't work, sorry. Default params don't > work under v2 compilers, and I think they break binary compatibility. > Better to add a new method that processes the envvars and emit a call > to it in pyc.py. > > - Jeff > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Fri Feb 24 16:55:12 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 24 Feb 2012 08:55:12 -0700 Subject: [Ironpython-users] Patch In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CBC1CE@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CBC1CE@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: I'll update the GlobalAssemblyCache check before pushing. On Thu, Feb 23, 2012 at 11:16 PM, Dino Viehland wrote: > This is awesome, a couple comments:**** > > Can AssemblyResolve be moved into PythonOps? It looks > like it keys off of Assembly.GetEntryAssembly() and so doesn?t rely on > anything in the generated assembly. That?d make it easier to read and > update the code. Maybe I missed something that depends upon the assembly, > but if that?s the case the assembly could be passed into a class which has > the AssemblyResolve method.**** > > ** ** > > I think the GlobalAssemblyCache check is too strong. Ipy > install via the MSI will go into the GAC and so I think it won?t be > embedded. This should probably exclude the known Ipy/Dlr assemblies from > the GAC check.**** > > ** ** > > +1 on what Jeff said as well, I?d just add an overload instead of doing > the default value thing. **** > > ** ** > > Now I?m going to have to think more about pyc support for PTVS.**** > > ** ** > > *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, February 23, 2012 7:55 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] Patch**** > > ** ** > > Just wanted to get this out for review before I push it. I would have done > it through my fork on github and issued a pull request, but my fork is > currently messed up. Let me know if you see anything out of the ordinary.* > *** > > ** ** > > Fixes 32288 and 26706**** > > ** ** > > Thanks,**** > > ** ** > > slide**** > > ** ** > > > **** > > ** ** > > -- > Website: http://earl-of-code.com**** > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Fri Feb 24 16:57:05 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 24 Feb 2012 08:57:05 -0700 Subject: [Ironpython-users] Patch In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E54CBC203@TK5EX14MBXC294.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E54CBC1CE@TK5EX14MBXC294.redmond.corp.microsoft.com> <6C7ABA8B4E309440B857D74348836F2E54CBC203@TK5EX14MBXC294.redmond.corp.microsoft.com> Message-ID: Yeah, I ran into an issue even with having the AppDomain.CurrentDomain.AssemblyResolve += ... in the same method as the call to PythonOps because it's at the beginning of the method that the runtime resolves the methods called, that's why I moved it to a static constructor. On Thu, Feb 23, 2012 at 11:20 PM, Dino Viehland wrote: > Forget that moving AssemblyResolve to PythonOps comment? chicken, egg, > etc? J**** > > ** ** > > *From:* ironpython-users-bounces+dinov=microsoft.com at python.org [mailto: > ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Dino > Viehland > *Sent:* Thursday, February 23, 2012 10:16 PM > *To:* Slide; ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Patch**** > > ** ** > > This is awesome, a couple comments:**** > > Can AssemblyResolve be moved into PythonOps? It looks > like it keys off of Assembly.GetEntryAssembly() and so doesn?t rely on > anything in the generated assembly. That?d make it easier to read and > update the code. Maybe I missed something that depends upon the assembly, > but if that?s the case the assembly could be passed into a class which has > the AssemblyResolve method.**** > > ** ** > > I think the GlobalAssemblyCache check is too strong. Ipy > install via the MSI will go into the GAC and so I think it won?t be > embedded. This should probably exclude the known Ipy/Dlr assemblies from > the GAC check.**** > > ** ** > > +1 on what Jeff said as well, I?d just add an overload instead of doing > the default value thing. **** > > ** ** > > Now I?m going to have to think more about pyc support for PTVS.**** > > ** ** > > *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, February 23, 2012 7:55 PM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] Patch**** > > ** ** > > Just wanted to get this out for review before I push it. I would have done > it through my fork on github and issued a pull request, but my fork is > currently messed up. Let me know if you see anything out of the ordinary.* > *** > > ** ** > > Fixes 32288 and 26706**** > > ** ** > > Thanks,**** > > ** ** > > slide**** > > ** ** > > > **** > > ** ** > > -- > Website: http://earl-of-code.com**** > -- Website: http://earl-of-code.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmello at gmail.com Fri Feb 24 19:54:54 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 24 Feb 2012 16:54:54 -0200 Subject: [Ironpython-users] Implicit conversion of objects to float Message-ID: Hi, We embedded IronPython to allow users to specify custom KPIs to be calculated from plant-floor measurements. It's woking nicely. The user selects which measurements she wants, provides aliases to these and they get exposed to the expression scope as variables. But we have two kinds of users: 1) People that only need the value of the measurements; they would like the variable to be the measurement value, so they could write short expressions like: a + b * 0.2 2) People that want more advanced scenarios, and need more attributes of the measurement (for example, the timestamp of the data acquisition and its quality). For example: (b.Value - a.Value) / (b.SourceTimestamp - a.SourceTimestamp).TotalMilliseconds Is there a way to satisfy both scenarios? So that the object could also be evaluated implicitly as a float? My first thought was to use a coercion, but the documentation does not recommend it. Any other suggestions please? Thank you so much for the attention. Best regards! Mello -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Feb 24 20:20:26 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 24 Feb 2012 11:20:26 -0800 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: On Fri, Feb 24, 2012 at 10:54 AM, Cesar Mello wrote: > Is there a way to satisfy both scenarios? So that the object could also be > evaluated implicitly as a float? > > My first thought was to use a coercion, but the documentation does not > recommend it. Any other suggestions please? You didn't specify if the objects are Python or C#, but I'm assuming C#. You'll need to overload + - * / on the objects to behave as you want, to cover basic math, and add an impilcit conversion to float ('implicit operator float()' in C#, __float__ in Python) if they decide to call sqrt() or similar. I'm assuming IronPython will handle the conversions properly; if not, file a bug because it's a pretty big problem if it doesn't. - Jeff From cmello at gmail.com Fri Feb 24 21:00:06 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 24 Feb 2012 18:00:06 -0200 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: 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'. I could make it work with __coercion__, but the documentation says to avoid this because it is error-prone and was discarded in Python 3. Sorry if I am asking this question in thw wrong mailing list. Maybe it should go to comp.lang.python. Any other suggestion? Thank you very much for the attention! Best regards Mello On Fri, Feb 24, 2012 at 5:20 PM, Jeff Hardy wrote: > On Fri, Feb 24, 2012 at 10:54 AM, Cesar Mello wrote: > > Is there a way to satisfy both scenarios? So that the object could also > be > > evaluated implicitly as a float? > > > > My first thought was to use a coercion, but the documentation does not > > recommend it. Any other suggestions please? > > You didn't specify if the objects are Python or C#, but I'm assuming C#. > > You'll need to overload + - * / on the objects to behave as you want, > to cover basic math, and > add an impilcit conversion to float ('implicit operator float()' in > C#, __float__ in Python) if they decide to call sqrt() or similar. > > I'm assuming IronPython will handle the conversions properly; if not, > file a bug because it's a pretty big problem if it doesn't. > > - Jeff > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Feb 24 21:17:33 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 24 Feb 2012 12:17:33 -0800 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: 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 From cmello at gmail.com Fri Feb 24 22:50:21 2012 From: cmello at gmail.com (Cesar Mello) Date: Fri, 24 Feb 2012 19:50:21 -0200 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: OK thank you very much! Best regards Mello On Fri, Feb 24, 2012 at 6: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 no_reply at codeplex.com Sat Feb 25 16:42:03 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 25 Feb 2012 07:42:03 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/24/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] IRONPYTHONPATH not respected for pyc.py compiled assemblies 2. [New comment] Add option to pyc.py to embed IronPython assemblies ---------------------------------------------- ISSUES 1. [New comment] IRONPYTHONPATH not respected for pyc.py compiled assemblies http://ironpython.codeplex.com/workitem/26706 User slide_o_mix has commented on the issue: "Fixed in 08322df"----------------- 2. [New comment] Add option to pyc.py to embed IronPython assemblies http://ironpython.codeplex.com/workitem/32288 User slide_o_mix has commented on the issue: "Fixed in 08322df" ---------------------------------------------- ---------------------------------------------- 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 Sat Feb 25 17:25:10 2012 From: cmello at gmail.com (Cesar Mello) Date: Sat, 25 Feb 2012 14:25:10 -0200 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: Hi, Although implementing the arithmetic operator overloads solve my problem, I am still curious if there is a way to implement the implicit conversion in Python, much like the sample C# program below does. This is a question about the language, so please forgive me if I am asking in the wrong mailing list. class DataValue { public double Value { get; set; } public DateTime Timestamp { get; set; } public static implicit operator double(DataValue dataValue) { return dataValue.Value; } } class Program { static void Main(string[] args) { DataValue val1 = new DataValue { Value = 2.5 }; DataValue val2 = new DataValue { Value = 3.5 }; double sum = val1 + val2; Console.WriteLine(sum.ToString()); } } Notice I did not need to implement the operator+ overload, and this object can be used anywhere a double is. I suppose this can be done with __coerce__ in Python 2, but that is not recommended in the documentation (and was removed in Python 3). Is there any other way to obtain this behavior in Python? I agree it may be error-prone. But there are valid scenarios where it is not. Although implementing the arithmetic overloads allow me to mix DataValues and floats in the same expressions, I am not able to initialize a Python's Decimal with a DataValue, for example. In C# that could be done. Thank you very much for the attention! Best regards Mello On Fri, Feb 24, 2012 at 7:50 PM, Cesar Mello wrote: > OK thank you very much! > > Best regards > Mello > > > On Fri, Feb 24, 2012 at 6: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 m.schaber at 3s-software.com Mon Feb 27 09:05:11 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 27 Feb 2012 08:05:11 +0000 Subject: [Ironpython-users] Implicit conversion of objects to float References: Message-ID: <727D8E16AE957149B447FE368139F2B50D749BAE@SERVER10> Hi, One other thing I forgot: If you want to create a Decimal out of your DataValue, you could add an implicit operator Decimal to your DataValue as a workaround instead. 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 -----Urspr?ngliche Nachricht----- Von: Markus Schaber Gesendet: Montag, 27. Februar 2012 09:04 An: 'Cesar Mello'; Jeff Hardy Cc: ironpython-users at python.org Betreff: AW: [Ironpython-users] Implicit conversion of objects to float Hi, Cesar, In C#, there's one difference in the following line: ????? double sum = val1 + val2; Here, the compiler knows that the result of the expression should be double, and so it can search for implicit cast operators to double. In python, you just write sum = val1 + val2 So the compiler does not know that the result of the expression should be double, because sum has no type. Imagine you have implicit conversion operators to int, double and string. All of them provide an + operator. Which of them do you want the compiler to apply? 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 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: Samstag, 25. Februar 2012 17:25 An: Jeff Hardy Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] Implicit conversion of objects to float Hi, Although implementing the arithmetic operator overloads solve my problem, I am still curious if there is a way to implement the implicit conversion in Python, much like the sample C# program below does. This is a question about the language, so please forgive me if I am asking in the wrong mailing list. class DataValue ? { ??? public double Value { get; set; } ? ??? public DateTime Timestamp { get; set; } ? ??? public static implicit operator double(DataValue dataValue) ??? { ????? return dataValue.Value; ??? } ? } ? ? class Program ? { ??? static void Main(string[] args) ??? { ????? DataValue val1 = new DataValue { Value = 2.5 }; ????? DataValue val2 = new DataValue { Value = 3.5 }; ? ????? double sum = val1 + val2; ????? Console.WriteLine(sum.ToString()); ??? } ? } Notice I did not need to implement the operator+ overload, and this object can be used anywhere a double is. I suppose this can be done with __coerce__ in Python 2, but that is not recommended in the documentation (and was removed in Python 3). ?Is there any other way to obtain this behavior in Python? I agree it may be error-prone. But there are valid scenarios where it is not. Although implementing the arithmetic overloads allow me to mix DataValues and floats in the same expressions, I am not able to initialize a Python's Decimal with a DataValue, for example. In C# that could be done. Thank you very much for the attention! Best regards Mello On Fri, Feb 24, 2012 at 7:50 PM, Cesar Mello wrote: OK thank you very much! Best regards Mello On Fri, Feb 24, 2012 at 6: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 From m.schaber at 3s-software.com Mon Feb 27 09:03:30 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 27 Feb 2012 08:03:30 +0000 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: Message-ID: <727D8E16AE957149B447FE368139F2B50D749BA1@SERVER10> Hi, Cesar, In C#, there's one difference in the following line: ????? double sum = val1 + val2; Here, the compiler knows that the result of the expression should be double, and so it can search for implicit cast operators to double. In python, you just write sum = val1 + val2 So the compiler does not know that the result of the expression should be double, because sum has no type. Imagine you have implicit conversion operators to int, double and string. All of them provide an + operator. Which of them do you want the compiler to apply? 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 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: Samstag, 25. Februar 2012 17:25 An: Jeff Hardy Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] Implicit conversion of objects to float Hi, Although implementing the arithmetic operator overloads solve my problem, I am still curious if there is a way to implement the implicit conversion in Python, much like the sample C# program below does. This is a question about the language, so please forgive me if I am asking in the wrong mailing list. class DataValue ? { ??? public double Value { get; set; } ? ??? public DateTime Timestamp { get; set; } ? ??? public static implicit operator double(DataValue dataValue) ??? { ????? return dataValue.Value; ??? } ? } ? ? class Program ? { ??? static void Main(string[] args) ??? { ????? DataValue val1 = new DataValue { Value = 2.5 }; ????? DataValue val2 = new DataValue { Value = 3.5 }; ? ????? double sum = val1 + val2; ????? Console.WriteLine(sum.ToString()); ??? } ? } Notice I did not need to implement the operator+ overload, and this object can be used anywhere a double is. I suppose this can be done with __coerce__ in Python 2, but that is not recommended in the documentation (and was removed in Python 3). ?Is there any other way to obtain this behavior in Python? I agree it may be error-prone. But there are valid scenarios where it is not. Although implementing the arithmetic overloads allow me to mix DataValues and floats in the same expressions, I am not able to initialize a Python's Decimal with a DataValue, for example. In C# that could be done. Thank you very much for the attention! Best regards Mello On Fri, Feb 24, 2012 at 7:50 PM, Cesar Mello wrote: OK thank you very much! Best regards Mello On Fri, Feb 24, 2012 at 6: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 From m.schaber at 3s-software.com Mon Feb 27 12:21:52 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 27 Feb 2012 11:21:52 +0000 Subject: [Ironpython-users] Calling a method whose name is a Python keyword Message-ID: <727D8E16AE957149B447FE368139F2B50D749D00@SERVER10> Hi, I have a .NET object which exposes a method "import(some, parameters)" method. However, I cannot call this method as "import" is a reserved keyword in IronPython. How to call this method? 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 m.schaber at 3s-software.com Mon Feb 27 13:24:30 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 27 Feb 2012 12:24:30 +0000 Subject: [Ironpython-users] Calling a method whose name is a Python keyword In-Reply-To: <727D8E16AE957149B447FE368139F2B50D749D00@SERVER10> References: <727D8E16AE957149B447FE368139F2B50D749D00@SERVER10> Message-ID: <727D8E16AE957149B447FE368139F2B50D749D27@SERVER10> Hi, I answer my own question to get the solution into the archives: > I have a .NET object which exposes a method "import(some, parameters)" method. However, I cannot call this method as "import" is a reserved keyword in IronPython. How to call this method? The "__getattribute__" method seems to be the solution: Foo.__getattribute("import")(some, parameters) 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 no_reply at codeplex.com Mon Feb 27 14:07:47 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 27 Feb 2012 05:07:47 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/26/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.Wpf.dll is not loaded as intended ---------------------------------------------- ISSUES 1. [New issue] IronPython.Wpf.dll is not loaded as intended http://ironpython.codeplex.com/workitem/32319 User blackip has proposed the issue: "ipy.exe tries to load IronPython.Wpf.dll when you tun any script But it fails to load it. Run fuslogvw - LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Program Files/IronPython 2.7.1/IronPython.Wpf.dll.DLL. LOG: Attempting download of new URL file:///C:/Program Files/IronPython 2.7.1/IronPython.Wpf.dll/IronPython.Wpf.dll.DLL. LOG: Attempting download of new URL file:///C:/Program Files/IronPython 2.7.1/IronPython.Wpf.dll.EXE. LOG: Attempting download of new URL file:///C:/Program Files/IronPython 2.7.1/IronPython.Wpf.dll/IronPython.Wpf.dll.EXE. LOG: All probing URLs attempted and failed. I have found the dll in C:\Program Files\IronPython 2.7.1\DLLs" ---------------------------------------------- ---------------------------------------------- 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 dblank at cs.brynmawr.edu Mon Feb 27 13:49:12 2012 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Mon, 27 Feb 2012 07:49:12 -0500 (EST) Subject: [Ironpython-users] Calling a method whose name is a Python keyword In-Reply-To: <727D8E16AE957149B447FE368139F2B50D749D27@SERVER10> References: <727D8E16AE957149B447FE368139F2B50D749D00@SERVER10> <727D8E16AE957149B447FE368139F2B50D749D27@SERVER10> Message-ID: <52841.76.98.34.255.1330346952.squirrel@cs.brynmawr.edu> > Hi, > > I answer my own question to get the solution into the archives: > >> I have a .NET object which exposes a method "import(some, parameters)" >> method. However, I cannot call this method as "import" is a reserved >> keyword in IronPython. How to call this method? > > The "__getattribute__" method seems to be the solution: > > Foo.__getattribute("import")(some, parameters) Yes, that would be the standard Python way. Or slightly cleaner: getattr(Foo, "import")(some, parameters) -Doug > > 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 > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From jdhardy at gmail.com Mon Feb 27 17:20:24 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 27 Feb 2012 08:20:24 -0800 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: <727D8E16AE957149B447FE368139F2B50D749BAE@SERVER10> References: <727D8E16AE957149B447FE368139F2B50D749BAE@SERVER10> Message-ID: > On Fri, Feb 24, 2012 at 7:50 PM, Cesar Mello wrote: > I agree it may be error-prone. But there are valid scenarios where it is not. Although implementing the arithmetic overloads allow me to mix DataValues and floats in the same expressions, I am not able to initialize a Python's Decimal with a DataValue, for example. In C# that could be done. On Mon, Feb 27, 2012 at 12:05 AM, Markus Schaber wrote: > If you want to create a Decimal out of your DataValue, you could add an implicit operator Decimal to your DataValue as a workaround instead. You still couldn't pass a DataValue directly to a decimal.Decimal, though. I added conversions from System.Decimal to decimal.Decimal in 2.7.2, but I didn't think about implicit conversions of other types. I'm thinking now that anything that's either a System.Decimal or implicitly convertible to System.Decimal should be accepted. - Jeff From jdhardy at gmail.com Mon Feb 27 17:24:34 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 27 Feb 2012 08:24:34 -0800 Subject: [Ironpython-users] IronPython 2.7.2 Beta 1 now available Message-ID: On behalf of the IronPython team, I'm happy to announce the first (and probably only) beta release of IronPython 2.7.2. 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 Alpha 2 includes support for .NET 3.5, .NET 4, Silverlight 4, Silverlight 5, Mono for Android (http://xamarin.com/monoforandroid) 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 Beta 1 is also available on NuGet (http://nuget.org). 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. Any fixes should be made available prior to the release of the RC on March 4th. - Jeff From vernondcole at gmail.com Mon Feb 27 17:53:26 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 27 Feb 2012 09:53:26 -0700 Subject: [Ironpython-users] Implicit conversion of objects to float In-Reply-To: References: <727D8E16AE957149B447FE368139F2B50D749BAE@SERVER10> Message-ID: On Mon, Feb 27, 2012 at 9:20 AM, Jeff Hardy wrote: > ... > I added conversions from System.Decimal to decimal.Decimal in > 2.7.2, but I didn't think about implicit conversions of other types. > I'm thinking now that anything that's either a System.Decimal or > implicitly convertible to System.Decimal should be accepted. > > - Jeff > Thank you, Jeff! I'll go remove the workaround from my source code (actually move it to an exception handler). [For those who don't know -- Jeff has just fixed a work item I originally reported in 2008. Somebody by him a beer!] I would agree that implicit conversions should also be included in the fix. Any data which is "decimalish" should be handled as a decimal to avoid the necessity for the programmer to specify back-and-forth conversions. -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Tue Feb 28 16:42:38 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 28 Feb 2012 07:42:38 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 2/27/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Automatically convert types that are implicitly convertible to System.Decimal/System.Int to decimal.Decimal 2. [New issue] "platform" instructions on 2.7.2b2 3. [New comment] Allow resources when compiling with pyc.py ---------------------------------------------- ISSUES 1. [New issue] Automatically convert types that are implicitly convertible to System.Decimal/System.Int to decimal.Decimal http://ironpython.codeplex.com/workitem/32324 User jdhardy has proposed the issue: "decimal.Decimal will automatically convert from System.Decimal; this should be extended to any type that is implicitly convertible to System.Decimal as well. Extending it to types convertible to System.Int may be necessary as well if they are not already handled."----------------- 2. [New issue] "platform" instructions on 2.7.2b2 http://ironpython.codeplex.com/workitem/32322 User jimp02 has proposed the issue: "Release 2.7.2b1 (beta) The python code: print("ExampleExe", platform.python_implementation(), platform.python_version(), platform.architecture()[0]) ------------------------------------------------- platform.python_version() which returns the Python version as string 'major.minor.patchlevel' aborts with the message: Traceback (most recent call last): File "C:\Users\jimp\Projects\AStyleDev\build\vs2010\ExamplePy\..\..\..\src-py\ExampleExe.py", line 90, in File "C:\Users\jimp\Projects\AStyleDev\build\vs2010\ExamplePy\..\..\..\src-py\ExampleExe.py", line 27, in process_files File "C:\Program Files (x86)\IronPython 2.7\Lib\platform.py", line 1468, in python_version File "C:\Program Files (x86)\IronPython 2.7\Lib\platform.py", line 1389, in _sys_version ValueError: failed to parse IronPython sys.version: '2.7.2b1 (IronPython 2.7.2b1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit))'Press any key to continue . . . ------------------------------------------------- platform.python_implementation() which returns a string identifying the Python implementation aborts with the SAME message: Traceback (most recent call last): File "C:\Users\jimp\Projects\AStyleDev\build\vs2010\ExamplePy\..\..\..\src-py\ExampleExe.py", line 90, in File "C:\Users\jimp\Projects\AStyleDev\build\vs2010\ExamplePy\..\..\..\src-py\ExampleExe.py", line 27, in process_files File "C:\Program Files (x86)\IronPython 2.7\Lib\platform.py", line 1458, in python_implementation File "C:\Program Files (x86)\IronPython 2.7\Lib\platform.py", line 1389, in _sys_version ValueError: failed to parse IronPython sys.version: '2.7.2b1 (IronPython 2.7.2b1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit))'Press any key to continue . . . ------------------------------------------------- Commenting out platform.python_implementation() and platform.python_version() fixes the problem. The code worked on 2.7.1."----------------- 3. [New comment] Allow resources when compiling with pyc.py http://ironpython.codeplex.com/workitem/32289 User jdhardy has commented on the issue: "Managed resources - stuff you would use from WinForms, loadable with Assembly.GetManifestResourceStream, etc. The script would have to take advantage of it, but it would be valuable to make completely standalone executables. I would say it's not a particularly high priority unless someone else requests it, though." ---------------------------------------------- ---------------------------------------------- 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 Feb 29 23:12:16 2012 From: lady_radsu at yahoo.com (surangika ranathunga) Date: Wed, 29 Feb 2012 14:12:16 -0800 (PST) Subject: [Ironpython-users] Error when trying to call a python file that imports nltk Message-ID: <1330553536.42628.YahooMailClassic@web110203.mail.gq1.yahoo.com> Hi all, I have been using Ironpython for a while and it has been working fine for me. However, now I have to call a python function that makes use of the nltk module.When trying to call this python function from my c# code using Ironpython, I get the following error: IronPython.Runtime.Exceptions.ImportException: No module named nltk ?? at Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value) ?? at Microsoft.Scripting.Interpreter.FuncCallInstruction`2.Run(InterpretedFrame ?frame) ?? at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) ?? at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 a rg1) ?? 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.Hosting.ScriptSource.Execute(ScriptScope scope) ?? at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path) ?? at Microsoft.Scripting.Hosting.ScriptRuntime.ExecuteFile(String path) ?? at Microsoft.Scripting.Hosting.ScriptRuntime.UseFile(String path) ?? at readerwriterforOVH.Program.Main(String[] args) in D:\PhD Work\Research\lib omv\test\readerwriterforOVH\readerwriterforOVH\Program.cs:line 105 Seems like this is a common problem; something related to a module names 'subprocess'. However, I could not find any definite solution. So, any help on this is appreciated. /Sura -------------- next part -------------- An HTML attachment was scrubbed... URL: