[issue14443] Distutils test_bdist_rpm failure

Dave Malcolm report at bugs.python.org
Thu Apr 26 18:26:09 CEST 2012


Dave Malcolm <dmalcolm at redhat.com> added the comment:

__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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14443>
_______________________________________


More information about the Python-bugs-list mailing list