Hide Forgot
Description of problem: RPM cannot package python files when there is a docstring on the first line. The /usr/lib/rpm/find-provides script parses the first line incorrectly and decides the python file is of type '"""'. This leads to a cryptic and confusing that looks something like this: line 59: Dependency tokens must begin with alpha-numeric, '_' or '/': Version-Release number of selected component (if applicable): rpm-build-4.8.0-1 How reproducible: Fails every time. Steps to Reproduce: 1. Find a python file and edit it such that the first line has a docstring (a string in triple quotes). 2. Pack the file into an rpm 3. Observe that it will fail Actual results: Prints the error below and fails. Dependency tokens must begin with alpha-numeric, '_' or '/' Expected results: The user should be able to build an rpm that contains a python file that starts with a docstring. Additional info: Pylint will complain if a module does not have a docstring so I suspect that it is fairly common to start modules with a docstring. I've looked at other python scripts that get installed with rpms and found that they had # comments at the top of them with licensing information, which allowed them to be packaged with rpm.
This is actually a packaging bug: a file which starts with a docstring should not have executable permissions as such a file cannot be executed. Strip the executable bits off and the issue is gone. Also if you let rpm use the "internal dependency generator" (which is the default on Fedora) instead of the bit-rotten /usr/lib/rpm/(redhat)/find-provides|find-requires scripts it wont trip up with cryptic errors, but nevertheless the right fix is to remove executable bits on files that cannot be directly.