Issue1465476

classification
Title: syntax error terminates interpreter
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, fwierzbicki, hkarahan81, kzuberi, nobody
Priority: high Keywords:

Created on 2006-04-06.03:06:47 by kzuberi, last changed 2006-08-10.16:30:12 by kzuberi.

Messages
msg1124 (view) Author: Khalid Zuberi (kzuberi) Date: 2006-04-06.03:06:47
On jython latest CVS, the following typo entered at the
interpreter prompt:

   >>> x = dict[1,])

causes the interpreter to exit with a long traceback
from the parser (pasted below for your entertainment).
It should just be a SyntaxError.

- kz

java.lang.ClassCastException:
org.python.parser.IdentityNode
	at
org.python.parser.TreeBuilder.closeNode(TreeBuilder.java:426)
	at
org.python.parser.JJTPythonGrammarState.closeNodeScope(JJTPythonGrammarState.java:138)
	at
org.python.parser.PythonGrammar.subscriptlist(PythonGrammar.java:4129)
	at
org.python.parser.PythonGrammar.atomtrailer(PythonGrammar.java:3728)
	at
org.python.parser.PythonGrammar.power(PythonGrammar.java:3627)
	at
org.python.parser.PythonGrammar.factor(PythonGrammar.java:3614)
	at
org.python.parser.PythonGrammar.term(PythonGrammar.java:3366)
	at
org.python.parser.PythonGrammar.arith_expr(PythonGrammar.java:3285)
	at
org.python.parser.PythonGrammar.shift_expr(PythonGrammar.java:3204)
	at
org.python.parser.PythonGrammar.and_expr(PythonGrammar.java:3161)
	at
org.python.parser.PythonGrammar.xor_expr(PythonGrammar.java:3118)
	at
org.python.parser.PythonGrammar.expr(PythonGrammar.java:3075)
	at
org.python.parser.PythonGrammar.comparison(PythonGrammar.java:2857)
	at
org.python.parser.PythonGrammar.not_test(PythonGrammar.java:2841)
	at
org.python.parser.PythonGrammar.and_test(PythonGrammar.java:2751)
	at
org.python.parser.PythonGrammar.test(PythonGrammar.java:2701)
	at
org.python.parser.PythonGrammar.SmartTestList(PythonGrammar.java:4410)
	at
org.python.parser.PythonGrammar.expr_stmt(PythonGrammar.java:1341)
	at
org.python.parser.PythonGrammar.small_stmt(PythonGrammar.java:933)
	at
org.python.parser.PythonGrammar.simple_stmt(PythonGrammar.java:884)
	at
org.python.parser.PythonGrammar.single_input(PythonGrammar.java:254)
	at org.python.core.parser.doparse(parser.java:172)
	at org.python.core.parser.partialParse(parser.java:116)
	at org.python.core.Py.compile_command_flags(Py.java:1707)
	at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:50)
	at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:44)
	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:214)
Traceback (innermost last):
  (no code object) at line 0
java.lang.IllegalArgumentException: Cannot create
PyString from null!

	at org.python.core.PyString.<init>(PyString.java:2647)

	at org.python.core.PyString.<init>(PyString.java:2654)

	at
org.python.core.PySyntaxError.<init>(PySyntaxError.java:24)

	at org.python.core.parser.fixParseError(parser.java:56)

	at org.python.core.parser.partialParse(parser.java:131)

	at org.python.core.Py.compile_command_flags(Py.java:1707)

	at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:50)

	at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:44)

	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:214)


java.lang.IllegalArgumentException:
java.lang.IllegalArgumentException: Cannot create
PyString from null!
msg1125 (view) Author: Hasan Karahan (hkarahan81) Date: 2006-05-20.11:06:50
Logged In: YES 
user_id=1525733

I'm interested in fixing this bug, is anybody working on it
at the moment?
msg1126 (view) Author: Khalid Zuberi (kzuberi) Date: 2006-05-20.19:09:28
Logged In: YES 
user_id=18288


Well I haven't looked into it yet myself. Assuming no-one
else speaks up, i'd say go ahead.

- kz
msg1127 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2006-05-22.13:45:38
Logged In: YES 
user_id=193969

hkarahan81, please give it a try, I don't think anyone is
looking at it.  The jython-dev mailing list is also a good
place to announce your intentions to work on a bug, more
people follow that list than watch the bug tracker.
msg1128 (view) Author: Nobody/Anonymous (nobody) Date: 2006-05-24.17:16:49
Logged In: NO 

thanks, I'm now debugging it.. had problems to compile
(since I'd never worked with ant before); I use NetBeans for
it's debugging facilities and at the moment I'm fighting
through the code jungle.. it's really huge, but I love it :)
I'd never worked on a compiler since it will take me a while
until I've solved the bug; but I'm working on it. Ok, I'll
announce my debugging activities there..
msg1129 (view) Author: Hasan Karahan (hkarahan81) Date: 2006-05-24.17:22:54
Logged In: YES 
user_id=1525733

the last entry is from me
msg1130 (view) Author: Charlie Groves (cgroves) Date: 2006-08-10.04:43:48
Logged In: YES 
user_id=1174327

Fixed on the 2.3 branch in r2877
msg1131 (view) Author: Khalid Zuberi (kzuberi) Date: 2006-08-10.16:30:12
Logged In: YES 
user_id=18288


Works fine for me now. Thanks!

- kz
History
Date User Action Args
2006-04-06 03:06:47kzubericreate