<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-text-plain" wrap="true" style="font-family:
      -moz-fixed; font-size: 14px;" lang="x-western">
      <pre wrap="">Hey,

a little background:
i am trying here to make sort of compiler helper. idea is to build
dependency tree of project and then just pass all standard library py
files to pyc.py so they would be compiled into application. Result would
be independent from ironpython .NET executable.

the problem:
seems that codecs somehow do not compile right. in compiled binary i
cant use utf-16 codec (i did not test others).

testcase is really simple:
</pre>
      <blockquote type="cite" style="color: #000000;">
        <pre wrap="">import codecs
codecs.open('file.txt', 'r', 'utf-16')
</pre>
      </blockquote>
      <pre wrap="">file.txt should exist before testing this. it can be empty, doesnt matter.
running it on ipy interpreter no exception is thrown, but if this is
compiled to executable this is what i get:
</pre>
      <blockquote type="cite" style="color: #000000;">
        <pre wrap="">F:\l2off\py\pyc.NET\src&gt;test.exe

Unhandled Exception: IronPython.Runtime.Exceptions.LookupException:
unknown encoding: utf-16
   at
IronPython.Runtime.Operations.PythonOps.LookupEncoding(CodeContext
context, String encoding)
   at
Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame
frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
frame)
   at
Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0
arg0, T1 arg1, T2 arg2, T3 arg3)
   at
System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite
site, T0 arg0, T1 arg1, T2 arg2)
   at DLRCachedCode.open$64(Closure , PythonFunction $function, Object
filename, Object mode, Object encoding, Object errors, Object buffering)
   at
IronPython.Runtime.PythonFunction.FunctionCaller`3.Default2Call3(CallSite
site, CodeContext context, Object func, T0 arg0, T1 arg1, T2 arg2)
   at
System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite
site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   at DLRCachedCode.__main__$2(CodeContext $globalContext,
FunctionCode $functionCode)
   at IronPython.Compiler.OnDiskScriptCode.Run()
   at IronPython.Runtime.PythonContext.InitializeModule(String
fileName, ModuleContext moduleContext, ScriptCode scriptCode,
ModuleOptions options)
   at IronPython.Runtime.ModuleLoader.load_module(CodeContext context,
String fullName)
   at
Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame
frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
frame)
   at
Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0
arg0, T1 arg1, T2 arg2, T3 arg3)
   at
System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite
site, T0 arg0, T1 arg1, T2 arg2)
   at
IronPython.Runtime.Importer.FindAndLoadModuleFromImporter(CodeContext
context, Object importer, String fullName,
List path, Object&amp; ret)
   at IronPython.Runtime.Importer.TryLoadMetaPathModule(CodeContext
context, String fullName, List path, Object&amp; ret)
   at IronPython.Runtime.Importer.ImportTopAbsolute(CodeContext
context, String name)
   at IronPython.Runtime.Importer.ImportModule(CodeContext context,
Object globals, String modName, Boolean bottom, Int32 level)
   at IronPython.Modules.Builtin.__import__(CodeContext context,
String name, Object globals, Object locals, Object fromlist, Int32 level)
   at
Microsoft.Scripting.Interpreter.FuncCallInstruction`7.Run(InterpretedFrame
frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
frame)
   at
Microsoft.Scripting.Interpreter.LightLambda.Run8[T0,T1,T2,T3,T4,T5,T6,T7,TRet](T0
arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
   at
System.Dynamic.UpdateDelegates.UpdateAndExecute7[T0,T1,T2,T3,T4,T5,T6,TRet](CallSite
site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
   at IronPython.Runtime.Importer.ImportLightThrow(CodeContext
context, String fullName, PythonTuple from, Int32 level)
   at
IronPython.Runtime.Operations.PythonOps.InitializeModule(Assembly
precompiled, String main, String[] references)
   at PythonMain.Main()
</pre>
      </blockquote>
      <pre wrap="">Is this something on my end or problem in IronPython itself?
</pre>
    </div>
    <pre class="moz-signature" cols="72">-- 
rox</pre>
  </body>
</html>