do we need .pyo files?

Toshio Kuratomi a.badger at gmail.com
Wed Apr 18 07:56:46 UTC 2007


On Wed, 2007-04-18 at 07:57 +0100, Paul Nasrat wrote:
> On Mon, 2007-04-16 at 11:32 -0500, Tom "spot" Callaway wrote:
> > I'm admittedly not a low-level python guru, but I think its worth asking
> > the question: Do we need .pyo files in our python packages?
> 
> > Note: I'm not pushing for this change to happen in F-7, far too late in
> > the cycle for that, but if there is merit to it, we should consider it
> > for F-8.
> 
> Could you in the role of packaging committee member comment on 
> 
>  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236535

The bug is upstream:
  python should not generate useless "optimized" byte code. ;-)
Then we wouldn't have to worry about including the .pyo files in the
rpm.  

As long as python allows someone to generate those files they need to be
included in the spec.  It goes beyond SELinux denials in the log -- if
root runs python programs with optimization set then the pyo files are
generated and then left on the filesystem when the package is removed.
If root runs with -OO then the .pyo files are created without docstrings
and that can cause runtime errors if the python program needs those.

This could also be seen as a bug in bdist_rpm:: We include .pyo files so
we can get rid of them when the python package is removed.  bdist_rpm
needs to do the same.

If the bug reporter is worried about disk space, %ghost'ing the .pyos is
another way out of the mess.  It doesn't address all of the issues but
it does take care that no .pyos will be left after the package is
removed.

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20070418/8d4f15db/attachment.sig>


More information about the fedora-devel-list mailing list