OS X import bug?

Martin von Loewis loewis at informatik.hu-berlin.de
Thu Jan 24 14:27:44 EST 2002


Manoj Plakal <terabaap at yumpee.org> writes:

> 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.

I believe on OS X 10.1, you need to link with -flat_namespace

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

I'd say it is a feature that it works on Linux, since it allows
independently-developed shared libraries to have symbols in common.
>From a viewpoint of the C programming language, it is an error to have
multiple definitions of the same thing. The question here is what
exactly constitutes a program: a common view is that a
dynamically-loaded shared library is not part of the program, and thus
does not fall under the one-definition-rule. Apparently, Apple does
not share this view.

Regards,
Martin




More information about the Python-list mailing list