Issue1113

classification
Title: Syntax + Compiler Error
Type: Severity: critical
Components: Core Versions: 2.5alpha1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: arianepaola, fwierzbicki, pjenvey
Priority: Keywords:

Created on 2008-08-28.05:19:58 by arianepaola, last changed 2008-10-27.18:09:48 by fwierzbicki.

Messages
msg3454 (view) Author: Ariane Paola Gomes (arianepaola) Date: 2008-08-28.05:19:57
toscawidgets svn, running setup.py build + install

byte-compiling build/bdist.java1.6.0_0/egg/tw/core/util.py to util$py.class
  File "build/bdist.java1.6.0_0/egg/tw/core/util.py", line 387
    self._raw_regexp = r"|".join("(%s)" % k (for k in dct.keys()))
                                            ^
SyntaxError: line 387:49 mismatched input 'for' expecting RPAREN

byte-compiling build/bdist.java1.6.0_0/egg/tw/core/registry.py to
registry$py.class
byte-compiling build/bdist.java1.6.0_0/egg/tw/core/__init__.py to
__init__$py.class
byte-compiling build/bdist.java1.6.0_0/egg/tw/core/resources.py to
resources$py.class
internal compiler error: Name
Traceback (most recent call last):
  File "setup.py", line 42, in <module>
    setup(
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/core.py", line
151, in setup
    dist.run_commands()
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/dist.py", line
974, in run_commands
    self.run_command(cmd)
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/dist.py", line
994, in run_command
    cmd_obj.run()
  File
"/home/ariane/work/jython-svn/dist/Lib/site-packages/setuptools-0.7a1dev_r61341-py2.5.egg/setuptools/command/install$py.class",
line 76, in run
  File
"/home/ariane/work/jython-svn/dist/Lib/site-packages/setuptools-0.7a1dev_r61341-py2.5.egg/setuptools/command/install$py.class",
line 96, in do_egg_install
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/cmd.py", line
333, in run_command
    self.distribution.run_command(command)
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/dist.py", line
994, in run_command
    cmd_obj.run()
  File
"/home/ariane/work/jython-svn/dist/Lib/site-packages/setuptools-0.7a1dev_r61341-py2.5.egg/setuptools/command/bdist_egg$py.class",
line 174, in run
  File
"/home/ariane/work/jython-svn/dist/Lib/site-packages/setuptools-0.7a1dev_r61341-py2.5.egg/setuptools/command/bdist_egg$py.class",
line 161, in call_command
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/cmd.py", line
333, in run_command
    self.distribution.run_command(command)
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/dist.py", line
994, in run_command
    cmd_obj.run()
  File
"/home/ariane/work/jython-svn/dist/Lib/site-packages/setuptools-0.7a1dev_r61341-py2.5.egg/setuptools/command/install_lib$py.class",
line 24, in run
  File
"/home/ariane/work/jython-svn/dist/Lib/distutils/command/install_lib.py", line
133, in byte_compile
    byte_compile(files, optimize=0,
  File "/home/ariane/work/jython-svn/dist/Lib/distutils/util.py", line
502, in byte_compile
    compile(file, cfile, dfile)
  File "/home/ariane/work/jython-svn/dist/Lib/py_compile.py", line 96,
in compile
    _py_compile.compile(file, cfile, dfile)
	at org.python.compiler.CodeCompiler.visitName(CodeCompiler.java:1950)
	at org.python.antlr.ast.Name.accept(Name.java:50)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.set(CodeCompiler.java:202)
	at org.python.compiler.CodeCompiler.set(CodeCompiler.java:193)
	at org.python.compiler.CodeCompiler.visitListComp(CodeCompiler.java:1731)
	at org.python.antlr.ast.ListComp.accept(ListComp.java:67)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at
org.python.compiler.CodeCompiler.visitGeneratorExp(CodeCompiler.java:2046)
	at org.python.antlr.ast.GeneratorExp.accept(GeneratorExp.java:68)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.visitCall(CodeCompiler.java:1511)
	at org.python.antlr.ast.Call.accept(Call.java:105)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.visitAssign(CodeCompiler.java:453)
	at org.python.antlr.ast.Assign.accept(Assign.java:65)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1248)
	at org.python.compiler.CodeCompiler.doTest(CodeCompiler.java:896)
	at org.python.compiler.CodeCompiler.visitIf(CodeCompiler.java:916)
	at org.python.antlr.ast.If.accept(If.java:90)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1248)
	at org.python.compiler.CodeCompiler.visitSuite(CodeCompiler.java:1242)
	at org.python.antlr.ast.Suite.accept(Suite.java:58)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:275)
	at org.python.compiler.Module.PyCode(Module.java:455)
	at org.python.compiler.CodeCompiler.visitFunctionDef(CodeCompiler.java:408)
	at org.python.antlr.ast.FunctionDef.accept(FunctionDef.java:98)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1248)
	at org.python.compiler.CodeCompiler.visitSuite(CodeCompiler.java:1242)
	at org.python.antlr.ast.Suite.accept(Suite.java:58)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:275)
	at org.python.compiler.Module.PyCode(Module.java:455)
	at org.python.compiler.CodeCompiler.visitClassDef(CodeCompiler.java:1834)
	at org.python.antlr.ast.ClassDef.accept(ClassDef.java:90)
	at org.python.antlr.ast.Module.traverse(Module.java:65)
	at org.python.antlr.Visitor.traverse(Visitor.java:12)
	at org.python.compiler.CodeCompiler.visitModule(CodeCompiler.java:314)
	at org.python.antlr.ast.Module.accept(Module.java:58)
	at org.python.antlr.Visitor.visit(Visitor.java:26)
	at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:275)
	at org.python.compiler.Module.PyCode(Module.java:455)
	at org.python.compiler.Module.compile(Module.java:634)
	at org.python.core.imp.compileSource(imp.java:203)
	at org.python.core.imp.compileSource(imp.java:137)
	at org.python.modules._py_compile.compile(_py_compile.java:47)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)

NullPointerException: java.lang.NullPointerException
msg3457 (view) Author: Ariane Paola Gomes (arianepaola) Date: 2008-08-28.05:43:52
error caused by lines 340-346 in resources.py

         if src:
             source_vars = dict(
                 v for v in [(k, getattr(self,k,None)) for k in
self.source_vars]
                 )
             source_vars.update(
                 v for v in d.iteritems() if v[0] in self.source_vars
                 )
msg3465 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-08-31.18:08:28
From the trace is:

self._raw_regexp = r"|".join("(%s)" % k (for k in dct.keys()))

correct?

Shouldn't the generator expression be

(k for k in dct.keys()))

Not that this should result in an NPE -- but I just want to understand.
msg3707 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-10-27.18:09:48
Aside from what looks like a syntax error in the example code, I'm
almost positive that this was related to nested generator expressions,
which do not produce an NPE any longer.  Closing.
History
Date User Action Args
2008-10-27 18:09:48fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg3707
2008-08-31 18:08:29fwierzbickisetassignee: fwierzbicki
messages: + msg3465
2008-08-28 05:43:52arianepaolasetmessages: + msg3457
2008-08-28 05:19:58arianepaolacreate