This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients aeros, eryksun, miss-islington, paul.moore, steve.dower, tim.golden, vstinner, xtreak, zach.ware
Date 2020-04-13.19:35:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586806507.83.0.918119325398.issue40214@roundup.psfhosted.org>
In-reply-to
Content
> You mean the CI agent is doing it? Because there's nowhere in 
> Python that should be doing it.

The ProcessParameters->DllPath value is inherited until a process in the tree reverts to the original search path via SetDllDirectoryW(NULL), so it can be any ancestor process, not just the immediate parent process.

> I'd rather not blanket change this option in the test suite (except to 
> turn it on :) ), so that code snippet probably needs to shrink down 
> into a one-liner that can go with the "-c" just for these tests.

The test could call GetDllDirectoryW [1] to save and restore the previous value. Unfortunately, GetDllDirectoryW returns 0 for both the default case (NULL) and when the working directory is disabled by setting an empty string (""). It would have to assume one or the other.

Otherwise if you just want a one-liner: "import ctypes; ctypes.windll.kernel32.SetDllDirectoryW(None)".

[1]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getdlldirectoryw
History
Date User Action Args
2020-04-13 19:35:07eryksunsetrecipients: + eryksun, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, miss-islington, xtreak, aeros
2020-04-13 19:35:07eryksunsetmessageid: <1586806507.83.0.918119325398.issue40214@roundup.psfhosted.org>
2020-04-13 19:35:07eryksunlinkissue40214 messages
2020-04-13 19:35:07eryksuncreate