Python package packaging question

Nalin Dahyabhai nalin at redhat.com
Mon Feb 2 21:55:58 UTC 2004


On Mon, Feb 02, 2004 at 04:18:09PM -0500, Mihai Ibanescu wrote:
> It may seem like it. .pyc and .pyo files are there for performance 
> reasons. .py files are there, because debugging would be a nightmare 
> otherwise.

The byte-compiled versions will always be generated if you have write
access to the directory.  (This is almost always the case if you happen
to run a script as root.)  If you run a script as root and then attempt
to uninstall the package which includes that script, some directories
which are unique to the package can't be removed because the .pyc and
.pyo files are still there (even though the .py files are now gone).

Some packages include the byte-compiled versions of their scripts to
avoid this.  Personally I think all packages which include python
scripts should include both the .pyc and .pyo files (and that the
default RPM configuration should automate this), but I don't think
there's ever been a consensus on that.

Nalin





More information about the devel mailing list