From: Stefan R. <re...@bu...> - 2015-08-30 12:40:27
|
New submission from Stefan Richthofer: 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. ---------- components: Library messages: 10182 nosy: stefan.richthofer severity: normal status: open title: "from distutils import sysconfig" fails if Jython was started via java versions: Jython 2.7 _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue2386> _______________________________________ |