Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary with None values turns the whole dict to None #40

Closed
soyvv opened this issue Feb 23, 2016 · 3 comments
Closed

Dictionary with None values turns the whole dict to None #40

soyvv opened this issue Feb 23, 2016 · 3 comments
Labels

Comments

@soyvv
Copy link

soyvv commented Feb 23, 2016

Hi folks,
Recently we encountered some buggy behavior of our program, which turned out to be a Jep issue. Whenever we try to retrieve a dictionary containing None values from jep (from python space to Java space), what we get is a null (instead of a dictionary with Null values, as one would expect).

I created a small program to reproduce this, as follows:

public class JEPTest {
    public static void main(final String[] args) {
        try {
            final Jep jep = new Jep(false);
            jep.eval("x = {'abc': 111, 'bcd': '222', 'cde': None}");
            jep.eval("def gx():\n\treturn x");
            final Object x = jep.getValue("x");
            final Object xs = jep.invoke("gx");
            System.out.println(x);  // print null
            System.out.println(xs);  // print null
            jep.close();
        }catch (final JepException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

in the case of both println I got a null.
I'm using Jep 3.4.1, python 2.7.10 and jdk1.8.

Please kindly advise:) Thank you so much!

Zhikai

@ndjensen
Copy link
Member

Thanks for reporting the issue and providing a test case! That's definitely a problem, I will work on fixing it. I was getting close to releasing 3.5, do you need this fixed on 3.4 also?

ndjensen added a commit that referenced this issue Feb 24, 2016
Change-Id: Ib836eed7e2d8f68449ff8e853426401e4af2e6a6
@ndjensen
Copy link
Member

Fixed on dev_3.5 branch. 3.5 will be released this weekend hopefully.

@ndjensen
Copy link
Member

This is fixed in 3.5.

ndjensen added a commit that referenced this issue May 11, 2016
Change-Id: I9207270c07f91392507dc4cb2d1ab49bb4f5f4eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants