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.15:32:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335454355.31.0.467731270168.issue14443@psf.upfronthosting.co.za>
In-reply-to
Content
As a post-processing step, rpmbuild will attempt to byte-compile any .py files it encounters, and the results must be listed in the %files manifest. [1]

This is done by the script brp-python-bytecompile, which uses the compileall module.  However, my guess is that it's not using the correct version of python when invoking "compileall", which would explain why it's using the pre-PEP3147 location for the .pyc/.pyo files.

Can you run "file" on the .pyc files and confirm which version of Python they're bytecode for?  My guess is that it's bytecompiled them with /usr/bin/python, rather than your local build of python.

Some notes: In older versions of RPM, brp-python-bytecompile took a single optional argument: the python interpreter to use, defaulting to /usr/bin/python.  I generalized this to support multiple defaults when adding Python 3 support to Fedora: see https://bugzilla.redhat.com/show_bug.cgi?id=531117  That patch could be generalized to support /usr/local/lib.

[1] In Fedora we do this using "__os_install_post", which is defined
in /usr/lib/rpm/redhat/macros (from the redhat-rpm-config package),
which has the invocation of /usr/lib/rpm/brp-python-bytecompile   So it could be possible to override the python interpreter to use by redefining __os_install_post
History
Date User Action Args
2012-04-26 15:32:35dmalcolmsetrecipients: + dmalcolm, ncoghlan, pitrou, tarek, eric.araujo, rosslagerwall
2012-04-26 15:32:35dmalcolmsetmessageid: <1335454355.31.0.467731270168.issue14443@psf.upfronthosting.co.za>
2012-04-26 15:32:34dmalcolmlinkissue14443 messages
2012-04-26 15:32:34dmalcolmcreate