[Pythonmac-SIG] python package module name collision

Bob Ippolito bob@redivi.com
Sat, 13 Jul 2002 08:53:17 -0400


I had fixed this issue in my version of Python by using apple's libdl 
wrapper (they call it libcompat or something) and dynload_shlib instead 
of the NeXT one.. but, I was pretty sure that they fixed dynload_next a 
couple months ago?  I definitely brought this one up on the python lists 
around December/January, I'd imagine such an important issue would be 
fixed by now.

-bob

On Friday, July 12, 2002, at 11:20 AM, Greg Welch wrote:

> I am using Python 2.2.1-6 (from Fink) on OS X 10.1.5. A colleague (Gary
> Bishop) and I have found what seems to be a bug in that version of 
> Python on
> the Mac. I have verified it in the stock tgz release of 2.2.1. The 
> problem
> does not seem to occur w/ the same Python under Windows (Cygwin).
>
> I have made a tiny tgz archive with code that illustrates the problem. 
> The
> file is at
>
>     http://mac-welch.cs.unc.edu/~welch/tmp/samename.tgz
>
> Just unpack, "cd samename," and "sudo python setup.py install."
>
> The problem occurs when (it seems) if you have two *different* extension
> packages ("Package_1" and "Package_2" in my example) that use different
> shared library modules that have the *same* name ("samename.so" in my
> example).
>
> If you import "Package_1" Python loads *its* respective "samename" 
> module
> just fine. However if you then load "Package_2" Python does *not* load 
> *its*
> "samename" module. It apparently thinks it has already has "samename"
> leftover from the previous load of "Package_1".
>
> FYI, I discovered the problem when trying to build PyOpenGL, which I 
> think I
> successfully did, working from the PyOpenGL part of Bob Ippolito's
> "ultramega" source package (http://redivi.com/~bob/). Unfortunately the
> PyOpenGL code (we discovered) has shared libraries called 
> "__init___.so" in
> *both* the OpenGL.GL and OpenGL.GLU
>
> Here is example session where I import Package_1, then Package_2, then
> restart python and import in the opposite order. In each case you can 
> see
> second import runs the same init module.
>
> [mac-welch] welch% python
> Python 2.2.1 (#1, 07/10/02, 10:09:28)
> [GCC Apple cpp-precomp 6.12] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> Welcome to Lazy Python.  Type "help LazyPython" for help.
>>>> import Package_1
> Init samename from Package_1
>>>> import Package_2
> Init samename from Package_1
>>>>
> [mac-welch:lib/python2.2/site-packages] welch% python
> Python 2.2.1 (#1, 07/10/02, 10:09:28)
> [GCC Apple cpp-precomp 6.12] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> Welcome to Lazy Python.  Type "help LazyPython" for help.
>>>> import Package_2
> Init samename from Package_2
>>>> import Package_1
> Init samename from Package_2
>>>>
> [mac-welch] welch%
>
>
>    ________
>
> Gregory F. Welch
> Research Associate Professor
> Department of Computer Science
> University of North Carolina at Chapel Hill
> http://www.cs.unc.edu/~welch
> welch@cs.unc.edu
> 919-962-1819
>
>
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig