[Python-Dev] Removing modules

Mark Hammond mhammond@skippinet.com.au
Fri, 30 Jun 2000 12:49:06 +1000


> Also, can someone explain why importing a third party extension built
> for Python 1.5.x is supposed to result in an immediate crash on
> Windows?  I'd like to explain why this happens...

The 1.5 module is linked against Python15.dll.  When Python.exe (linked
against Python16.dll) starts up, it initializes the Python data structures
in Python16.dll.  When Python then imports foo.pyd (linked against
Python15.dll), it immediately tries to call the functions in that DLL (such
as getting the thread state).  As Python has not been initialized in that
DLL, we immediately die.

Ironically, if Python1x.dll was simply named "Python.dll", there is a
_reasonable_ chance it would work fine.  The cost of doing this tho, is
that you can not have Python 1.5 and Python 1.6 "side by side" on the same
machine.

There are a few possibilities for magic tricks we could pull, but to be
honest Im not too inclined to bother with them myself...  They would also
require a commitment to a fully backwards compatible C API, which I dont
think we can afford to commit to!

Mark.