Title: shebang line invalid on Linux
Type: crash Severity: normal
Components: Versions: Jython 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jeff.allen Nosy List: eaaltonen, jeff.allen
Priority: normal Keywords: test failure causes

Created on 2018-09-25.07:22:07 by jeff.allen, last changed 2018-11-04.16:05:34 by jeff.allen.

File name Uploaded Description Edit Remove eaaltonen, 2018-10-01.11:21:35
msg12121 (view) Author: Jeff Allen (jeff.allen) Date: 2018-09-25.07:22:06 appears broken on Linux by the shebang line:

#!/usr/bin/env python2.7 -E

This doesn't work because a shebang is not processed like a shell command (see env receives everything after the space as one argument and you get the message that it cannot find the file "python2.7 -E".

An option -S (--split-string) is documented that addresses the problem, but it doesn't work on my Linux system. I could maybe install a later env, but then it will fail for anyone who hasn't done that with "invalid option -- 'S'".

This mostly does not show in a development environment because dist/bin/jython means the shell script version, but it fails in tests that explicitly ask for (test_jython_launcher).
msg12123 (view) Author: Jeff Allen (jeff.allen) Date: 2018-09-27.07:25:18
Assuming env is there for a good reason, and it has to work across Unix-like OSes, I don't see any better course of action than to remove the -E.

Insulation from the environment is desirable(why not -S or -s too?) but until there's a "system python" we can't get it like this.

We don't see this failure on the CI because the test_jython_launcher does not run. (Not sure why.)
msg12130 (view) Author: (eaaltonen) Date: 2018-10-01.11:21:35
You can get the "-E" option if you don't mind calling an intermediate script to do so. The attached should do the job (more or less).
msg12137 (view) Author: Jeff Allen (jeff.allen) Date: 2018-10-13.17:10:18
It crossed my mind to add further layer of wrapping, but I thought I'd wait to see if there was an actual problem.
Date User Action Args
2018-11-04 16:05:34jeff.allensetstatus: pending -> closed
2018-10-13 17:10:18jeff.allensetmessages: + msg12137
2018-10-01 11:21:36eaaltonensetfiles: +
nosy: + eaaltonen
messages: + msg12130
2018-09-27 07:25:19jeff.allensetstatus: open -> pending
assignee: jeff.allen
resolution: fixed
messages: + msg12123
2018-09-25 07:22:07jeff.allencreate