Description of problem: If a shebang is a Python script has more than one option specified, e.g. `#!/usr/bin/python3 -s -tt`, the Python interpreter fails to run the script properly and fails with an error message. Version-Release number of selected component (if applicable): 3.6.1-6.fc26 How reproducible: 100% Steps to Reproduce: 1. Create an executable Python script with more than one option specified in the shebang line, e.g. the given shebang as above. 2. Execute it. Actual results: Unknown option: - usage: /usr/bin/python3 [option] ... [-c cmd | -m mod | file | -] [arg] ... Try `python -h' for more information. Expected results: Script runs normally as someone would expect. Additional information: Python2 is also affected by this. This might affect ealier releases of Fedora / RHEL as well.
This is not a Python issue but a known behaviour of Linux in handling shebangs.[0][1] [0] https://unix.stackexchange.com/questions/63979/shebang-line-with-usr-bin-env-command-argument-fails-on-linux [1] https://stackoverflow.com/questions/4303128/how-to-use-multiple-arguments-with-a-shebang-i-e
Please do not close this bug! The macros provided by the python3-devel package are injecting '/usr/bin/python2 -s' into the shebang of any binary, that gets installed / generated by python-setuptools, causing the shebangs of some scripts hitting the described issue.
The bug as you reported = nothing we can do about it. If you are hitting problems with specific packages and the fact that the macros provided by the python{3,2}-devel package are injecting '/usr/bin/python{3,2} -s' into the shebang, please at least tell us what packages, so we stand a chance to look at it.
Hello Miro, I hit this recently, when rebuilding the fedora-review package. Scripts in upstream sources have the shebang set to '/usr/bin/python -tt', setup tools alter them to '/usr/bin/python2 -s -tt', which is pretty invalid…
(In reply to Björn "besser82" Esser from comment #4) > Hello Miro, > > I hit this recently, when rebuilding the fedora-review package. > > Scripts in upstream sources have the shebang set to '/usr/bin/python -tt', > setup tools alter them to '/usr/bin/python2 -s -tt', which is pretty invalid… In the specfile you can alter the shebangs of the installed files using sed and consolidate the switches into a single element, e.g. "/usr/bin/python2 -stt", which should be parsed correctly.
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '26'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 26 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.