OS X import bug?

Manoj Plakal terabaap at yumpee.org
Thu Jan 24 13:58:01 EST 2002


Hello,

I've just noticed a weird problem with importing modules
on MacOS X 10.1 and Python 2.2.

Say I have two modules foo and bar, both of which
are built with a common file baz.c with some variables
defined in it.

I make a setup.py which specifies that module foo
is built from foomodule.c and baz.c, and module bar
is built from barmodule.c and baz.c.

On Red Hat Linux 7.2 with Python 2.2, this builds fine and I
can import both foo and bar into the same interpreter session.

On OS X 10.1 with Python 2.2, this builds fine but I can
only import *ONE* of foo or bar into the same interpreter
session. E.g., if I import foo first and then bar,
Python craps out saying "Failure linking new module".
Similary for bar first and then foo.

This is both with a version built from the 2.2 source
release, as well as a binary version from Fink
(fink.sourceforge.net).

I've attached the files which can be used to reproduce
this: setup.py, foomodule.c, barmodule.c, baz.c. In
case the attachments don't work, you can grab them
off the web: http://yumpee.org/python/setup.py
http://yumpee.org/python/foomodule.c
http://yumpee.org/python/barmodule.c
http://yumpee.org/python/baz.c

Is this a bug? Undefined behavior? Feature?
Is it a fluke that it works on Linux?

If someone else with OS X can reproduce this error,
(and people on other OSes can confirm that
it's working), that would be great ...

Manoj

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: setup.py
URL: <http://mail.python.org/pipermail/python-list/attachments/20020124/b9a7e773/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: foomodule.c
URL: <http://mail.python.org/pipermail/python-list/attachments/20020124/b9a7e773/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: barmodule.c
URL: <http://mail.python.org/pipermail/python-list/attachments/20020124/b9a7e773/attachment-0001.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: baz.c
URL: <http://mail.python.org/pipermail/python-list/attachments/20020124/b9a7e773/attachment-0002.c>


More information about the Python-list mailing list