Issue2161

classification
Title: sys.executable equal to None in Jython standalone
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: transistor1, zyasoft
Priority: normal Keywords:

Created on 2014-06-06.20:16:43 by transistor1, last changed 2014-10-05.16:54:41 by zyasoft.

Messages
msg8598 (view) Author: Steve Russo (transistor1) Date: 2014-06-06.20:16:43
Using Jython 2.7b2, standalone.

Development using the popular Flask python module does not work properly in debug mode, because the underlying Werkzeug module uses sys.executable to determine how Python was launched.

Because sys.executable returns None in the standalone version, it causes Werkzeug's debug mode to crash.

For additional details, please see here: https://github.com/mitsuhiko/werkzeug/pull/541#issuecomment-45378614

and here: https://gist.github.com/paolodina/b98c3f3a159024584e13
msg8599 (view) Author: Jim Baker (zyasoft) Date: 2014-06-06.20:31:30
This issue has arisen periodically; see also https://github.com/jythontools/clamp/issues/10#issuecomment-37308700, although I didn't see a bug here for this specific scenario.

One possibility is for org.python.util.jython.main to capture its args and pertinent environment variables (CLASSPATH), create a temporary wrapper executable (ideally binary, not script), and then execute that.

Possible wrappers include http://launch4j.sourceforge.net/
msg9075 (view) Author: Jim Baker (zyasoft) Date: 2014-10-05.16:54:41
Users can ensure sys.executable is set with python.executable, but we can likely do a better job of trying to introspect the environment
History
Date User Action Args
2014-10-05 16:54:41zyasoftsetpriority: normal
messages: + msg9075
2014-06-06 20:31:31zyasoftsetnosy: + zyasoft
messages: + msg8599
2014-06-06 20:16:44transistor1create