Message 82162 - Python tracker (original) (raw)
Note that:
This bug now is tracked in Fedora as https://bugzilla.redhat.com/show_bug.cgi?id=236535
The root of the problem on Fedora is that SElinux will give noisy warnings if python tries to to access or create non-existing foo.pyo for a packaged foo.py. Fedoras solution to this is to always create and package .pyo files to which proper SElinux labels can be attached. The .pyo files are automatically created by /usr/lib/rpm/brp-python-bytecompile behind the scenes when a rpm is build. The problem is that bdist_rpm only knows and lists the .pyo files created by setup and thus doesn't include the brp-python-bytecompile .pyos.
It could be argued that Fedora thus enforces a custom policy on RPM, and it should be Fedoras job to complete that job and patch bdist_rpm to match that custom policy. See the pending patch at https://bugzilla.redhat.com/show_bug.cgi?id=236535#c20
However, it would be nice if Python distutils acknowledged that downstream Fedora has a special need here and helped solving it. Perhaps the patch could be accepted in distutils so that bdist_rpm always runs setup with -O1? Or some other change that could make it easy to configure/customize distutils to match the platforms needs ...
Finally, note that Fedora and Red Hat (and apparently also Suse and Mandriva) uses rpm.org, and rpm5 is a competing fork. (Rpm5 probably claims that rpm.org is the evil guys who forked.)
Tarek, I assume you meant you are creating a Fedora 10 or RHEL/CentOS 5 VM?
I will be glad to help testing and answering further questions.