Title: NPE on PythonInterpreter.eval()
Type: crash Severity: major
Components: Core Versions: 2.5b0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: amak, fwierzbicki
Priority: Keywords:

Created on 2008-11-18.19:40:02 by amak, last changed 2008-11-22.19:21:08 by fwierzbicki.

msg3787 (view) Author: Alan Kennedy (amak) Date: 2008-11-18.19:40:02
The following snippet causes an NPE in the 2.5b0.

This code should work, unless there's been an undocumented change in the
PythonInterpreter API?

import org.python.core.*;
import org.python.util.*;

public class EvalBug
  public static void main (String [] args)
    PythonInterpreter.initialize(System.getProperties(), null, new
String[] {});
    PythonInterpreter interp = new PythonInterpreter();
    PyObject pyo = interp.eval("{u'one': u'two'}");
    System.out.println("Result is : " + pyo);
msg3788 (view) Author: Alan Kennedy (amak) Date: 2008-11-18.19:42:21
Sorry, forgot to post the traceback; which follows

C:\jython25b0>java EvalBug
*sys-package-mgr*: can't create package cache dir,
Exception in thread "main" java.lang.NullPointerException
        at org.python.core.ParserFacade.prepBufReader(
        at org.python.core.ParserFacade.parse(
        at org.python.core.Py.compile_flags(
        at org.python.core.CompileFunction.compile(
        at org.python.core.CompileFunction.compile(
        at org.python.core.__builtin__.eval(
        at org.python.core.__builtin__.eval(
        at EvalBug.main(

java.lang.NullPointerException: java.lang.NullPointerException
msg3803 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-11-22.19:21:07
Not a new API -- this is definitely a bug.  Fixed in r5598.
Date User Action Args
2008-11-22 19:21:08fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg3803
2008-11-22 16:13:55fwierzbickisetassignee: fwierzbicki
nosy: + fwierzbicki
2008-11-18 19:42:21amaksetmessages: + msg3788
2008-11-18 19:40:03amakcreate