Bug 461483 - E: non-executable-script in site-packages
E: non-executable-script in site-packages
Product: Fedora
Classification: Fedora
Component: rpmlint (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-09-08 10:12 EDT by Ignacio Vazquez-Abrams
Modified: 2009-02-23 23:58 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-09-09 11:57:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ignacio Vazquez-Abrams 2008-09-08 10:12:22 EDT
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):

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 17:07:47 EDT
$ 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?
Comment 2 Ignacio Vazquez-Abrams 2008-09-08 20:09:10 EDT
(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 11:57:53 EDT
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-23 23:58:54 EST
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.

Note You need to log in before you can comment on or make changes to this bug.