2.2 schizo win32 linkage

Gerhard Häring gerhard at bigfoot.de
Sat Apr 6 17:44:59 EST 2002


Robin Becker wrote in comp.lang.python:
> Once again I am being bitten by the choice of location for DLLs/pyds.
> 
> The standard location for win32 extensions is now lib/site-packages, but
> win32 has problems when DLLs live apart from things they link to.
> 
> As example
> 
> I have tcl83.dll & tk83.dll on the path at c:\tcl\bin and c:\Python\DLLs
> _tkinter.pyd is in the latter and presumably is built to work with
> those.
> 
> _imagingtk.pyd lives with PIL under c:\python\lib\site-packages.
> 
> If I import _tkinter first I get the Python Dlls, if I import _imagingtk
> first I get (by accident of environment) the ones from c:\tcl\bin.
> 
> This is a recipe for disaster and is certainly insecure.

Your path settings perhaps are, but that has nothing to do with
Python, only with Windows's search algorithm for DLLs.

> Surely it's not beyond the wit of the developers to come up with a
> scheme that allows us to put all binary extensions and dlls in one
> place.

That's certainly possible. Only I think it's a very bad idea.

The best solution I can think of is for dependencies of an extension
module to place them in the same directory as the extension module:
this is where Windows searches first when trying to satisfy the DLL
dependency.

Gerhard



More information about the Python-list mailing list