python module loading broken on fedora?

Toshio Kuratomi toshio at tiki-lounge.com
Sat Mar 18 06:23:44 UTC 2006


On Fri, 2006-03-17 at 21:32 -0500, Neal Becker wrote:
> I've been trying to track down a problem with python module loading for
> multarch (x86_64).  I think we have a problem.  The discussion so far is
> archived here:
> 
> http://mail.python.org/pipermail/python-dev/2006-March/062462.html
> 
> It seems that the system Fedora has setup here:
> 
> http://fedoraproject.org/wiki/Packaging/Python
> 
> is not really correct.
> 
Summary
=======
Actual failure case:
  One module being split into sitelib and sitearch directories (so on
  x86_64 you have /usr/lib/python2.4/site-packages/foomodule
  and /usr/lib64/python2.4/site-packages/foomodule

Martin v. Löwis says: separate site-arch/site-lib is unsupported and
probably shouldn't be done by Red Hat's python.

Thomas Wouters asks: where are the 32bit compiled modules on a 64-bit
install going to reside?  If they live in /usr/lib/python2.4 then the
64-bit python can't depend on that directory to be "noarch" anymore.  He
also questions whether byte-compiled (.pyc and .pyo) pure python modules
built on one architecture can be safely used on another.

Thoughts
========
We can address the actual failure simply by not splitting one module's
files into site-arch and site-lib.

Except for this corner case, it seems to work, so it's not something we
need to rush into changing.

There is a benefit to having separate site-arch and site-lib directories
*if* site-lib is actually in an architecture independent location (ie:
%{_datadir).  In addition to allowing 32 bit python to use /usr/lib for
compiled files and 64 bit python to use /usr/lib64 it also allows
network mounting the noarch modules between architectures as part
of /usr/share.

Unless it's changed recently, byte-compiled python (pyc and pyo) is arch
independent so concerns about using a python module byte compiled on a
different architecture are groundless.

In order for the actual failure to be resolved, someone would have to
teach the python interpreter to merge site-lib and site-arch before it
knows what symbols are available in a module instead of simply looking
for them in site-lib or site-arch.  What happens if there's conflicts?
What about other directories in the PYTHONPATH?  This step would not be
a minor change.

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


More information about the fedora-devel-list mailing list