Red Hat Bugzilla – Bug 461483
E: non-executable-script in site-packages
Last modified: 2009-02-23 23:58:54 EST
Description of problem:
rpmlint flags non-executable Python files with a shebang under site-packages as an error.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build a package that puts a non-executable file with a shebang in site-packages.
2. Run rpmlint on it.
package.arch: E: non-executable-script /usr/lib/pythonX.Y/site-packages/file.py 0644
$ rpmlint -I non-executable-script
This text file contains a shebang or is located in a path dedicated for
executables, but lacks the executable bits and cannot thus be executed. If
the file is meant to be an executable script, add the executable bits,
otherwise remove the shebang or move the file elsewhere.
So, in a sense, not a bug. On the other hand, rpmlint already makes a (disputed) exception for *.pm perl modules and ignores the shebang in them.
What's the use case of putting a shebang in a *.py installed in python lib dirs which is not executed using the shebang (because the file is not executable)? Do some python command line options present in the shebang line take effect for the file even when the file is loaded as a library or something?
(In reply to comment #1)
> What's the use case of putting a shebang in a *.py installed in python lib dirs
> which is not executed using the shebang (because the file is not executable)?
There isn't one. Nonetheless, lots of people put it there by sheer force of habit, and having to add a sed command to the spec in order to strip it is... less than amusing.
In that case, not a bug: if there's no advantage in putting the shebang in, the only thing it does is potentially confuse people and thus the files would be better off without it.
If sed'ing them out is annoying, another approach could be just to ignore the rpmlint output about this for the moment and ask upstream to take the shebang out, that'd eventually trickle down to the packaged version.
Thanks for the bug report everyone.
I've fixed cola's sources to no longer contain the shebang lines so that this will no longer be a problem in the future.