[QGIS-Developer] What happened to pywin32?

Jürgen E. Fischer jef at norbit.de
Fri Oct 30 07:12:28 PDT 2020


Hi James,

On Thu, 29. Oct 2020 at 15:50:08 -0700, james at shaeffer.co wrote:
> Thank you for the response. I will look into the Qt clipboard.

pywin32 is still included.  But apparently it doesn't work anymore.

I think it's because it modifies the PATH with it's .pth file (via site.py).
And that change happens before QGIS import handler is installed.

QGIS doesn't use PATH directly anymore, but initally calls AddDllDirectory for
all directories in PATH and records the current setting of PATH when QGIS'
import handler is installed.  Any changes to PATH from imports are detected and
AddDllDirectory is called accordingly.

That's apparently the only way to avoid DLLs in system32 to mask DLLs in PATH.

Unfortunately the changes to PATH through .pth happen after QGIS has
AddDllDirectory the initial directories, but before the directories are
recorded.  So on import of win32clipboard it thinks that the directories in
PATH were already fed to AddDllDirectory, which they weren't, doesn't call it
and the load fails.

Fixed in OSGeo4W by moving the DLLs from pywin32_system32 to a directory
already in PATH.


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden            https://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20201030/590d8a99/attachment.sig>


More information about the QGIS-Developer mailing list