Issue222806

classification
Title: Unterminated string in interpreter causes NPE
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn
Priority: low Keywords:

Created on 2000-11-18.18:59:39 by bckfnn, last changed 2000-11-18.22:17:09 by bckfnn.

Messages
msg50 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.18:59:39
This is pretty clearly related to bug #147.  I'm running the IBM jdk1.1.8 VM.

C:\dev\JPython>jpython
JPython 1.1beta2 on java1.1.8
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> 'foo
Traceback (innermost last):
  (no code object) at line 0
java.lang.NullPointerException
        at org.python.core.Py.printException(Py.java:782)
        at org.python.core.PyException.printStackTrace(PyException.java:76)
        at org.python.core.PyException.toString(PyException.java:96)
        at org.python.util.InteractiveInterpreter.showexception(InteractiveInter
preter.java:92)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret
er.java:53)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret
er.java:42)
        at org.python.util.InteractiveConsole.push(InteractiveConsole.java:80)
        at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:5
9)
        at org.python.util.jpython.main(jpython.java:140)

java.lang.NullPointerException: java.lang.NullPointerException
C:\dev\JPython>

For comparison, here's Python's behavior -


C:\dev\JPython>python
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> 'foo
  File "<stdin>", line 1
    'foo
       ^
SyntaxError: invalid token
>>>
msg51 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.22:17:09
Fixed in Py by checking that the syntax error text is set before printing it.
History
Date User Action Args
2000-11-18 18:59:39bckfnncreate