Bug 461483

Summary: E: non-executable-script in site-packages
Product: [Fedora] Fedora Reporter: Ignacio Vazquez-Abrams <ivazqueznet>
Component: rpmlintAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 8CC: davvid, manuel.wolfshant, tmz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-09 15:57:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ignacio Vazquez-Abrams 2008-09-08 14:12:22 UTC
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):
rpmlint-(none):0.83-1.fc8.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Build a package that puts a non-executable file with a shebang in site-packages.
2. Run rpmlint on it.
  
Actual results:
package.arch: E: non-executable-script /usr/lib/pythonX.Y/site-packages/file.py 0644

Expected results:
No output

Additional info:

Comment 1 Ville Skyttä 2008-09-08 21:07:47 UTC
$ rpmlint -I non-executable-script
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?

Comment 2 Ignacio Vazquez-Abrams 2008-09-09 00:09:10 UTC
(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.

Comment 3 Ville Skyttä 2008-09-09 15:57:53 UTC
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.

Comment 4 David Aguilar 2009-02-24 04:58:54 UTC
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.