From no_reply at codeplex.com Sun Jan 1 09:58:57 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 1 Jan 2012 00:58:57 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 12/31/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Pickling Numpy arrays ---------------------------------------------- ISSUES 1. [New comment] Pickling Numpy arrays http://ironpython.codeplex.com/workitem/32007 User slide_o_mix has commented on the issue: "Where did you pull numpy from? " ---------------------------------------------- ---------------------------------------------- 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 jawara.shelton at gmail.com Sun Jan 1 22:11:02 2012 From: jawara.shelton at gmail.com (Jawara Shelton) Date: Sun, 1 Jan 2012 14:11:02 -0700 Subject: [Ironpython-users] Unable to Update UI Message-ID: Hello! I'm new to FePy, and to the list as well. Got an issue I've been working at for a while - and hoped someone wiser and more experienced could help with. To start I'm using IronPython Studio (MS Visual Studio 2010), along with WPF for the GUI. The problem I'm having is convincing the UI containing the progress bars, and other messages to update during the process - including closing after the process is completed. The purpose of the object is to provide for File Sanitization. So if you decide to test the code please be sure you don't delete any files you may want to recover. Or better yet: Delete a copy. TIA - Damien \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ///////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// >>>>>[ BEGIN FileSanitization.py \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ///////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// import clr, datetime, os, random, sys, traceback, wpf clr.AddReference('System.Windows.Forms') from System.Windows import * from System.Windows.Forms import MessageBox from time import sleep, localtime, strftime class Sanitizer(Window): """ A File Sanitization class providing secure data removal. Methods Available: US Department of Defence Gutmann Pseudo-Random Number RCMP TSSIT OPS11 Single Pass 0 Single Pass 1 """ def __init__(self): self.fileCount = 0 self.conDict = {} wpf.LoadComponent(self, 'effacor_UIprogressBar.xaml') mapControls(self.Content.Children, self.conDict, False) self.ShowInTaskbar = False def Sanitize(self, dGrid, method): methDict={'DoD':self.sanViaDoD5220_22M, 'Gut':self.sanViaGutmann, 'PRN':self.pseudoRandomNumber, 'RCM':self.sanViaRCMP_TSSIT_OPS11, 'SP0':self.singlePass0, 'SP1':self.singlePass1 } self.conDict['Task_Begun'] = 'Task Begun: %s' % (str(localtime())) self.conDict['List_Progress'].Maximum = dGrid.Items.Count self.ShowDialog() # Sanitize the Data for x in range(0, dGrid.Items.Count): # ///// #self.conDict['File_Counter'].Content = "Processing File %s of %s" % (str(x+1), str(dGrid.Items.Count)) # \\\\\ try: methDict[method](dGrid.Items[x]) os.remove(dGrid.Items[x]) except Exception: nbcLock = traceback.format_exc() MessageBox.Show("there were errors:\n%s\n" % (nbcLock), "Problem Occured During Sanitization") self.Close() def spOverwrite(self, fNym, oneZeroRandom): """ Performs a single pass over the data. - If oneZeroRandom is a 1 or 0, it writes that. Otherwise, it randomizes the output (I use "3" for that). - By nature, function serves as the Single Pass 0, Single Pass 1, and PRNG algorithms as well (use oneZeroRandom = 3 to use the PRNG algorithm). ----- fObj : File Pointer fSiz : File Size oneZeroRandom: Determines the type of pass to be performed. 0 = Overwrite file with zeros 1 = Overwrite file with ones 3 = Overwrite with random data (randomized data actually written for all values that are not 0 or 1) """ fObj = open(fNym, "rb+") fSiz = os.path.getsize(fNym) fObj.seek(0) for x in range(0, fSiz): if oneZeroRandom in (0,1): fObj.write(chr(oneZeroRandom*255)) else: fObj.write(chr(random.randrange(0,255))) fObj.close() def pseudoRandomNumber(self, fNym): # #self.conDict['File_Progress'].Maximum = 1 # self.spOverwrite(fNym, 3) # #self.conDict['File_Progress'].Value = 1 # def singlePass0(self, fNym): # #self.conDict['File_Progress'].Maximum = 1 # self.spOverwrite(fNym, 0) # #self.conDict['File_Progress'].Value = 1 # def singlePass1(self, fNym): # #self.conDict['File_Progress'].Maximum = 1 # self.spOverwrite(fNym, 1) # #self.conDict['File_Progress'].Value = 1 # def sanViaDoD5220_22M(self, fNym): """ Performs Department of Defense spec data sanitization as specified in the National Industrial Security Program Operating Manual (NISPOM DoD 5220.22-M). ----- fObj : File Pointer fSiz : File Size dOdPat : An array storing the patterns for each sanitization run. """ dOdPat = [0,1,3,0,1,0,3] # # self.conDict['File_Progress'].Maximum = 7 # for x in range(0, 6): # #self.conDict['File_Progress'].Value = x+1 # spOverwrite(fNym, dOdPat[x]) def sanViaRCMP_TSSIT_OPS11(self, fNym): """ Performs RCMP TSSIT OPS-II data sanitization as originally defined in Appendix Ops-II: Media Sanitation of the Technical Security Standards for Information Technology (TSSIT) document, published by the Royal Canadian Mounted Police (RCMP). ----- fObj : File Pointer fSiz : File Size rcmpPat : An array storing the patterns for each sanitization run. """ rcmpPat = [1,0,1,0,1,0,3] # #self.conDict['File_Progress'].Maximum = 7 # for x in range(0, 6): # #self.conDict['File_Progress'].Value = x+1 # spOverwrite(fNym, rcmpPat[x]) def sanViaGutmann(self, fNym): """ Performs data sanitization using the Gutmann Method. Media Sanitation of the Technical Security Standards for Information Technology (TSSIT) document, published by the Royal Canadian Mounted Police (RCMP). ----- fObj : File Pointer fSiz : File Size rcmpPat : An array storing the patterns for each sanitization run. """ # gPat stores the pre-determined patterns used during the overwrite process used # in the gutmann method. gPat = [[0x55], [0xAA], [0x92,0x49,0x24], [0x49,0x24,0x92], [0x24,0x92,0x49], [0x00], [0x11], [0x22], [0x33]] gPat[len(gPat):] = [[0x44], [0x55], [0x66], [0x77], [0x88], [0x99], [0xAA], [0xBB], [0xCC], [0xDD], [0xEE]] gPat[len(gPat):] = [[0xFF], [0x92,0x49,0x24], [0x49,0x24,0x92], [0x24,0x92,0x49], [0x6D,0xB6,0xDB]] gPat[len(gPat):] = [[0xB6,0xDB,0x6D], [0xDB,0x6D,0xB6]] # Use the data containing the set of 27 pre-determined patterns and determine pass order. # The ORDER those patterns are written in is randomized. x = random.randrange(0,26) gPatOrder = [] while len(gPatOrder) < 26: # It is necessary to check to insure that a pattern is not selected twice. # Hence the additional while clause. while x in gPatOrder: x = random.randrange(0,26) gPatOrder[len(gPatOrder):] = [x] fPass = 0 # #self.conDict['File_Progress'].Maximum = 27 # # Make the initial 4 passes writing over the data # Each pass overwrites the data in the file with random data. # This is the first step in the Gutmann process. for x in range(0, 3): self.spOverwrite(fNym, 3) fPass = fPass + 1 # #self.conDict['File_Progress'].Value = fPass # # Make the 27 passes to overwrite the data. # Use the pre-determined, pseudo-random order as determined by gPatOrder. fObj = open(fNym, "rb+") fSiz = os.path.getsize(fNym) for x in gPatOrder: fObj.seek(0) for y in range(0, fSiz): fObj.write(chr(gPat[x][y%len(gPat[x])])) fPass = fPass + 1 # #self.conDict['File_Progress'].Value = fPass # fObj.close() # Make 4 passes writing over the data # Each pass overwrites the data in the file with random data. # This is the final step in the Gutmann process. for x in range(0, 3): self.spOverwrite(fNym, 3) fPass = fPass + 1 # #self.conDict['File_Progress'].Value = fPass # def mapControls(winObj, dict, items): """ Maps the controls found in a WPF object (winObj) and places them into dict for easy reference later. - The items parameter is used during the recursive pass. ----- winObj : Object to be mapped. dict : Dictionary in which mappings are stored. items : (Boolean) Specifies whether or not the procedure for iterating through an items collection should be used. x : Iterator """ if items == True: for x in winObj.Items: dict[x.Name] = x if hasattr(x, "Items") and x.Items.Count > 0: mapControls(x, dict, True) else: for x in winObj: if "System.Windows.Controls." in str(x) and hasattr(x,"Name") and x.Name.Length>0: dict[x.Name] = x if hasattr(x, "Items") and x.Items.Count > 0: mapControls(x, dict, True) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ///////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// >>>>>[ BEGIN effacor_UIprogressBar.xaml \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ///////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Tue Jan 3 10:41:10 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 3 Jan 2012 01:41:10 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/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] Regression: __reduce_ex__ and __reduce__ fails for None 2. [New issue] Type error from string input to class inheriting int 3. [New issue] Support PyCapsule type module extension 4. [New comment] Support PyCapsule type module extension ---------------------------------------------- ISSUES 1. [New issue] Regression: __reduce_ex__ and __reduce__ fails for None http://ironpython.codeplex.com/workitem/32022 User Zartsoft has proposed the issue: "Works in 2.0.1: C:\>"c:\Program Files (x86)\IronPython 2.0.1\ipy.exe" -c "print None.__reduce_ex__(2)" (, (,), None, None, None) Fails in 2.6 and 2.7: C:\>"c:\Program Files (x86)\IronPython 2.6\ipy.exe" -c "print None.__reduce_ex__(2)" Traceback (most recent call last): File "", line 1, in TypeError: __reduce__() takes exactly 1 argument (1 given) C:\>"c:\Program Files (x86)\IronPython 2.7\ipy.exe" -c "print None.__reduce_ex__(2)" Traceback (most recent call last): File "", line 1, in TypeError: __reduce__() takes exactly 1 argument (1 given) C:\>"c:\Program Files (x86)\IronPython 2.7\ipy.exe" -c "print None.__reduce__()" Traceback (most recent call last): File "", line 1, in TypeError: __reduce__() takes exactly 1 argument (1 given) CPython 2.7 output for reference: C:\>"c:\Program Files (x86)\Python27\python.exe" -c "print None.__reduce_ex__(2)" (, (,), None, None, None) True, False, Ellipsis are fine, only None has issues."----------------- 2. [New issue] Type error from string input to class inheriting int http://ironpython.codeplex.com/workitem/32024 User phatfish has proposed the issue: "Thanks goes to Curt on the IronPython users list for the example code. One notable affected package is PyPDF. In IronPython 2.7.1, >>> class Integer(int): ... def __init__(self, value): ... int.__init__(value) ... >>> Integer(10) 10 >>> Integer('10') Traceback (most recent call last): File "", line 1, in TypeError: expected int, got str >>> int('10') 10 >>> In Python 2.6, >>> class Integer(int): ... def __init__(self, value): ... int.__init__(value) ... >>> Integer(10) 10 >>> Integer('10') 10 >>> int('10') 10 >>>"----------------- 3. [New issue] Support PyCapsule type module extension http://ironpython.codeplex.com/workitem/32026 User slide_o_mix has proposed the issue: "PyCapsules are basically pointers to C structures that allow overriding or custom implementation of module functionality. Currently IronPython does not support this directly, but it would be nice to put common operations into the runtime."----------------- 4. [New comment] Support PyCapsule type module extension http://ironpython.codeplex.com/workitem/32026 User slide_o_mix has commented on the issue: "See http://docs.python.org/extending/extending.html#providing-a-c-api-for-an-extension-module for 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 Tue Jan 3 16:10:58 2012 From: slide.o.mix at gmail.com (Slide) Date: Tue, 3 Jan 2012 08:10:58 -0700 Subject: [Ironpython-users] TestRunner Message-ID: Is there a specific reason that IronPython is using TestRunner as opposed to just extending something like xUnit or NUnit? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Tue Jan 3 18:54:44 2012 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 3 Jan 2012 17:54:44 +0000 Subject: [Ironpython-users] TestRunner In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E4CC7B9A3@TK5EX14MBXC292.redmond.corp.microsoft.com> When the development was all done inside of Microsoft we had a gated check-in system called SNAP. TestRunner was a just a simple way to dump all of the metadata about the tests from that system and have an easy way to run them all. It wasn't necessarily meant to be a long-term solution. I know some of the tests have started being moved over to Nunit, maybe they all could be moved over. 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: Tuesday, January 03, 2012 7:11 AM To: ironpython-users at python.org Subject: [Ironpython-users] TestRunner Is there a specific reason that IronPython is using TestRunner as opposed to just extending something like xUnit or NUnit? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Jan 4 05:14:36 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 4 Jan 2012 04:14:36 +0000 Subject: [Ironpython-users] [Ironruby-core] Cannot build IronRuby or IronPython MSI's In-Reply-To: References: Message-ID: <9597F4A19BFDB342B6E90963100C33082EECA662@CH1PRD0302MB132.namprd03.prod.outlook.com> Yes, the installer is broken. Jeff is working on some better installer building scripts. I'm not sure what the status is atm. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, January 03, 2012 8:07 PM To: ironruby-core at rubyforge.org Cc: ironpython-users at python.org Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's I did a git pull today of IronLanguages\main, and noticed a giant stack of changes on December 30, 31 and Jan 1 - which look like they're related to Win8 and Mango, amongst other things. I'm trying to build the IronRuby installer - the process also builds the IronPython installer along with it. It ( msbuild /p:Configuration=Release Installer.proj ) now fails with several errors: 1 - IronRubyTools.dll fails to build. It complains about "A reference was created to embedded interop assembly '..........\VSLangProj.dll' - I fixed this by setting Embed Interop Types = false on that reference (what happened to break this??) 2 - The build now fails because it couldn't find silverlight 4 dll's, whereas it used to work (did it used to reference silverlight 3 which ships with VS2010??). - I fixed the error by installing the silverlight 4 SDK 3 - Two proj files have gone missing: c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Chm\IronPython.Chm.proj" was not found. c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Msi\IronPython.Msi.wproj" was not found. It seems these have vanished?? I tried to work around this by manually building only Ruby\Msi\IronRuby.Msi.wproj 4 - This now fails with c:\Dev\ironlanguages-main\Msi\Ruby\Msi\Silverlight.wxi(14): error CNDL0150: Undefined preprocessor variable '$(var.OutputPath)'. [c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.Msi.wproj] It looks like that Wxi file hasn't changed recently, so presumably something else is ruining the outpath? - I fixed this by editing IronRuby.wxs and removing all mention of silverlight... This is fine for me, as I don't want to go near silverlight, but others may require a better solution :-) 5 - Now there's a bunch of errors all like this: c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.wxs(92): error LGHT1055: The InstallExecuteSequence table contains an action 'NetFxScheduleNativeImage' which cannot be merged from the merge module 'c:\Dev\ironlanguages-main\bin\Release\ \IrbRedist.msm'. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module. [c:\Dev\ironlanguages-main\Msi\Ruby\Ms i\IronRuby.Msi.wproj] This is where I give up.. The giant stack of changes mostly came from Tomas Matousek / JDHardy / couple of other IronPython devs... Would one of those people mind please having a look at this? Thanks, Orion -------------- next part -------------- An HTML attachment was scrubbed... URL: From Orion.Edwards at gallagher.co Wed Jan 4 05:07:08 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Wed, 4 Jan 2012 17:07:08 +1300 Subject: [Ironpython-users] Cannot build IronRuby or IronPython MSI's Message-ID: I did a git pull today of IronLanguages\main, and noticed a giant stack of changes on December 30, 31 and Jan 1 - which look like they're related to Win8 and Mango, amongst other things. I'm trying to build the IronRuby installer - the process also builds the IronPython installer along with it. It ( msbuild /p:Configuration=Release Installer.proj ) now fails with several errors: 1 - IronRubyTools.dll fails to build. It complains about "A reference was created to embedded interop assembly '..........\VSLangProj.dll' - I fixed this by setting Embed Interop Types = false on that reference (what happened to break this??) 2 - The build now fails because it couldn't find silverlight 4 dll's, whereas it used to work (did it used to reference silverlight 3 which ships with VS2010??). - I fixed the error by installing the silverlight 4 SDK 3 - Two proj files have gone missing: c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Chm\IronPython.Chm.proj" was not found. c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Msi\IronPython.Msi.wproj" was not found. It seems these have vanished?? I tried to work around this by manually building only Ruby\Msi\IronRuby.Msi.wproj 4 - This now fails with c:\Dev\ironlanguages-main\Msi\Ruby\Msi\Silverlight.wxi(14): error CNDL0150: Undefined preprocessor variable '$(var.OutputPath)'. [c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.Msi.wproj] It looks like that Wxi file hasn't changed recently, so presumably something else is ruining the outpath? - I fixed this by editing IronRuby.wxs and removing all mention of silverlight... This is fine for me, as I don't want to go near silverlight, but others may require a better solution :-) 5 - Now there's a bunch of errors all like this: c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.wxs(92): error LGHT1055: The InstallExecuteSequence table contains an action 'NetFxScheduleNativeImage' which cannot be merged from the merge module 'c:\Dev\ironlanguages-main\bin\Release\ \IrbRedist.msm'. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module. [c:\Dev\ironlanguages-main\Msi\Ruby\Ms i\IronRuby.Msi.wproj] This is where I give up.. The giant stack of changes mostly came from Tomas Matousek / JDHardy / couple of other IronPython devs... Would one of those people mind please having a look at this? Thanks, Orion -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Jan 4 06:19:12 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 3 Jan 2012 21:19:12 -0800 Subject: [Ironpython-users] [Ironruby-core] Cannot build IronRuby or IronPython MSI's In-Reply-To: <9597F4A19BFDB342B6E90963100C33082EECA662@CH1PRD0302MB132.namprd03.prod.outlook.com> References: <9597F4A19BFDB342B6E90963100C33082EECA662@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: The IronPython ones should be working, and nothing I did should change IronRuby's installer builds. However, the old build script may reference IronPython installers that no longer exist. - Jeff On Tue, Jan 3, 2012 at 8:14 PM, Tomas Matousek wrote: > Yes, the installer is broken. Jeff is working on some better installer > building scripts. I?m not sure what the status is atm. > > > > Tomas > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, January 03, 2012 8:07 PM > To: ironruby-core at rubyforge.org > Cc: ironpython-users at python.org > Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's > > > > I did a git pull today of IronLanguages\main, and noticed a giant stack of > changes on December 30, 31 and Jan 1 - which look like they're related to > Win8 and Mango, amongst other things. > > I'm trying to build the IronRuby installer - the process also builds the > IronPython installer along with it. > > It ( msbuild /p:Configuration=Release Installer.proj ) now fails with > several errors: > > 1 - IronRubyTools.dll fails to build. It complains about "A reference was > created to embedded interop assembly '..........\VSLangProj.dll' > ?- I fixed this by setting Embed Interop Types = false on that reference > (what happened to break this??) > > 2 - The build now fails because it couldn't find silverlight 4 dll's, > whereas it used to work (did it used to reference silverlight 3 which ships > with VS2010??). > ?- I fixed the error by installing the silverlight 4 SDK > > 3 - ? Two proj files have gone missing: > > c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The > project file "Python\Chm\IronPython.Chm.proj" was not found. > c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The > project file "Python\Msi\IronPython.Msi.wproj" ?was not found. > > It seems these have vanished?? > I tried to work around this by manually building only > Ruby\Msi\IronRuby.Msi.wproj > > 4 - This now fails with > ? c:\Dev\ironlanguages-main\Msi\Ruby\Msi\Silverlight.wxi(14): error > CNDL0150: Undefined preprocessor variable '$(var.OutputPath)'. > [c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.Msi.wproj] > > It looks like that Wxi file hasn't changed recently, so presumably something > else is ruining the outpath? > - I fixed this by editing IronRuby.wxs and removing all mention of > silverlight... This is fine for me, as I don't want to go near silverlight, > but others may require a better solution :-) > > 5 - Now there's a bunch of errors all like this: > > ? c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.wxs(92): error LGHT1055: > The InstallExecuteSequence table contains an > ?action 'NetFxScheduleNativeImage' which cannot be merged from the merge > module 'c:\Dev\ironlanguages-main\bin\Release\ > \IrbRedist.msm'. ?This action is likely colliding with an action in the > database that is being created. ?The colliding > action may have been authored in the database or merged in from another > merge module. ?If this is a standard action, it > ?is likely colliding due to a difference in the condition for the action in > the database and merge module. ?If this is > a custom action, it should only be declared in the database or one merge > module. [c:\Dev\ironlanguages-main\Msi\Ruby\Ms > i\IronRuby.Msi.wproj] > > This is where I give up.. > > The giant stack of changes mostly came from Tomas Matousek / JDHardy / > couple of other IronPython devs... Would one of those people mind please > having a look at this? > > Thanks, Orion From no_reply at codeplex.com Wed Jan 4 10:44:08 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 4 Jan 2012 01:44:08 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/3/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Pickling Numpy arrays 2. [New comment] Type error from string input to class inheriting int ---------------------------------------------- ISSUES 1. [New comment] Pickling Numpy arrays http://ironpython.codeplex.com/workitem/32007 User Hyang02116 has commented on the issue: "http://www.enthought.com/repo/.iron/"----------------- 2. [New comment] Type error from string input to class inheriting int http://ironpython.codeplex.com/workitem/32024 User jdhardy has commented on the issue: "And Curt already fixed this in 37c1b27." ---------------------------------------------- ---------------------------------------------- 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 Jan 6 11:39:06 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 6 Jan 2012 02:39:06 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/5/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] current working directory lost in compiled script 2. [New issue] current working directory lost in compiled script 3. [New issue] current working directory lost in compiled script 4. [New issue] current working directory lost in compiled script ---------------------------------------------- ISSUES 1. [New issue] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32042 User peterSchwalm has proposed the issue: "If I compile a script using a (slightly modified) version of pyc.py the working directory is changed to the folder containing the .exe-file ipy version: 2.7.1"----------------- 2. [New issue] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32043 User peterSchwalm has proposed the issue: "If I compile a script using a (slightly modified) version of pyc.py the working directory is changed to the folder containing the .exe-file, regardless of the location from where the .exe is called. This means: if a) I write a utility accepting filenames as command line parameters, and b) the .exe file is not in the working dir of the command shell (for example somewhere in the command shell searchpath) I always have to supply absolutes pathnames on the command line for the utility. This is a) nasty b) incompatible with the same script interpreted by ipy.exe c) incompatible cpython ipy version: 2.7.1"----------------- 3. [New issue] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32044 User peterSchwalm has proposed the issue: "If I compile a script using a (slightly modified) version of pyc.py the working directory is changed to the folder containing the .exe-file, regardless of the location from where the .exe is called. This means: if a) I write a utility accepting filenames as command line parameters, and b) the .exe file is not in the working dir of the command shell (for example somewhere in the command shell searchpath) I always have to supply absolutes pathnames on the command line for the utility. This is a) nasty b) incompatible with the same script interpreted by ipy.exe c) incompatible cpython ipy version: 2.7.1"----------------- 4. [New issue] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32045 User peterSchwalm has proposed the issue: "If I compile a script using a (slightly modified) version of pyc.py the working directory is changed to the folder containing the .exe-file, regardless of the location from where the .exe is called. This means: if a) I write a utility accepting filenames as command line parameters, and b) the .exe file is not in the working dir of the command shell (for example somewhere in the command shell searchpath) I always have to supply absolutes pathnames on the command line for the utility. This is a) nasty b) incompatible with the same script interpreted by ipy.exe c) incompatible cpython ipy version: 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 no_reply at codeplex.com Sat Jan 7 12:58:08 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 7 Jan 2012 03:58:08 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/6/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] current working directory lost in compiled script 2. [Status update] current working directory lost in compiled script 3. [Status update] current working directory lost in compiled script 4. [New comment] import pyc modules ---------------------------------------------- ISSUES 1. [Status update] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32042 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of 32045"----------------- 2. [Status update] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32043 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of 32045"----------------- 3. [Status update] current working directory lost in compiled script http://ironpython.codeplex.com/workitem/32044 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of 32045"----------------- 4. [New comment] import pyc modules http://ironpython.codeplex.com/workitem/8733 User slide_o_mix has commented on the issue: "I took a look at Jython's bytecode stuff, the porting of the byte code parser and execution stuff in general would not be too difficult, the real issue is how to fit it into the execution of scripts nicely." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Jan 8 14:49:54 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 8 Jan 2012 05:49:54 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/7/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] ctypes: Compatibility issue with CPython 2. [New comment] ctypes: no support for Union 3. [New comment] ctypes: no support for Union 4. [New comment] ctypes.c_uint32 fails with TypeError when overflowed ---------------------------------------------- ISSUES 1. [New issue] ctypes: Compatibility issue with CPython http://ironpython.codeplex.com/workitem/32048 User MarioVilas has proposed the issue: "The following code works in CPython but not in IronPython: >>> from ctypes import * >>> c_char_p(byref(c_char())) Traceback (most recent call last): File "", line 1, in TypeError: expected char pointer, got NativeArgument This example is contrived, but a real case scenario (which is how I found this) is when setting the argtypes property in a Win32 API wrapper. In my code I have something like this: def GetVersionExA(): _GetVersionExA = windll.kernel32.GetVersionExA _GetVersionExA.argtypes = [LPVOID] _GetVersionExA.restype = bool _GetVersionExA.errcheck = RaiseIfZero Then when I try to call this function using a byref() argument I get the same error message as above. In general, it seems to be that IronPython is very strict about type checking in situations where CPython is not (see also this ticket: https://ironpython.codeplex.com/workitem/30390 )."----------------- 2. [New comment] ctypes: no support for Union http://ironpython.codeplex.com/workitem/25106 User MarioVilas has commented on the issue: "Also this seems to fail, may be related: >>> ctypes.c_void_p(-1) Traceback (most recent call last): File "", line 1, in TypeError: expected pointer, got int In CPython it works properly by converting -1 to 0xFFFFFFFF in 32 bits, 0xFFFFFFFFFFFFFFFF in 64 bits."----------------- 3. [New comment] ctypes: no support for Union http://ironpython.codeplex.com/workitem/25106 User MarioVilas has commented on the issue: "Sorry, that was supposed to go in another ticket. I can't seem to delete the comment now."----------------- 4. [New comment] ctypes.c_uint32 fails with TypeError when overflowed http://ironpython.codeplex.com/workitem/30390 User MarioVilas has commented on the issue: "Also this seems to fail, may be related: >>> ctypes.c_void_p(-1) Traceback (most recent call last): File "", line 1, in TypeError: expected pointer, got int In CPython it works properly by converting -1 to 0xFFFFFFFF in 32 bits, 0xFFFFFFFFFFFFFFFF in 64 bits." ---------------------------------------------- ---------------------------------------------- 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 1989lzhh at gmail.com Mon Jan 9 09:58:59 2012 From: 1989lzhh at gmail.com (=?GB2312?B?wfXV8bqj?=) Date: Mon, 9 Jan 2012 16:58:59 +0800 Subject: [Ironpython-users] How to use extension type with C# Extension Methods? Message-ID: Hello everyone, I follow the http://blogs.msdn.com/b/saveen r/archive/2008/11/14/consuming-extension-methods-in-ironpython.aspx but I did not find the ExtensionType in Microsoft.Scripting.dll in ironpython fold. It seems the ExtensionType is missing in the ironpython2.7.1, right? I have to use the Extension method like "extension_method(obj,args)",although I am OK with the style of writing. Regards, Liu Zhenhai -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Mon Jan 9 16:49:50 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 9 Jan 2012 07:49:50 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/8/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] xml.dom.minidom.parse not working in ironpython 2.7 2. [New comment] zlib fails to compress an empty string 3. [New comment] zlib fails to compress an empty string ---------------------------------------------- ISSUES 1. [New issue] xml.dom.minidom.parse not working in ironpython 2.7 http://ironpython.codeplex.com/workitem/32049 User MarioVilas has proposed the issue: "This seems to be happening with any XML file I try to parse with minidom, I don't think it depends on the file contents at all. IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239 Type "help", "copyright", "credits" or "license" for more information. >>> import xml.dom.minidom >>> dom=xml.dom.minidom.parse('example.xml') Traceback (most recent call last): File "", line 1, in File "C:\Program Files (x86)\IronPython 2.7.1\Lib\xml\dom\minidom.py", line 19 12, in parse ImportError: cannot import expatbuilder from xml.dom >>>"----------------- 2. [New comment] zlib fails to compress an empty string http://ironpython.codeplex.com/workitem/31976 User MarioVilas has commented on the issue: "I believe that's the "zipfile" module, not "zlib" which has little to do with zip files."----------------- 3. [New comment] zlib fails to compress an empty string http://ironpython.codeplex.com/workitem/31976 User slide_o_mix has commented on the issue: "Zipfile uses zlib internally and the same code works file on cpython." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue Jan 10 00:25:01 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 9 Jan 2012 15:25:01 -0800 Subject: [Ironpython-users] How to use extension type with C# Extension Methods? In-Reply-To: References: Message-ID: The way to do it in 2.7 is to use e.g. clr.ImportExtensions(System.Linq). I'm not sure this is documented anywhere. - Jeff On Mon, Jan 9, 2012 at 12:58 AM, ??? <1989lzhh at gmail.com> wrote: > Hello everyone, > > I follow > the?http://blogs.msdn.com/b/saveenr/archive/2008/11/14/consuming-extension-methods-in-ironpython.aspx > but I did not find the?ExtensionType in Microsoft.Scripting.dll in > ironpython fold. > It seems the?ExtensionType?is missing in the ironpython2.7.1, right? > I have to use the?Extension method like > "extension_method(obj,args)",although I am OK with the style of writing. > > Regards, > Liu Zhenhai > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From dinov at microsoft.com Tue Jan 10 01:19:11 2012 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 10 Jan 2012 00:19:11 +0000 Subject: [Ironpython-users] How to use extension type with C# Extension Methods? In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E4CCBC839@TK5EX14MBXC292.redmond.corp.microsoft.com> Also ExtensionType is actually called ExtensionTypeAttribute (C# lets you drop the Attribute suffix when using an attribute). But the type moved from Microsoft.Scripting.dll into Microsoft.Dynamic.dll when we were isolating the hosting APIs. So if you'd prefer to use the old way you still can. -----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: Monday, January 09, 2012 3:25 PM To: ??? Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] How to use extension type with C# Extension Methods? The way to do it in 2.7 is to use e.g. clr.ImportExtensions(System.Linq). I'm not sure this is documented anywhere. - Jeff On Mon, Jan 9, 2012 at 12:58 AM, ??? <1989lzhh at gmail.com> wrote: > Hello everyone, > > I follow > the? > http://blogs.msdn.com/b/saveenr/archive/2008/11/14/consuming-extension > -methods-in-ironpython.aspx but I did not find the?ExtensionType in > Microsoft.Scripting.dll in ironpython fold. > It seems the?ExtensionType?is missing in the ironpython2.7.1, right? > I have to use the?Extension method like > "extension_method(obj,args)",although I am OK with the style of writing. > > Regards, > Liu Zhenhai > > > _______________________________________________ > 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 jschementi at gmail.com Tue Jan 10 01:37:21 2012 From: jschementi at gmail.com (Jimmy Schementi) Date: Mon, 9 Jan 2012 19:37:21 -0500 Subject: [Ironpython-users] How to use extension type with C# Extension Methods? In-Reply-To: References: Message-ID: <80145FC0-0C39-413C-8366-C81625A5AF4F@gmail.com> On Jan 9, 2012, at 6:25 PM, Jeff Hardy wrote: > I'm not sure this is documented anywhere. It is documented, but the documentation is wrong =) From http://ironpython.net/documentation/dotnet/dotnet.html#extension-methods: Extension methods are currently not natively supported by IronPython. Hence, they cannot be invoked like instance methods. Instead, they have to be invoked like static methods. If anyone wants to correct this, feel free to update the documentation and send a pull request: https://github.com/IronLanguages/main/blob/master/Languages/IronPython/Public/Doc/dotnet-integration.rst ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1989lzhh at gmail.com Tue Jan 10 13:38:31 2012 From: 1989lzhh at gmail.com (=?GB2312?B?wfXV8bqj?=) Date: Tue, 10 Jan 2012 20:38:31 +0800 Subject: [Ironpython-users] How to use extension type with C# Extension Methods? In-Reply-To: References: Message-ID: Hi, I just try the clr.ImportExtensions(#namespace),It worked Now I can use the DynamicDataDisplay to plot graph in IronPython as convenient as C#. Thanks IronPython Team for providing such amazing product. Regards, Liu Zhenhai 2012/1/10 Jeff Hardy > The way to do it in 2.7 is to use e.g. clr.ImportExtensions(System.Linq). > > I'm not sure this is documented anywhere. > > - Jeff > > On Mon, Jan 9, 2012 at 12:58 AM, ??? <1989lzhh at gmail.com> wrote: > > Hello everyone, > > > > I follow > > the > http://blogs.msdn.com/b/saveenr/archive/2008/11/14/consuming-extension-methods-in-ironpython.aspx > > but I did not find the ExtensionType in Microsoft.Scripting.dll in > > ironpython fold. > > It seems the ExtensionType is missing in the ironpython2.7.1, right? > > I have to use the Extension method like > > "extension_method(obj,args)",although I am OK with the style of writing. > > > > Regards, > > Liu Zhenhai > > > > > > _______________________________________________ > > Ironpython-users mailing list > > Ironpython-users at python.org > > http://mail.python.org/mailman/listinfo/ironpython-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Wed Jan 11 09:51:12 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 11 Jan 2012 00:51:12 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/10/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] ctypes: Compatibility issue with CPython 2. [New comment] xml.dom.minidom.parse not working in ironpython 2.7 3. [Status update] AttributeError: 'file' object has no attribute 'readinto',but Cpython has this attribute. 4. [New comment] ctypes.c_uint32 fails with TypeError when overflowed 5. [New comment] Automatic CLR method overload picking logic needs to be revisited. ---------------------------------------------- ISSUES 1. [New comment] ctypes: Compatibility issue with CPython http://ironpython.codeplex.com/workitem/32048 User MarioVilas has commented on the issue: "As a side note, I tried working around this by changing all calls to "byref" to "pointer" instead. No more Python exceptions :) but the example above still didn't work. The API call would fail and the error message indicated the structure pointer was wrong. I fixed it by changing LPVOID (an alias to c_void_p) to POINTER(OSVERSIONINFOEXA), so I didn't dig deeper into it, but there may be an additional bug related to using void pointers in "argtypes"."----------------- 2. [New comment] xml.dom.minidom.parse not working in ironpython 2.7 http://ironpython.codeplex.com/workitem/32049 User slide_o_mix has commented on the issue: "Currently the pyexpat module is not implemented for IronPython, there is an implementation of pyexpact for FePy that can be found at fepy.sf.net. I am in the process of implementing this module natively in IronPython."----------------- 3. [Status update] AttributeError: 'file' object has no attribute 'readinto',but Cpython has this attribute. http://ironpython.codeplex.com/workitem/23801 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Fixed"----------------- 4. [New comment] ctypes.c_uint32 fails with TypeError when overflowed http://ironpython.codeplex.com/workitem/30390 User slide_o_mix has commented on the issue: "This is happening (at least the first case) because BigInt.AsUint32 checks if the value is <= UInt32.MaxValue, which 2**32 is not, so it returns false. What needs to happen is the value needs to be sheared to 0 in this case."----------------- 5. [New comment] Automatic CLR method overload picking logic needs to be revisited. http://ironpython.codeplex.com/workitem/25859 User JeffreySax has commented on the issue: "Here's another issue involving overload resolution. Consider the following C# code: public class A { public virtual void DoSomething(A a) { Console.WriteLine("From A using A"); } public virtual void DoSomething(B b) { Console.WriteLine("From A using B"); } } public class B : A { public override void DoSomething(A a) { Console.WriteLine("From B using A"); } } >>> x = A() >>> y = B() >>> x.DoSomething(y) From A using B >>> x.DoSomething(x) From A using A >>> y.DoSomething(x) From B using A >>> y.DoSomething(y) Traceback (most recent call last): File "", line 1, in TypeError: Multiple targets could match: DoSomething(A), DoSomething(B) There should be no ambiguity here since y is of type B, and so the second overload should be preferred (no implicit conversion needed). The same sequence of calls from C# gives (correctly): From A using A From A using B From B using A From A using B " ---------------------------------------------- ---------------------------------------------- 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 alanscottmacdonald at gmail.com Thu Jan 12 10:33:38 2012 From: alanscottmacdonald at gmail.com (Alan Macdonald) Date: Thu, 12 Jan 2012 09:33:38 +0000 Subject: [Ironpython-users] SerializationException from IronPython.Runtime.Types.PythonType Message-ID: Hello, I am experiencing an exception when tracing and would appreciate some guidance. I am hosting IronPython 2.7.1 in a .Net 4 C# host. The host creates a new app domain to run IronPython scripts in. At the moment due to some security exceptions I've given the new app domain unrestricted permissions (I will try and reduce this later). When the python script is executed it runs via an asynchronous delegate and when complete catches any exceptions during the running of the script. This was all working fine and if the python script has an error in it then the exception is caught in the async callback method. However I have since added tracing via a call to ScriptEngine.SetTrace(myDelegate) so I can allow stepping through the script one line at a time (based on http://devhawk.net/tag/debugger/). When the script has no errors it executes fine with tracing enabled or disabled. However if the script has an error in it and tracing is enabled then trying to catch and format the exception in the async delegate callback causes a SerializationException on IronPython.Runtime.Types.PythonType. When tracing is not enabled the exception is caught and formatted successfully. I tried to disable tracing in the catch block before formatting the exception but this makes no difference. I understand that this is related to sending the exception information from one app domain to another but I'm not sure what I can do to get round it and what extra information it is trying to send when tracing is enabled. My tracing delegate does nothing with exceptions. Code that creates the new app domain and starts the async call to execute the method for the object in the new app domain: public void Run() { if (newDomainInstance == null) NewAppDomain(); Execute method = newDomainInstance.ExecuteCode; method.BeginInvoke(RunComplete, method); } The async callback is the following code: private void RunComplete(IAsyncResult cookie) { Complete = true; Execute method = (Execute)cookie.AsyncState; try { method.EndInvoke(cookie); OnExecutionSuccess(); } catch (AppDomainUnloadedException adue) { //Do nothing because we've deliberately pulled the app domain out from under it. } catch (Exception ex) { engine.Value.SetTrace(null); String extractedMessage = engine.Value.GetService().FormatException(ex); OnExecutionError(new Exception(extractedMessage)); } } The exception occurs on String extractedMessage = engine.Value.GetService().FormatException(ex); Exception stacktrace: System.Runtime.Serialization.SerializationException was unhandled Message=Type 'IronPython.Runtime.Types.PythonType' in Assembly 'IronPython, Version=2.7.0.40, Culture=neutral, PublicKeyToken=7f709c5b713576e1' is not marked as serializable. Source=mscorlib StackTrace: Server stack trace: at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage mrm) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage msg) at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm) at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args) Exception rethrown at [0]: at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args) at System.Runtime.Remoting.Messaging.AsyncReplySink.SyncProcessMessage(IMessage reqMsg) at System.Runtime.Remoting.Channels.ADAsyncWorkItem.FinishAsyncWork(Object stateIgnored) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() InnerException: Any help would be appreciated. If it helps I can show more code or if anything is unclear please let me know. I didn't want to make it too long and include unneccessary details. Thanks for your time. Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Jan 12 11:32:51 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 12 Jan 2012 02:32:51 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/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] System.Collections.Generic.HashSet Missing 2. [New comment] System.Collections.Generic.HashSet Missing 3. [New comment] System.Collections.Generic.HashSet Missing 4. [Status update] (please cancel) System.Collections.Generic.HashSet Missing 5. [New comment] (please cancel) System.Collections.Generic.HashSet Missing ---------------------------------------------- ISSUES 1. [New issue] System.Collections.Generic.HashSet Missing http://ironpython.codeplex.com/workitem/32066 User rfrizzel has proposed the issue: "I apologize if this is an obvious question, and feel free to cancel this issue and put me in my place, but I cannot import HashSet from System.Collections.Generic. SortedSet is there and that was introduced in .NET 4.0 as a more complex HashSet, but no HashSet. Again, if I'm missing an import I do apologize in advance. Here's the session: IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239 Type "help", "copyright", "credits" or "license" for more information. >>> import System >>> import System.Collections >>> import System.Collections.Generic >>> dir(System.Collections.Generic) ['Comparer', 'Dictionary', 'EqualityComparer', 'ICollection', 'IComparer', 'IDictionary', 'IEnumerable', 'IEnumerator', 'IEqualityComparer', 'IList', 'ISet', 'KeyNotFoundException', 'KeyValuePair', 'LinkedList', 'LinkedListNode', 'List', 'Queue', 'SortedDictionary', 'SortedList', 'SortedSet', 'Stack']"----------------- 2. [New comment] System.Collections.Generic.HashSet Missing http://ironpython.codeplex.com/workitem/32066 User slide_o_mix has commented on the issue: "HashSet is in System.Core.dll, did you try adding a reference to System.Core.dll?"----------------- 3. [New comment] System.Collections.Generic.HashSet Missing http://ironpython.codeplex.com/workitem/32066 User rfrizzel has commented on the issue: "...and that was what I was missing. Many thanks for answering my question and I apologize if this was not the right forum for it."----------------- 4. [Status update] (please cancel) System.Collections.Generic.HashSet Missing http://ironpython.codeplex.com/workitem/32066 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "Not a bug."----------------- 5. [New comment] (please cancel) System.Collections.Generic.HashSet Missing http://ironpython.codeplex.com/workitem/32066 User slide_o_mix has commented on the issue: "FYI, there is a mailing list here: http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Jan 12 19:35:18 2012 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 12 Jan 2012 18:35:18 +0000 Subject: [Ironpython-users] SerializationException from IronPython.Runtime.Types.PythonType In-Reply-To: References: Message-ID: <6C7ABA8B4E309440B857D74348836F2E4CCC1F7D@TK5EX14MBXC292.redmond.corp.microsoft.com> Are you creating the tracing delegate in the remote app domain? You should be able to create a class which derives from MarshalByRefObject and then create an instance of that object in the remote domain. You can then call a method on that MBRO which does the ScriptEngine.SetTrace() call (you can safely pass the script engine instance across when you create the MBRO). If you want to marshal the results back to your main app domain you can also create an MBRO in your local domain that you pass through when you construct the remote MBRO and then you can call some method which passes strings instead of unmarshallable objects. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Alan Macdonald Sent: Thursday, January 12, 2012 1:34 AM To: ironpython-users at python.org Subject: [Ironpython-users] SerializationException from IronPython.Runtime.Types.PythonType Hello, I am experiencing an exception when tracing and would appreciate some guidance. I am hosting IronPython 2.7.1 in a .Net 4 C# host. The host creates a new app domain to run IronPython scripts in. At the moment due to some security exceptions I've given the new app domain unrestricted permissions (I will try and reduce this later). When the python script is executed it runs via an asynchronous delegate and when complete catches any exceptions during the running of the script. This was all working fine and if the python script has an error in it then the exception is caught in the async callback method. However I have since added tracing via a call to ScriptEngine.SetTrace(myDelegate) so I can allow stepping through the script one line at a time (based on http://devhawk.net/tag/debugger/). When the script has no errors it executes fine with tracing enabled or disabled. However if the script has an error in it and tracing is enabled then trying to catch and format the exception in the async delegate callback causes a SerializationException on IronPython.Runtime.Types.PythonType. When tracing is not enabled the exception is caught and formatted successfully. I tried to disable tracing in the catch block before formatting the exception but this makes no difference. I understand that this is related to sending the exception information from one app domain to another but I'm not sure what I can do to get round it and what extra information it is trying to send when tracing is enabled. My tracing delegate does nothing with exceptions. Code that creates the new app domain and starts the async call to execute the method for the object in the new app domain: public void Run() { if (newDomainInstance == null) NewAppDomain(); Execute method = newDomainInstance.ExecuteCode; method.BeginInvoke(RunComplete, method); } The async callback is the following code: private void RunComplete(IAsyncResult cookie) { Complete = true; Execute method = (Execute)cookie.AsyncState; try { method.EndInvoke(cookie); OnExecutionSuccess(); } catch (AppDomainUnloadedException adue) { //Do nothing because we've deliberately pulled the app domain out from under it. } catch (Exception ex) { engine.Value.SetTrace(null); String extractedMessage = engine.Value.GetService().FormatException(ex); OnExecutionError(new Exception(extractedMessage)); } } The exception occurs on String extractedMessage = engine.Value.GetService().FormatException(ex); Exception stacktrace: System.Runtime.Serialization.SerializationException was unhandled Message=Type 'IronPython.Runtime.Types.PythonType' in Assembly 'IronPython, Version=2.7.0.40, Culture=neutral, PublicKeyToken=7f709c5b713576e1' is not marked as serializable. Source=mscorlib StackTrace: Server stack trace: at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage mrm) at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage msg) at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm) at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args) Exception rethrown at [0]: at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args) at System.Runtime.Remoting.Messaging.AsyncReplySink.SyncProcessMessage(IMessage reqMsg) at System.Runtime.Remoting.Channels.ADAsyncWorkItem.FinishAsyncWork(Object stateIgnored) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() InnerException: Any help would be appreciated. If it helps I can show more code or if anything is unclear please let me know. I didn't want to make it too long and include unneccessary details. Thanks for your time. Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From alanscottmacdonald at gmail.com Fri Jan 13 09:37:45 2012 From: alanscottmacdonald at gmail.com (Alan Macdonald) Date: Fri, 13 Jan 2012 08:37:45 +0000 Subject: [Ironpython-users] SerializationException from IronPython.Runtime.Types.PythonType In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E4CCC1F7D@TK5EX14MBXC292.redmond.corp.microsoft.com> References: <6C7ABA8B4E309440B857D74348836F2E4CCC1F7D@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: Dino, Thanks for the response. I understand what you are saying. I have also realised that at the moment because I catch the exception and instantiate a new Exception using the formatted information string (so that calling code need know nothing about ScriptEngine formatting services). I can move that try catch into the actual execution method in the remote domain and then rethrow the formatted exception which is essentially string based. That works for now, but I'm not sure it's a very good approach. Changing unmarshallable objects into strings would essentially be I guess, a similar compromise. Thanks for your time and input. Alan On 12 January 2012 18:35, Dino Viehland wrote: > Are you creating the tracing delegate in the remote app domain? You > should be able to create a class which derives from MarshalByRefObject and > then create an instance of that object in the remote domain. You can then > call a method on that MBRO which does the ScriptEngine.SetTrace() call (you > can safely pass the script engine instance across when you create the > MBRO). If you want to marshal the results back to your main app domain you > can also create an MBRO in your local domain that you pass through when you > construct the remote MBRO and then you can call some method which passes > strings instead of unmarshallable objects.**** > > ** ** > > *From:* ironpython-users-bounces+dinov=microsoft.com at python.org [mailto: > ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Alan > Macdonald > *Sent:* Thursday, January 12, 2012 1:34 AM > *To:* ironpython-users at python.org > *Subject:* [Ironpython-users] SerializationException from > IronPython.Runtime.Types.PythonType**** > > ** ** > > Hello, > > I am experiencing an exception when tracing and would appreciate some > guidance. > > I am hosting IronPython 2.7.1 in a .Net 4 C# host. The host creates a new > app domain to run IronPython scripts in. At the moment due to some > security exceptions I've given the new app domain unrestricted permissions > (I will try and reduce this later). When the python script is executed it > runs via an asynchronous delegate and when complete catches any exceptions > during the running of the script. This was all working fine and if the > python script has an error in it then the exception is caught in the async > callback method. > > However I have since added tracing via a call to > ScriptEngine.SetTrace(myDelegate) so I can allow stepping through the > script one line at a time (based on http://devhawk.net/tag/debugger/). > When the script has no errors it executes fine with tracing enabled or > disabled. However if the script has an error in it and tracing is enabled > then trying to catch and format the exception in the async delegate > callback causes a SerializationException on > IronPython.Runtime.Types.PythonType. When tracing is not enabled the > exception is caught and formatted successfully. > > I tried to disable tracing in the catch block before formatting the > exception but this makes no difference. I understand that this is related > to sending the exception information from one app domain to another but I'm > not sure what I can do to get round it and what extra information it is > trying to send when tracing is enabled. My tracing delegate does nothing > with exceptions. > > Code that creates the new app domain and starts the async call to execute > the method for the object in the new app domain: > public void Run() > { > if (newDomainInstance == null) > NewAppDomain(); > > Execute method = newDomainInstance.ExecuteCode; > method.BeginInvoke(RunComplete, method); > > } > > > The async callback is the following code: > > private void RunComplete(IAsyncResult cookie) > { > Complete = true; > > Execute method = (Execute)cookie.AsyncState; > > > try > { > method.EndInvoke(cookie); > OnExecutionSuccess(); > } > catch (AppDomainUnloadedException adue) > { > //Do nothing because we've deliberately pulled the app > domain out from under it. > } > catch (Exception ex) > { > engine.Value.SetTrace(null); > String extractedMessage = > engine.Value.GetService().FormatException(ex); > OnExecutionError(new Exception(extractedMessage)); > } > > } > > The exception occurs on String extractedMessage = > engine.Value.GetService().FormatException(ex); > > Exception stacktrace: > System.Runtime.Serialization.SerializationException was unhandled > Message=Type 'IronPython.Runtime.Types.PythonType' in Assembly > 'IronPython, Version=2.7.0.40, Culture=neutral, > PublicKeyToken=7f709c5b713576e1' is not marked as serializable. > Source=mscorlib > StackTrace: > Server stack trace: > at > System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType > type) > at > System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type > type, StreamingContext context) > at > System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() > at > System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object > obj, ISurrogateSelector surrogateSelector, StreamingContext context, > SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, > ObjectWriter objectWriter, SerializationBinder binder) > at > System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo > objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) > at > System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object > graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) > at > System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream > serializationStream, Object graph, Header[] headers, Boolean fCheck) > at > System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList > argsToSerialize) > at > System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage > mrm) > at > System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage > msg) > at > System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] > reqStmBuff, SmuggledMethodCallMessage smuggledMcm, > SmuggledMethodReturnMessage& smuggledMrm) > at > System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] > args) > Exception rethrown at [0]: > at System.Threading.Thread.InternalCrossContextCallback(Context > ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate > ftnToCall, Object[] args) > at > System.Runtime.Remoting.Messaging.AsyncReplySink.SyncProcessMessage(IMessage > reqMsg) > at > System.Runtime.Remoting.Channels.ADAsyncWorkItem.FinishAsyncWork(Object > stateIgnored) > at > System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object > state) > at System.Threading.ExecutionContext.Run(ExecutionContext > executionContext, ContextCallback callback, Object state, Boolean > ignoreSyncCtx) > at > System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() > at System.Threading.ThreadPoolWorkQueue.Dispatch() > at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() > InnerException: > > > Any help would be appreciated. If it helps I can show more code or if > anything is unclear please let me know. I didn't want to make it too long > and include unneccessary details. > > Thanks for your time. > > Alan > > **** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Jan 13 12:29:55 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 13 Jan 2012 03:29:55 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/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] (please cancel) System.Collections.Generic.HashSet Missing 2. [New issue] Add StackOverflow to website support page ---------------------------------------------- ISSUES 1. [New comment] (please cancel) System.Collections.Generic.HashSet Missing http://ironpython.codeplex.com/workitem/32066 User jdhardy has commented on the issue: "StackOverflow is a good option as well."----------------- 2. [New issue] Add StackOverflow to website support page http://ironpython.codeplex.com/workitem/32070 User jdhardy has proposed the issue: "Add a link to StackOverflow on the website support page." ---------------------------------------------- ---------------------------------------------- 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 hfoffani at gmail.com Fri Jan 13 13:13:59 2012 From: hfoffani at gmail.com (=?iso-8859-1?Q?Hern=E1n_Foffani?=) Date: Fri, 13 Jan 2012 13:13:59 +0100 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? Message-ID: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> Hi, While trying the logging module, I've found this: IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import logging >>> import logging.handlers >>> logging.getLogger().addHandler(logging.handlers.NTEventLogHandler("MyApp")) The Python Win32 extensions for NT (service, event logging) appear not to be available. >>> This handler uses Hammond's win32 dlls. Are there any .NET equivalent class? An IP implementation might take less than a dozen of lines, I'd guess. What's the best practice when overriding Python std lib? Regards, -H. From dinov at microsoft.com Fri Jan 13 18:24:51 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 13 Jan 2012 17:24:51 +0000 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> Message-ID: <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> There's the EventLog class [http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog(v=vs.71).aspx] which you can get at using: from System.Diagnostics import EventLog I would think you could make your own NTEventLogHandler which wraps this, you could probably contribute it back to the std lib under an if sys.platform == 'cli': so that on IronPython you get the .NET NTEventLogHandler. > -----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 Hern?n Foffani > Sent: Friday, January 13, 2012 4:14 AM > To: ironpython-users at python.org > Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? > > Hi, > While trying the logging module, I've found this: > > IronPython 2.7.1 (2.7.0.40) on .NET 4.0.30319.239 > Type "help", "copyright", "credits" or "license" for more information. > >>> > >>> import logging > >>> import logging.handlers > >>> > logging.getLogger().addHandler(logging.handlers.NTEventLogHandler("MyApp" > )) > The Python Win32 extensions for NT (service, event logging) appear not > to be available. > >>> > > This handler uses Hammond's win32 dlls. Are there any .NET equivalent class? > An IP implementation might take less than a dozen of lines, I'd guess. What's > the best practice when overriding Python std lib? > > Regards, > -H. > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From jdhardy at gmail.com Fri Jan 13 18:49:13 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 13 Jan 2012 09:49:13 -0800 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: On Fri, Jan 13, 2012 at 9:24 AM, Dino Viehland wrote: > I would think you could make your own NTEventLogHandler which wraps this, > you could probably contribute it back to the std lib under an if sys.platform == 'cli': > so that on IronPython you get the .NET NTEventLogHandler. At the very list it could go into IronPython's stdlib. Until we can sync up with the 3.x branch I Don't know if we can push stdlib changes upstream. - Jeff From jdhardy at gmail.com Fri Jan 13 19:05:29 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 13 Jan 2012 10:05:29 -0800 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: <3677772E-63D8-450E-9C36-9345838FA3E3@gmail.com> References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> <3677772E-63D8-450E-9C36-9345838FA3E3@gmail.com> Message-ID: On Fri, Jan 13, 2012 at 9:54 AM, Hern?n Foffani wrote: > > El 13/01/2012, a las 18:49, Jeff Hardy escribi?: > >> On Fri, Jan 13, 2012 at 9:24 AM, Dino Viehland wrote: >>> I would think you could make your own NTEventLogHandler which wraps this, >>> you could probably contribute it back to the std lib under an if sys.platform == 'cli': >>> so that on IronPython you get the .NET NTEventLogHandler. >> >> At the very list it could go into IronPython's stdlib. Until we can >> sync up with the 3.x branch I Don't know if we can push stdlib changes >> upstream. > > Beware that the file that contains the NTEventLogHandler has some several more > classes. Won't it add some hassle to merge future std lib changes back to IP? > We already have a bunch of changes like it. Any extra hassle it adds is minuscule compared to the giant pain in the butt it already is (hence why it's not done very often). For the 3.x branch I want to push as many changes as possible upstream to minimize that. - Jeff From hfoffani at gmail.com Fri Jan 13 19:27:17 2012 From: hfoffani at gmail.com (=?iso-8859-1?Q?Hern=E1n_Foffani?=) Date: Fri, 13 Jan 2012 19:27:17 +0100 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> <3677772E-63D8-450E-9C36-9345838FA3E3@gmail.com> Message-ID: <0DBF3E04-2141-48A7-83D3-9D81F418CAA7@gmail.com> El 13/01/2012, a las 19:05, Jeff Hardy escribi?: > On Fri, Jan 13, 2012 at 9:54 AM, Hern?n Foffani wrote: >> >> El 13/01/2012, a las 18:49, Jeff Hardy escribi?: >> >>> On Fri, Jan 13, 2012 at 9:24 AM, Dino Viehland wrote: >>>> I would think you could make your own NTEventLogHandler which wraps this, >>>> you could probably contribute it back to the std lib under an if sys.platform == 'cli': >>>> so that on IronPython you get the .NET NTEventLogHandler. >>> >>> At the very list it could go into IronPython's stdlib. Until we can >>> sync up with the 3.x branch I Don't know if we can push stdlib changes >>> upstream. >> >> Beware that the file that contains the NTEventLogHandler has some several more >> classes. Won't it add some hassle to merge future std lib changes back to IP? >> > > We already have a bunch of changes like it. Any extra hassle it adds > is minuscule compared to the giant pain in the butt it already is > (hence why it's not done very often). > > For the 3.x branch I want to push as many changes as possible upstream > to minimize that. In that case I can provide a patch if you like. (Sorry for the personal replies, didn't pay attention to the addressee in my previous follow ups) From dblank at cs.brynmawr.edu Fri Jan 13 19:19:37 2012 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Fri, 13 Jan 2012 13:19:37 -0500 (EST) Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> <3677772E-63D8-450E-9C36-9345838FA3E3@gmail.com> Message-ID: <57722.76.98.34.255.1326478777.squirrel@webmail.cs.brynmawr.edu> > On Fri, Jan 13, 2012 at 9:54 AM, Hern?n Foffani > wrote: >> >> El 13/01/2012, a las 18:49, Jeff Hardy escribi?: >> >>> On Fri, Jan 13, 2012 at 9:24 AM, Dino Viehland >>> wrote: >>>> I would think you could make your own NTEventLogHandler which wraps >>>> this, >>>> you could probably contribute it back to the std lib under an if >>>> sys.platform == 'cli': >>>> so that on IronPython you get the .NET NTEventLogHandler. >>> >>> At the very list it could go into IronPython's stdlib. Until we can >>> sync up with the 3.x branch I Don't know if we can push stdlib changes >>> upstream. >> >> Beware that the file that contains the NTEventLogHandler has some >> several more >> classes. Won't it add some hassle to merge future std lib changes back >> to IP? >> > > We already have a bunch of changes like it. Any extra hassle it adds > is minuscule compared to the giant pain in the butt it already is > (hence why it's not done very often). > > For the 3.x branch I want to push as many changes as possible upstream > to minimize that. > > - Jeff Speaking of IronPython's use of the standard Python Library, how does one go from IronPython source to an installation with Lib set up properly? I see that there are parts of the standard lib in github... a couple actually: some under External.LCS_RESTRICTED and another in Languages. Is the standard IP lib documented somewhere? Thanks, -Doug -- Douglas S. Blank Associate Professor, Computer Science, Bryn Mawr College http://cs.brynmawr.edu/~dblank (610)526-6501 From jdhardy at gmail.com Fri Jan 13 20:38:12 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 13 Jan 2012 11:38:12 -0800 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: <6C7ABA8B4E309440B857D74348836F2E528A1820@TK5EX14MBXC292.redmond.corp.microsoft.com> References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> <3677772E-63D8-450E-9C36-9345838FA3E3@gmail.com> <57722.76.98.34.255.1326478777.squirrel@webmail.cs.brynmawr.edu> <6C7ABA8B4E309440B857D74348836F2E528A1820@TK5EX14MBXC292.redmond.corp.microsoft.com> Message-ID: On Fri, Jan 13, 2012 at 11:24 AM, Dino Viehland wrote: > Douglas wrote: >> Speaking of IronPython's use of the standard Python Library, how does one go >> from IronPython source to an installation with Lib set up properly? >> >> I see that there are parts of the standard lib in github... a couple >> actually: some under External.LCS_RESTRICTED and another in Languages. Is >> the standard IP lib documented somewhere? > > I'm not sure if this has changed at all, but the std lib did indeed used to live in the > External.LCA_RESTRICTED folder. ?The IronPython\27 one is the version that we > ship w/ Ipy. ?It's also the one which contains the tests that we run against including > some tests which are disabled. ?The CPython\27 one is the baseline unmodified CPython > stdlib and is there to make it easy to do a 3-way merge when updating the standard > library. Yes, that's still the case. I'd like to move when bringing the 3.x library in (to Languages/IronPython/StdLib) but haven't got around to it. > > When generating the MSI the standard library is generated into the Wix using > IronPython\StdLib\StdLib.pyproj but for development purposes you can just set IRONPYTHONPATH > To External.LCA_RESTRICTED\IronPython27\Lib or xcopy the std lib next to > CPython. ?The pyproj only needs to be updated when adding / removing files. You can also get it by running msbuild /t:Stage in the root of the checkout, and then looking in Stage\IronPython-2.7.2a0. That's what the zip packages are built from. - Jeff From dinov at microsoft.com Fri Jan 13 20:24:28 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 13 Jan 2012 19:24:28 +0000 Subject: [Ironpython-users] logging.handlers.NTEventLogHandler not in IP? In-Reply-To: <57722.76.98.34.255.1326478777.squirrel@webmail.cs.brynmawr.edu> References: <2CA6D2ED-0327-4BDF-A7AB-7872D5604FC6@gmail.com> <6C7ABA8B4E309440B857D74348836F2E5289F395@TK5EX14MBXC292.redmond.corp.microsoft.com> <3677772E-63D8-450E-9C36-9345838FA3E3@gmail.com> <57722.76.98.34.255.1326478777.squirrel@webmail.cs.brynmawr.edu> Message-ID: <6C7ABA8B4E309440B857D74348836F2E528A1820@TK5EX14MBXC292.redmond.corp.microsoft.com> Douglas wrote: > Speaking of IronPython's use of the standard Python Library, how does one go > from IronPython source to an installation with Lib set up properly? > > I see that there are parts of the standard lib in github... a couple > actually: some under External.LCS_RESTRICTED and another in Languages. Is > the standard IP lib documented somewhere? I'm not sure if this has changed at all, but the std lib did indeed used to live in the External.LCA_RESTRICTED folder. The IronPython\27 one is the version that we ship w/ Ipy. It's also the one which contains the tests that we run against including some tests which are disabled. The CPython\27 one is the baseline unmodified CPython stdlib and is there to make it easy to do a 3-way merge when updating the standard library. When generating the MSI the standard library is generated into the Wix using IronPython\StdLib\StdLib.pyproj but for development purposes you can just set IRONPYTHONPATH To External.LCA_RESTRICTED\IronPython27\Lib or xcopy the std lib next to CPython. The pyproj only needs to be updated when adding / removing files. From jimp02 at email.com Mon Jan 23 00:50:15 2012 From: jimp02 at email.com (Jim Pattee) Date: Sun, 22 Jan 2012 18:50:15 -0500 Subject: [Ironpython-users] Memory Allocation in Iron Python Message-ID: <20120122235015.284470@gmx.com> I am trying to allocate memory in Iron Python to receive text from a DLL. The allocated memory address is passed to the DLL and the text is copied by the DLL into the memory area. The following code, which works in CPython, is used: allocated =[] def MemoryAllocation(size): arr_type = c_char * size# create a c_char array arr_obj = arr_type()# create an array object allocated.append(arr_obj)# so the object will not be destroyed if len(allocated)> 1:# free memory for the previous object del allocated[0] return addressof(arr_obj)# return a pointer When this is used for Iron Python it results in: ?Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.? The error results when the memory is copied into Python by the DLL. There are no errors displayed when executing the above code. Why can it not write to the memory? What is the difference in Iron Python and CPython? -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Mon Jan 23 08:43:33 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 23 Jan 2012 07:43:33 +0000 Subject: [Ironpython-users] Memory Allocation in Iron Python In-Reply-To: <20120122235015.284470@gmx.com> References: <20120122235015.284470@gmx.com> Message-ID: <727D8E16AE957149B447FE368139F2B50D70D7B6@SERVER10> Hi, Jim, You only gave us half of the source. Which way do you pass the memory address to the native DLL? One difference is, for example, that .NET relocates objects sometimes, so they need to be pinned. 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 Jim Pattee Gesendet: Montag, 23. Januar 2012 00:50 An: ironpython-users at python.org Betreff: [Ironpython-users] Memory Allocation in Iron Python I am trying to allocate memory in Iron Python to receive text from a DLL. The allocated memory address is passed to the DLL and the text is copied by the DLL into the memory area. The following code, which works in CPython, is used: allocated = [] def MemoryAllocation(size): arr_type = c_char * size # create a c_char array arr_obj = arr_type() # create an array object allocated.append(arr_obj) # so the object will not be destroyed if len(allocated) > 1: # free memory for the previous object del allocated[0] return addressof(arr_obj) # return a pointer When this is used for Iron Python it results in: ?Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.? The error results when the memory is copied into Python by the DLL. There are no errors displayed when executing the above code. Why can it not write to the memory? What is the difference in Iron Python and CPython? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Jan 23 22:30:06 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 23 Jan 2012 13:30:06 -0800 Subject: [Ironpython-users] Memory Allocation in Iron Python In-Reply-To: <20120122235015.284470@gmx.com> References: <20120122235015.284470@gmx.com> Message-ID: There are a couple of known bugs in ctypes. Can you produce a self-contained example, perhaps using a libc on Windows API function as the target? - Jeff On Sun, Jan 22, 2012 at 3:50 PM, Jim Pattee wrote: > I am trying to allocate memory in Iron Python to receive text from a DLL. > The allocated memory address is passed to the DLL and the text is copied by > the DLL into the memory area. The following code, which works in CPython, is > used: > > allocated = [] > > def MemoryAllocation(size): > > ????? arr_type = c_char * size??? # create a c_char array > > ????? arr_obj = arr_type()??????? # create an array object > > ????? allocated.append(arr_obj)?? # so the object will not be destroyed > > ????? if len(allocated) > 1:????? # free memory for the previous object > > ??????????? del allocated[0] > > ????? return addressof(arr_obj)?? # return a pointer > > > > When this is used for Iron Python it results in: > > ?Unhandled Exception: System.AccessViolationException: Attempted to read or > write > > ?protected memory. This is often an indication that other memory is > corrupt.? > > > > The error results when the memory is copied into Python by the DLL. There > are no errors displayed when executing the above code. > > > > Why can it not write to the memory? What is the difference in Iron Python > and CPython? > > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > From dinov at microsoft.com Mon Jan 23 23:57:51 2012 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 23 Jan 2012 22:57:51 +0000 Subject: [Ironpython-users] Memory Allocation in Iron Python In-Reply-To: <727D8E16AE957149B447FE368139F2B50D70D7B6@SERVER10> References: <20120122235015.284470@gmx.com> <727D8E16AE957149B447FE368139F2B50D70D7B6@SERVER10> Message-ID: <6C7ABA8B4E309440B857D74348836F2E528E081E@TK5EX14MBXC293.redmond.corp.microsoft.com> One potential issue here could be ASCII vs Unicode strings. Depending on wherever the copy into this memory occurs it could end up copying the Unicode string into a buffer which is sized for ASCII strings. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On Behalf Of Markus Schaber Sent: Sunday, January 22, 2012 11:44 PM To: Jim Pattee; ironpython-users at python.org Subject: Re: [Ironpython-users] Memory Allocation in Iron Python Hi, Jim, You only gave us half of the source. Which way do you pass the memory address to the native DLL? One difference is, for example, that .NET relocates objects sometimes, so they need to be pinned. 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 Jim Pattee Gesendet: Montag, 23. Januar 2012 00:50 An: ironpython-users at python.org Betreff: [Ironpython-users] Memory Allocation in Iron Python I am trying to allocate memory in Iron Python to receive text from a DLL. The allocated memory address is passed to the DLL and the text is copied by the DLL into the memory area. The following code, which works in CPython, is used: allocated = [] def MemoryAllocation(size): arr_type = c_char * size # create a c_char array arr_obj = arr_type() # create an array object allocated.append(arr_obj) # so the object will not be destroyed if len(allocated) > 1: # free memory for the previous object del allocated[0] return addressof(arr_obj) # return a pointer When this is used for Iron Python it results in: ?Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.? The error results when the memory is copied into Python by the DLL. There are no errors displayed when executing the above code. Why can it not write to the memory? What is the difference in Iron Python and CPython? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimp02 at email.com Tue Jan 24 01:27:19 2012 From: jimp02 at email.com (Jim Pattee) Date: Mon, 23 Jan 2012 19:27:19 -0500 Subject: [Ironpython-users] Memory Allocation in Iron Python Message-ID: <20120124002720.284470@gmx.com> Hi, Attached is a test case for the Memory Allocation problem. One folder contains two python scripts and the astyle.dll. The other contains test data. I don?t know of any Windows API functions which work the same as astyle. A callback gets a memory allocation that is used to return text to the python program. The DLL is 32 bit. Therefore you must use the 32 bit python executable to run the script. Let me know if this is a problem and I will send a 64 bit version. There are two python scripts included. ExampleUnicode.py is the CPython script. It will work with either python version 2.7 or 3.2 (32 bit). The other, ExampleUnicode *Iron*.py, is the IronPython program. It will also work with CPython. But it doesn?t work with IronPython. I included both so you can use a diff program to see the changes. There aren?t many. I am aware of the Unicode problem with IronPython. It has been fixed and byte code is correctly being sent to the DLL. The call to astyle is at line 59 or 60 in the scripts. Text_in is sent to the dll, a python memory allocation function is called, and formatted_text is returned. Formatted_text uses the memory that was allocated by the python memory allocation function. AStyle is open source and can be obtained from http://sourceforge.net/projects/astyle/ . Let me know if you have questions. It is a fairly complicated process, but it works with CPython. And thanks for the responses. I really wasn't very optimistic about anyone understanding the problem. Jim Pattee jimp02 at email.com ----- Original Message ----- From: Dino Viehland Sent: 01/23/12 03:57 PM To: Markus Schaber, Jim Pattee, ironpython-users at python.org Subject: RE: [Ironpython-users] Memory Allocation in Iron Python One potential issue here could be ASCII vs Unicode strings. Depending on wherever the copy into this memory occurs it could end up copying the Unicode string into a buffer which is sized for ASCII strings. From: ironpython-users-bounces+dinov=microsoft.com at python.org [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] *On Behalf Of *Markus Schaber *Sent:* Sunday, January 22, 2012 11:44 PM *To:* Jim Pattee; ironpython-users at python.org *Subject:* Re: [Ironpython-users] Memory Allocation in Iron Python Hi, Jim, You only gave us half of the source. Which way do you pass the memory address to the native DLL? One difference is, for example, that .NET relocates objects sometimes, so they need to be pinned. 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 http://www.3s-software.com/ CoDeSys internet forum: http://forum.3s-software.com http://forum-en.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 %5Bmailto:ironpython-users-bounces+m.schaber=3s-software.com at python.org%5D *Im Auftrag von *Jim Pattee *Gesendet:* Montag, 23. Januar 2012 00:50 *An:* ironpython-users at python.org *Betreff:* [Ironpython-users] Memory Allocation in Iron Python I am trying to allocate memory in Iron Python to receive text from a DLL. The allocated memory address is passed to the DLL and the text is copied by the DLL into the memory area. The following code, which works in CPython, is used: allocated =[] def MemoryAllocation(size): arr_type = c_char * size # create a c_char array arr_obj = arr_type()# create an array object allocated.append(arr_obj)# so the object will not be destroyed if len(allocated)> 1: # free memory for the previous object del allocated[0] return addressof(arr_obj)# return a pointer When this is used for Iron Python it results in: ?Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.? The error results when the memory is copied into Python by the DLL. There are no errors displayed when executing the above code. Why can it not write to the memory? What is the difference in Iron Python and CPython? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PythonTest.zip Type: application/zip Size: 160824 bytes Desc: Attachment: PythonTest.zip URL: From mr.kamu at gmail.com Wed Jan 25 05:06:29 2012 From: mr.kamu at gmail.com (Kamu) Date: Wed, 25 Jan 2012 12:06:29 +0800 Subject: [Ironpython-users] COM Interop argument convert error In-Reply-To: References: Message-ID: Hi All, 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. 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? Thanks, Kamu From jdhardy at gmail.com Wed Jan 25 07:45:23 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 24 Jan 2012 22:45:23 -0800 Subject: [Ironpython-users] COM Interop argument convert error In-Reply-To: References: Message-ID: Check out http://ironpython.net/documentation/dotnet/dotnet.html#ref-and-out-parameters - IronPython treats ref/out parameters a bit differently than VBA does. - Jeff On Tue, Jan 24, 2012 at 8:06 PM, Kamu wrote: > Hi All, > > 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. 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? > > Thanks, > > Kamu > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From no_reply at codeplex.com Wed Jan 25 10:22:48 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 25 Jan 2012 01:22:48 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/24/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] KeyError exception accessing threading.currentThread() ---------------------------------------------- ISSUES 1. [New issue] KeyError exception accessing threading.currentThread() http://ironpython.codeplex.com/workitem/32125 User jamesholland has proposed the issue: "I'm using the Task Parallel Library from IronPython along with the python logging module. Sometimes an exception is thrown by the logging module when calling one of the logging methods. The exception occurs when the __init__ method of LogRecord calls threading.currentThread().name. The exception is a KeyError: File "C:\Program Files\IronPython\Lib\threading.py", line 828, in currentThread return _active[_get_ident()] KeyError: 4 Taking a look at threading.py in the Python library that line of code is wrapped by try..except KeyError, and it should create a _DummyThread object in this circumstance. How can a KeyError be thrown and not caught by a handler designed to catch it?!? I was able to reproduce this without the logging module, simply by firing up multiple tasks and having them call threading.currentThread().name. See attached file. You have to run it a number of times to see the error because it doesn't happen every time. The end result is that the logging module appears not to be threadsafe when called from the TPL. If we channel all calls to the logging module through a Monitor the problem goes away. Is this behavior explainable? Is is supposed to be this way?" ---------------------------------------------- ---------------------------------------------- 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 mr.kamu at gmail.com Wed Jan 25 15:15:59 2012 From: mr.kamu at gmail.com (Kamu) Date: Wed, 25 Jan 2012 22:15:59 +0800 Subject: [Ironpython-users] COM Interop argument convert error In-Reply-To: References: Message-ID: I did a bit of playing around and I have instead of feeding the argument a None, I fed the template argument an element that is fetched through another COM method. This has caused the call to go through with out any problems (so: the point3ds do not have to be refs). However, I really do want to pass None to the template argument. I tried the following code: template = clr.Reference[Element]() template.Value = None elem = self.ms.CreateLineElement2(template, point3d1, point3d2) ------- No change. Still the same "cannot convert argument 2" error. I even see that I cannot create an Element object at all: TypeError: Cannot create instances of Element because it is abstract Turns out that straight after the 1st line template is None due to being unable to initialise the ref or some such. I'm lost. In the Microstation VBA doc examples they dimension variables to the type Element all the time. Even still, all I really want to do at the time being is pass None as the template. How do I go about doing this? On Wed, Jan 25, 2012 at 2:45 PM, Jeff Hardy wrote: > Check out http://ironpython.net/documentation/dotnet/dotnet.html#ref-and-out-parameters > - IronPython treats ref/out parameters a bit differently than VBA > does. > > - Jeff > > On Tue, Jan 24, 2012 at 8:06 PM, Kamu wrote: >> Hi All, >> >> 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. 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? >> >> Thanks, >> >> Kamu >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users From jdhardy at gmail.com Wed Jan 25 17:22:03 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 25 Jan 2012 08:22:03 -0800 Subject: [Ironpython-users] Extension Methods (was: COM Interop argument convert error) In-Reply-To: <727D8E16AE957149B447FE368139F2B50D70E5F4@SERVER10> References: <727D8E16AE957149B447FE368139F2B50D70E5F4@SERVER10> Message-ID: On Tue, Jan 24, 2012 at 11:44 PM, Markus Schaber wrote: > Hi, > > Von: von Jeff Hardy > >> Check out http://ironpython.net/documentation/dotnet/dotnet.html#ref-and-out-parameters > - IronPython treats ref/out parameters a bit differently than VBA does. > > Just in the paragraph below the ref and out parameters, it says "Extension methods are currently not natively supported". AFAIR, this has changed with current IronPython releases. Should the documentation be updated`? Yes, it should. I noticed that a couple of weeks back but haven't had a chance to fix it. The file is Languages/IronPython/Public/Doc/dotnet-integration.rst, if anyone wants to take a crack at it. - Jeff From dinov at microsoft.com Thu Jan 26 18:17:44 2012 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 26 Jan 2012 17:17:44 +0000 Subject: [Ironpython-users] [ANN] Python Tools for Visual Studio 1.1 RC Message-ID: <6C7ABA8B4E309440B857D74348836F2E54C63A8D@TK5EX14MBXC294.redmond.corp.microsoft.com> We're pleased to announce the release of Python Tools for Visual Studio 1.1 RC. Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual Studio which supports programming with the Python programming language. 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 and we'll analyze the extension module and 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. The PyKinect sample is a wrapper around the Kinect SDK and enables development with the Kinect SDK directly from Python. The sample includes a new template for quickly getting started creating games using PyGame with PyKinect. PyKinect is licensed under a license similar to the existing Kinect SDK. Pyvot (pronounced Pivot) connects familiar data-exploration and visualization tools in Excel with the powerful data analysis and transformation capabilities of Python, with an emphasis on tabular data. It provides a simple and Pythonic interface to Excel, smoothing over the pain points in using the existing Excel object model as exposed via COM. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sun Jan 29 23:35:41 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 29 Jan 2012 14:35:41 -0800 Subject: [Ironpython-users] IronPython 2.7.2 Alpha 1 released Message-ID: On behalf of the IronPython team, I'm happy to announce the first preview release of IronPython 2.7.2, 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 1 includes support for .NET 3.5, .NET 4, Silverlight 4, Silverlight 5, and Mono for Android 4.0. Check the "Platforms" directory for the required assemblies. Any feedback on the supported platforms, especially for Android, is greatly appreciated. The intent is to add support for Windows Mobile 7.5 and MonoTouch prior to the final release of 2.7.2. Windows 8 "Metro" may also be supported, depending on when its first beta is released. Otherwise, the biggest improvement in IronPython 2.7.2 is support for the zipimport module, thanks to Alex Earl. A handful of other bugs have been fixed as well. The final release of IronPython 2.7.2 is currently set for March 11[1]. Any fixes should be made available prior to the release of the RC on March 4th. As always, if you'd like to contribute and need assistance, let me know and I'll be happy to help. - Jeff [1]https://www.google.com/calendar/embed?src=i72rkrajdpshnj17rvmqatmp88%40group.calendar.google.com&ctz=America/Los_Angeles From no_reply at codeplex.com Tue Jan 31 12:40:50 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 31 Jan 2012 03:40:50 -0800 Subject: [Ironpython-users] IronPython, Daily Digest 1/30/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Exception is thrown when attempting to run pre-compiled code with sys.settrace enabled ---------------------------------------------- ISSUES 1. [New comment] Exception is thrown when attempting to run pre-compiled code with sys.settrace enabled http://ironpython.codeplex.com/workitem/31447 User hfoffani has commented on the issue: "Are there any chance that this issue could be solved in 2.7.2? My lack of understanding of the efforts that would imply to address this problem and inability to collaborate makes me very uncomfortable to ask, but I'd greatly appreciate any advance on it. One way or the other, thank you a lot. " ---------------------------------------------- ---------------------------------------------- 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: