osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] [Windows] how to prevent the wrong version of zlib1.dll to be used by lib-dynload modules


MSYS2 has two Python ports, msys2 and mingw-w64. I believe Eric was
referring to the mingw-w64 one?

zlib1.dll in C:\Windows\System32 is a packaging error on the part of
whatever put it there and that is what needs to be fixed here. ISVs
need to stop putting anything in that directory as it leads to the
worst form of DLL-hell. You should try to remove that file (back it up
as something may break) and just move on with your work in my opinion.

On Tue, Jul 24, 2018 at 8:15 AM, eryk sun <eryksun at gmail.com> wrote:
> On Mon, Jul 23, 2018 at 2:31 PM, Eric Le Lay <contact at elelay.fr> wrote:
>>
>> I encountered a problem with the Windows packaging of gPodder[1]
>> using msys2:
>
> Are you using regular Windows Python with msys2, or their custom port?
>
> I installed msys2 and used pacman to install Python 3.6. The msys2
> environment names libraries with an "msys-" prefix in the "/usr/bin"
> directory, such as msys-python3.6m.dll, msys-readline7.dll, and
> msys-z.dll (zlib). This is also the application directory of the msys2
> build of Python (i.e. "/usr/bin/python.exe"), so it's the first
> directory in the default DLL search path (ahead of system directories
> and PATH). Unlike Windows Python, msys2 Python does not use the
> alternate search path that replaces the application directory with the
> DLL directory in the search path.
>
> A way to implement this that allows multiple versions of a DLL to be
> loaded in the same process is to use an assembly that includes the DLL
> file in its "<assembly_name>.manifest" file. Add the assembly to the
> extension module's #2 manifest (typically embedded, but can be
> "<module_name>.2"). The system looks for the "<assembly_name>"
> subdirectory in the module directory. In Windows 7+ you can also add a
> probing path in a config file (i.e. "<module_name>.config") [1] that
> extends the SxS search path with up to 9 relative paths, which can be
> up to two levels above the module directory (i.e. "..\..").
>
> [1]: https://docs.microsoft.com/en-us/windows/desktop/SbsCs/application-configuration-files
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/mingw.android%40gmail.com