Python version: 3.6.5
Werkzeug version: 0.15.4
The change made as a result of this PR, #1242, causes inconsistent behaviour when specifying how a script should be run.
sys.executable might not (validly) equal the file's shebang.
For example, a developer might want to test their program with a different version of python, or run under a different environment to where the program would be deployed.
The biggest use case is running a script with a debugger, as seen with this issue: #1493
The developer shouldn't be forced to change shebangs or to change the execute permissions of the file to make it work.
In summary, if an executable is specified, then that executable should be used; regardless of the file's shebang.
Since the intention was for this to work with NixOS, I propose that if the functionality is to remain then it should be exclusive to NixOS (where it was pointed out on the PR that it seems to be a problem with the OS), similarly to Windows.
Python version:
3.6.5Werkzeug version:
0.15.4The change made as a result of this PR, #1242, causes inconsistent behaviour when specifying how a script should be run.
sys.executablemight not (validly) equal the file's shebang.For example, a developer might want to test their program with a different version of python, or run under a different environment to where the program would be deployed.
The biggest use case is running a script with a debugger, as seen with this issue: #1493
The developer shouldn't be forced to change shebangs or to change the execute permissions of the file to make it work.
In summary, if an executable is specified, then that executable should be used; regardless of the file's shebang.
Since the intention was for this to work with NixOS, I propose that if the functionality is to remain then it should be exclusive to NixOS (where it was pointed out on the PR that it seems to be a problem with the OS), similarly to Windows.