Message10182

Author stefan.richthofer
Recipients stefan.richthofer
Date 2015-08-30.12:40:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440938419.31.0.469798209309.issue2386@psf.upfronthosting.co.za>
In-reply-to
Content
The problem originates in the fact that sys.executable is None if
Jython was started via java -cp jython.jar org.python.util.jython

This makes the line
project_base = os.path.dirname(os.path.realpath(sys.executable))
in sysconfig.py fail.

While it might be intended behavior that sys.executable is None
in this case, to indicate that no Jython-launcher was used, I
think importing sysconfig from distutils should still work.
So I see two ways to improve this situation
(maybe we should even apply both):

1) Set sys.executable to some sane value even if no launcher was used.
Any suggestions what this should be? Path to java-executable?

2) Fix the line
project_base = os.path.dirname(os.path.realpath(sys.executable))
such that it has a fallback in case that sys.executable is None.
E.g. it could parse System.getProperty('java.class.path') to find
the location of jython.jar and infer the launcher-directory from
that path, i.e. by adding "/bin" to the base path of jython.jar.
History
Date User Action Args
2015-08-30 12:40:19stefan.richthofersetrecipients: + stefan.richthofer
2015-08-30 12:40:19stefan.richthofersetmessageid: <1440938419.31.0.469798209309.issue2386@psf.upfronthosting.co.za>
2015-08-30 12:40:19stefan.richthoferlinkissue2386 messages
2015-08-30 12:40:18stefan.richthofercreate