<html><head><style type="text/css" media="screen">Body{font-family: Verdana;font-size:.75em;}h4{font-size:.9em;}a{color: #3a62a6;}.digest .toc {margin-bottom: 15px; padding-bottom:8px; border-bottom: 1px solid #ccc;}.digest .tocItem {margin-bottom: 15px;}.tocItem a{color:#000;text-decoration: none;}.tocItem a:hover{color: #3a62a6;text-decoration: underline;}.topic{padding-bottom: 8px;margin-bottom: 20px; border-bottom: 1px solid #ccc;}.topicHeader{margin-bottom:10px;}.topicTitle{font-weight: bold;}.replies p{margin:0;padding:0;}.replies hr{width: 15%;text-align: left;margin: 0 auto 5px 0;border: none 0;border-top: 1px solid #ccc;height: 1px;}.reply{margin-bottom: 6px;padding-bottom: 4px;}.anchorMarker{color: #3a62a6;}.footer{color: gray;}</style></head><body><div class="digest"><p>Hi ironpython,</p><p>Here's your Daily Digest of new issues for project "<a href="http://ironpython.codeplex.com/">IronPython</a>".</p><p>In today's digest:</p><h4>ISSUES</h4><div class="toc"><div class="tocItem"><a href="#toc_issue_1">1. <span class="tocTitle">[New issue] Importing .NET types causes ImportExceptions (zipimport handler)</span> <span class="anchorMarker">↓</span></a></div></div><h4>ISSUES</h4><div class="topic"><a name="toc_issue_1"></a><div class="topicHeader"><span class="topicTitle">1. [New issue] Importing .NET types causes ImportExceptions (zipimport handler)</span> <a href="http://ironpython.codeplex.com/workitem/34602">view online</a></div><p>User sopelt has proposed the issue:</p><p>"When hosting IronPython in a C#/.NET application the first import of a .NET type (and possibly non-zip python modules?) causes an internally thrown and ignored <code>IronPython.Runtime.Exceptions.ImportException</code> having <code>not a Zip file</code> as its message.<br />
<br />
This seem to happen during initial construction of the <code>zipimporter</code>.<br />
<br />
In situations where third-party libraries are being debugged or profiled in a project using IronPython this can cause lots of unwanted exceptions and complicate development.<br />
<br />
A minimal example could look like:<br />
<pre><code>namespace ConsoleApplication
{
    using IronPython.Hosting;

    class Program
    {
        static void Main(string[] args)
        {
            var e = Python.CreateEngine();
            var source = e.CreateScriptSourceFromString(@"from System import Guid");
            var result = source.Execute();
        }
    }
}</code></pre>

with the resulting stack at the time of the unwanted exception as<br />
<pre><code>>   IronPython.Modules.dll!IronPython.Runtime.ZipImportModule.zipimporter.zipimporter(IronPython.Runtime.CodeContext context, object pathObj, System.Collections.Generic.IDictionary<object,object> kwArgs) Line 142    C#
    [Native to Managed Transition]  
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.NewInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) Line 73    C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) Line 126  C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run4<System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,object,object>(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, object arg3) Line 165 C#
    System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute3<IronPython.Runtime.CodeContext,object,object,object>(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, object arg2) Unknown
    IronPython.dll!IronPython.Runtime.PythonContext.Call(IronPython.Runtime.CodeContext context, object func, object arg0) Line 2827    C#
    IronPython.dll!IronPython.Runtime.Operations.PythonCalls.Call(IronPython.Runtime.CodeContext context, object func, object arg0) Line 30 C#
    IronPython.dll!IronPython.Runtime.Importer.FindImporterForPath(IronPython.Runtime.CodeContext context, string dirname) Line 884 C#
    IronPython.dll!IronPython.Runtime.Importer.ImportFromPathHook(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path, System.Func<IronPython.Runtime.CodeContext,string,string,string,object> defaultLoader) Line 836   C#
    IronPython.dll!IronPython.Runtime.Importer.ImportFromPath(IronPython.Runtime.CodeContext context, string name, string fullName, IronPython.Runtime.List path) Line 818  C#
    IronPython.dll!IronPython.Runtime.Importer.ImportTopAbsolute(IronPython.Runtime.CodeContext context, string name) Line 622  C#
    IronPython.dll!IronPython.Runtime.Importer.ImportModule(IronPython.Runtime.CodeContext context, object globals, string modName, bool bottom, int level) Line 262    C#
    IronPython.dll!IronPython.Modules.Builtin.__import__(IronPython.Runtime.CodeContext context, string name, object globals, object locals, object fromlist, int level) Line 108   C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction<IronPython.Runtime.CodeContext,string,object,object,object,int,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) Line 812   C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) Line 126  C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run7<System.Runtime.CompilerServices.CallSite,IronPython.Runtime.CodeContext,object,string,IronPython.Runtime.PythonDictionary,IronPython.Runtime.PythonDictionary,IronPython.Runtime.PythonTuple,object>(System.Runtime.CompilerServices.CallSite arg0, IronPython.Runtime.CodeContext arg1, object arg2, string arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonDictionary arg5, IronPython.Runtime.PythonTuple arg6) Line 282 C#
    System.Core.dll!System.Dynamic.UpdateDelegates.UpdateAndExecute6<IronPython.Runtime.CodeContext,object,string,IronPython.Runtime.PythonDictionary,IronPython.Runtime.PythonDictionary,IronPython.Runtime.PythonTuple,object>(System.Runtime.CompilerServices.CallSite site, IronPython.Runtime.CodeContext arg0, object arg1, string arg2, IronPython.Runtime.PythonDictionary arg3, IronPython.Runtime.PythonDictionary arg4, IronPython.Runtime.PythonTuple arg5) Unknown
    IronPython.dll!IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext context, string fullName, IronPython.Runtime.PythonTuple from, int level) Line 64    C#
    IronPython.dll!IronPython.Runtime.Operations.PythonOps.ImportWithNames(IronPython.Runtime.CodeContext context, string fullName, string[] names, int level) Line 1805    C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.FuncCallInstruction<IronPython.Runtime.CodeContext,string,string[],int,object>.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) Line 764   C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame) Line 126  C#
    Microsoft.Dynamic.dll!Microsoft.Scripting.Interpreter.LightLambda.Run1<IronPython.Runtime.FunctionCode,object>(IronPython.Runtime.FunctionCode arg0) Line 66    C#
    IronPython.dll!IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Microsoft.Scripting.Runtime.Scope scope) Line 79  C#
    IronPython.dll!IronPython.Compiler.RuntimeScriptCode.Run() Line 55  C#
    Microsoft.Scripting.dll!Microsoft.Scripting.SourceUnit.Execute() Line 249   C#
    Microsoft.Scripting.dll!Microsoft.Scripting.Hosting.ScriptSource.Execute() Line 143 C#
    ConsoleApplication2.exe!ConsoleApplication.Program.Main(string[] args) Line 11  C#
    [Native to Managed Transition]  
    mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) Unknown
    Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()   Unknown
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state)    Unknown
    mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()    Unknown</code></pre>

"</p></div><div class="footer"><p>You are receiving this email because you subscribed to notifications on CodePlex.</p><p>To report a bug, request a feature, or add a comment, visit <a href="http://ironpython.codeplex.com/workitem/list/basic">IronPython Issue Tracker</a>. You can <a href="http://ironpython.codeplex.com/subscriptions/workitem/project/edit">unsubscribe or change your issue notification settings</a> on CodePlex.com.</p></div></div></body></html>