[issue32516] Add a shared library mechanism for win32

Nathaniel Smith report at bugs.python.org
Tue Jan 16 20:12:44 EST 2018


Nathaniel Smith <njs at pobox.com> added the comment:

Steve said:
> The import hook was my proposal to let you only preload DLLs when the extension module is being loaded, rather than having to load all the DLLs on the first "import scipy" just in case one of its submodules gets imported later. A hook can trigger on a specific module.

That's a good point: we could write an import hook that examines each .pyd before it's loaded, and then preloads just the .dlls that it's looking for. But... that's literally reimplementing what the normal DLL loader does. If we can get the normal DLL loader to work, it's probably going to be simpler. And so long as we're talking specifically about the case where it's a directory we control and that only contains .dlls with mangled names, then it seems fine to me. (And maybe Ray will have to hold his nose, but, well, you know. That's programming sometimes.)

xoviat said:
> This is what ray said:
> "Please do not do this. Importing a specific module should not modify the way that process loads subsequent DLLs."

I'm not sure what Ray's worried about exactly, but I don't see anything in his comment that makes me think moving the DLL path manipulation code into the interpreter will make him happier.

I think this can be closed.

----------

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


More information about the Python-bugs-list mailing list