[IronPython] SystemError while compiling PIL.Image
William Reade
william at resolversystems.com
Fri Oct 23 11:40:55 CEST 2009
Hi Dino
If I comment out 2 methods, the file parses fine. Uncommenting either is
enough to cause it to fail.
def convert(self, mode=None, data=None, dither=None, palette=WEB,
colors=256):
def rotate(self, angle, resample=NEAREST, expand=0):
WEB and NEAREST are both set to 0 at module level; convert and rotate
are both methods on the module-level old-style class Image. The only
obvious common feature is that both have a non-name default parameter
following a name default parameter, but I haven't managed to produce a
minimal repro.
If you're allowed to just look at other people's code willy-nilly, the
file is Image.py in PIL 1.16 :).
Cheers
william
Dino Viehland wrote:
> Is there a parameter with a default value that is a name? If so what is the
> scope of the name in relation to the function definition?
>
>> -----Original Message-----
>> From: users-bounces at lists.ironpython.com [mailto:users-
>> bounces at lists.ironpython.com] On Behalf Of William Reade
>> Sent: Thursday, October 22, 2009 6:37 AM
>> To: Discussion of IronPython
>> Subject: [IronPython] SystemError while compiling PIL.Image
>>
>> Transcript follows. The contents of the file don't look obviously
>> weird.
>> Does anyone have any idea what the problem might be?
>>
>> Cheers
>> William
>>
>> -----------------------------------------------------------------------
>> --
>>
>> C:\dev\ironclad>ipy -X:ExceptionDetail
>> C:\Python26\Lib\site-packages\PIL\Image.py
>> Object reference not set to an instance of an object.
>> at IronPython.Compiler.Ast.GlobalAllocator.GetVariable(AstGenerator
>> ag, PythonVariable variable)
>> at IronPython.Compiler.Ast.NameExpression.Transform(AstGenerator
>> ag,
>> Type type)
>> at
>> IronPython.Compiler.Ast.FunctionDefinition.TransformParameters(AstGener
>> ator
>> outer, AstGenerator inner, List`1 defaults, List`1 names, Boolean
>> needsWrapperMethod, List`1 init)
>> at
>> IronPython.Compiler.Ast.FunctionDefinition.TransformToFunctionExpressio
>> n(AstGenerator
>> ag)
>> at
>> IronPython.Compiler.Ast.FunctionDefinition.Transform(AstGenerator ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformMaybeSingleLineSuite(Stat
>> ement
>> body, SourceLocation prevStart)
>> at IronPython.Compiler.Ast.AstGenerator.Transform(Statement[] from)
>> at IronPython.Compiler.Ast.SuiteStatement.Transform(AstGenerator
>> ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformMaybeSingleLineSuite(Stat
>> ement
>> body, SourceLocation prevStart)
>> at IronPython.Compiler.Ast.IfStatement.Transform(AstGenerator ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at
>> IronPython.Compiler.Ast.FunctionDefinition.TryTransformBody(AstGenerato
>> r
>> ag, List`1 statements)
>> at
>> IronPython.Compiler.Ast.FunctionDefinition.TransformToFunctionExpressio
>> n(AstGenerator
>> ag)
>> at
>> IronPython.Compiler.Ast.FunctionDefinition.Transform(AstGenerator ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformMaybeSingleLineSuite(Stat
>> ement
>> body, SourceLocation prevStart)
>> at IronPython.Compiler.Ast.AstGenerator.Transform(Statement[] from)
>> at IronPython.Compiler.Ast.SuiteStatement.Transform(AstGenerator
>> ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at IronPython.Compiler.Ast.ClassDefinition.Transform(AstGenerator
>> ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformMaybeSingleLineSuite(Stat
>> ement
>> body, SourceLocation prevStart)
>> at IronPython.Compiler.Ast.AstGenerator.Transform(Statement[] from)
>> at IronPython.Compiler.Ast.SuiteStatement.Transform(AstGenerator
>> ag)
>> at
>> IronPython.Compiler.Ast.AstGenerator.TransformWithLineNumberUpdate(Stat
>> ement
>> fromStmt)
>> at IronPython.Compiler.Ast.PythonAst.Transform(AstGenerator ag)
>> at IronPython.Compiler.Ast.PythonAst.TransformToAst(CompilationMode
>> mode, CompilerContext context)
>> at IronPython.Runtime.PythonContext.CompilePythonCode(Nullable`1
>> compilationMode, SourceUnit sourceUnit, CompilerOptions options,
>> ErrorSink errorSink)
>> at IronPython.Runtime.PythonContext.GetScriptCode(SourceUnit
>> sourceCode, String moduleName, ModuleOptions options, Nullable`1 mode)
>> at IronPython.Runtime.PythonContext.GetScriptCode(SourceUnit
>> sourceCode, String moduleName, ModuleOptions options)
>> at IronPython.Runtime.PythonContext.CompileModule(String fileName,
>> String moduleName, SourceUnit sourceCode, ModuleOptions options,
>> ScriptCode& scriptCode)
>> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String
>> fileName)
>> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)
>> SystemError: Object reference not set to an instance of an object.
>>
>> -----------------------------------------------------------------------
>> --
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
More information about the Ironpython-users
mailing list