IronPython 2, 'with' and COM
IronPython 2 targets Python 2.5, which means that the with statement is available. This is convenient because the currently released version of IronPython 2 there is a memory leak that keeps COM objects alive after they are used.
This bug is fixed in the IronPython source code control, but in the meantime a Japanese blogger has a workaround that uses 'with' and calls Marshal.ReleaseComObject - his fantastically nested example is for Excel Interop.
His blog has some other interesting IronPython stuff, including this example of Excel 2007 interop that creates a spreadsheet from a bitmap!
This bug is fixed in the IronPython source code control, but in the meantime a Japanese blogger has a workaround that uses 'with' and calls Marshal.ReleaseComObject - his fantastically nested example is for Excel Interop.
His blog has some other interesting IronPython stuff, including this example of Excel 2007 interop that creates a spreadsheet from a bitmap!
Comments
Post a Comment