From: Brian Z. <bz...@ig...> - 2000-12-18 18:31:55
|
I am using the latest CVS code and can no longer import the CPython 2.0 cgi module: D:\>jython Listening for transport dt_socket at address: 3540 Jython 2.0alpha2 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import cgi internal compiler error: Name:s1 at line 195 Traceback (innermost last): File "<console>", line 1, in ? java.lang.NullPointerException at org.python.compiler.CodeCompiler.Name(CodeCompiler.java:2237) at org.python.parser.SimpleNode.visit(SimpleNode.java:326) at org.python.compiler.CodeCompiler.set(CodeCompiler.java:110) at org.python.compiler.CodeCompiler.for_stmt(CodeCompiler.java:884) at org.python.parser.SimpleNode.visit(SimpleNode.java:224) at org.python.compiler.CodeCompiler.list_comprehension(CodeCompiler.java:19 50) at org.python.compiler.CodeCompiler.list(CodeCompiler.java:1906) at org.python.parser.SimpleNode.visit(SimpleNode.java:296) at org.python.compiler.CodeCompiler.expr_stmt(CodeCompiler.java:352) at org.python.parser.SimpleNode.visit(SimpleNode.java:190) at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1116) at org.python.parser.SimpleNode.visit(SimpleNode.java:230) at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:185) at org.python.compiler.Module.PyCode(Module.java:370) at org.python.compiler.CodeCompiler.funcdef(CodeCompiler.java:324) at org.python.parser.SimpleNode.visit(SimpleNode.java:178) at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1116) at org.python.compiler.CodeCompiler.file_input(CodeCompiler.java:240) at org.python.parser.SimpleNode.visit(SimpleNode.java:174) at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:185) at org.python.compiler.Module.PyCode(Module.java:370) at org.python.compiler.Module.compile(Module.java:506) at org.python.core.imp.compileSource(imp.java:119) at org.python.core.imp.compileSource(imp.java:102) at org.python.core.imp.createFromSource(imp.java:142) at org.python.core.imp.loadFromPath(imp.java:316) at org.python.core.imp.loadFromPath(imp.java:252) at org.python.core.imp.load(imp.java:357) at org.python.core.imp.load(imp.java:376) at org.python.core.imp.importName(imp.java:446) at org.python.core.imp.importName(imp.java:508) at org.python.core.ImportFunction.load(__builtin__.java:962) at org.python.core.ImportFunction.__call__(__builtin__.java:956) at org.python.core.PyObject.__call__(PyObject.java:250) at org.python.core.__builtin__.__import__(__builtin__.java:916) at org.python.core.imp.importOne(imp.java:517) at org.python.pycode._pyx1.f$0(<console>) at org.python.pycode._pyx1.call_function(<console>) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.Py.runCode(Py.java:1050) at org.python.core.Py.exec(Py.java:1064) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:124) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.ja va:87) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter. java:68) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter. java:42) at org.python.util.InteractiveConsole.push(InteractiveConsole.java:83) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:62) at org.python.util.jython.main(jython.java:178) java.lang.NullPointerException: java.lang.NullPointerException >>> This worked with alpha1 on Windows 2000, jdk1.3 thanks, brian |
From: <bc...@wo...> - 2000-12-18 21:59:43
|
[Brian Zimmer] >This is a multi-part message in MIME format. > >------_=_NextPart_001_01C06920.5186FCDF >Content-Type: text/plain; > charset="iso-8859-1" >Content-Transfer-Encoding: quoted-printable > >I am using the latest CVS code and can no longer import the CPython 2.0 >cgi module: > >D:\>jython >Listening for transport dt_socket at address: 3540 >Jython 2.0alpha2 on java1.3.0 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import cgi >internal compiler error: Name:s1 at line 195 Obviously a bug. It occur because a more stringent fast-locals algorithm was added in a2 (this fix a bug when "exec" staments assign to a local and make jython more CPython compatible). The new algorithmt assume that all locals have been detected correctly where the a1 would use a slower string based local lookup when in doubt. The trigger is the local assignments in list comprehension that wasn't detected correctly. "s1" and "s2" and locals in defining block: pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] A patch have now been checked into CVS. regards, finn |