]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
authorSteve Dower <steve.dower@python.org>
Wed, 22 Apr 2020 16:04:46 +0000 (17:04 +0100)
committerGitHub <noreply@github.com>
Wed, 22 Apr 2020 16:04:46 +0000 (17:04 +0100)
Lib/ctypes/test/test_loading.py

index a62044e370af69f10e074d694c289f9aeb127270..5c48b0db4c393956c9caf5f96e1c624c53d03895 100644 (file)
@@ -158,11 +158,9 @@ class LoaderTest(unittest.TestCase):
             # Relative path (but not just filename) should succeed
             should_pass("WinDLL('./_sqlite3.dll')")
 
-            # XXX: This test has started failing on Azure Pipelines CI.  See
-            #      bpo-40214 for more information.
-            if 0:
-                # Insecure load flags should succeed
-                should_pass("WinDLL('_sqlite3.dll', winmode=0)")
+            # Insecure load flags should succeed
+            # Clear the DLL directory to avoid safe search settings propagating
+            should_pass("windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)")
 
             # Full path load without DLL_LOAD_DIR shouldn't find dependency
             should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +