Message11493

Author jeff.allen
Recipients jeff.allen, rkanumola
Date 2017-07-22.11:01:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500721297.07.0.959645369432.issue2610@psf.upfronthosting.co.za>
In-reply-to
Content
It's a good sanity check that jython at the prompt gets the right sys.path.

The real question is why your PythonInterpreter gets an incomplete sys.path, *in your Confluence plug-in*.

Here (https://github.com/jythontools/jython/issues/78#issuecomment-309899489) is a simple example in which a Java application creates a PythonInterpreter, and you can see that it gets a working sys.path. (Don't worry about the rest of yiranxijie's issue.)

In your plug-in, or Confluence, I suggest something has prepared the JVM environment incorrectly for the current version of Jython. We've addressed a lot of minor problems to do with launching Jython since 2.5.3 so it would not be surprising to find that your expectations or work-arounds built on 2.5.3 are incorrect for 2.7. Initialisation is driven largely by the contents of the Java properties and some environment variables, so looking at the contents of System.getProperties(), and System.getenv() just before you create the interpreter ought to help you.

Although jython launched at the prompt *is not the place to look for your problem*, it does have some things to help you. One is the --print option in which you can see the java command that would be issued to run Jython proper, and the other is --help that tells you what system properties and environment variables Jython looks at. And finally you can inspect environemnt and properties at the prompt. Compare that with what you get from within your application, just before you (fail to) create the interpreter.
History
Date User Action Args
2017-07-22 11:01:37jeff.allensetmessageid: <1500721297.07.0.959645369432.issue2610@psf.upfronthosting.co.za>
2017-07-22 11:01:37jeff.allensetrecipients: + jeff.allen, rkanumola
2017-07-22 11:01:37jeff.allenlinkissue2610 messages
2017-07-22 11:01:36jeff.allencreate