[issue36085] Enable better DLL resolution

mattip report at bugs.python.org
Tue Mar 12 03:12:24 EDT 2019


mattip <matti.picus at gmail.com> added the comment:

Correct me if I'm wrong, but once SetDefaultDllDirectories() is used, there is no going back: PATH no longer can change the search path no matter what flags are used with LoadLibrary* calls (see the recent Anaconda issue when they did this and broke NumPy). Assuming that is true, then

> add sys._adddlldirectory() and sys._removedlldirectory() as CPython-specific functions for extending the search path (for use by packages currently modifying PATH at runtime)

Why is this CPython-specific and "private"? It seems like
* it should be a public interface, used by all implementations consistently, as a policy decision for the win32 platform and documented as such
* located in os, much like os.environ (not critical)

There should be some kind of debugging tool for when LoadLibraryEx fails, to indicate what might have gone wrong, perhaps os.getdlldirectory() would be helpful

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36085>
_______________________________________


More information about the Python-bugs-list mailing list