[issue29399] python3.dll export forwarders not resolved in all situations due to missing python3?.dll dependency and DLL search path behavior

Eryk Sun report at bugs.python.org
Thu Feb 25 14:59:34 EST 2021


Eryk Sun <eryksun at gmail.com> added the comment:

> I'm not sure we ever meant for LoadLibrary("python3.dll") to 
> actively load the concrete python3X.dll.

IIRC, Paul Moore was doing something like this to create a script runner that loads "python3.dll", which runs as a regular application, not as a launcher for "python.exe". He didn't want to tie the executable to a particular "python3x.dll" or include the DLLs in the application directory beside the executable. I think he had the embedded distribution(s) in a subdirectory. That's solvable by defining an assembly in the subdirectory, which gets declared in the application manifest. But I think he wanted to keep it simple. So he was just manually loading "python3.dll" and calling GetProcAddress() to look up Py_Main(), which works in Windows 8+. Alternatively, for this kind of a script runner, the script itself can declare the version of Python it needs in a shebang (assuming a single architecture for the executable and Python), and the executable can then manually load the required Python DLL from a subdirectory, or other known location.

----------

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


More information about the Python-bugs-list mailing list