This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dmalcolm
Recipients dmalcolm, eric.araujo, ncoghlan, pitrou, rosslagerwall, tarek
Date 2012-04-26.16:26:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335457569.36.0.416134845905.issue14443@psf.upfronthosting.co.za>
In-reply-to
Content
__os_install_post is defined within /usr/lib/rpm/redhat/macros and contains this fragment:
    /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} \

Hence it will use %{__python} as the default when byte-compiling.

%__python has the default definition of /usr/bin/python, but this can be overridden, either in the spec file using:
  %global __python some_path_to_the_python_to_use
or in the command-line invocation of rpmbuild:
  rpmbuild --define="__python some_path_to_the_python_to_use"

You can use the --showrc option to rpmbuild to see all of the macro expansions it's using (lots of output).

So if it is indeed using the wrong python executable to do the bytecompiling, the above ought to fix it.  The simplest fix would probably be for bdist_rpm to add:
  --define="__python %s" % sys.executable
to the rpmbuild invocation, I think.
History
Date User Action Args
2012-04-26 16:26:09dmalcolmsetrecipients: + dmalcolm, ncoghlan, pitrou, tarek, eric.araujo, rosslagerwall
2012-04-26 16:26:09dmalcolmsetmessageid: <1335457569.36.0.416134845905.issue14443@psf.upfronthosting.co.za>
2012-04-26 16:26:08dmalcolmlinkissue14443 messages
2012-04-26 16:26:08dmalcolmcreate