8000 bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652) · python/cpython@9b49893 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b49893

Browse files
authored
bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
1 parent 9bee32b commit 9b49893

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Lib/ctypes/test/test_loading.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,9 @@ def should_fail(command):
158158
# Relative path (but not just filename) should succeed
159159
should_pass("WinDLL('./_sqlite3.dll')")
160160

161-
# XXX: This test has started failing on Azure Pipelines CI. See
162-
# bpo-40214 for more information.
163-
if 0:
164-
# Insecure load flags should succeed
165-
should_pass("WinDLL('_sqlite3.dll', winmode=0)")
161+
# Insecure load flags should succeed
162+
# Clear the DLL directory to avoid safe search settings propagating
163+
should_pass("windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)")
166164

167165
# Full path load without DLL_LOAD_DIR shouldn't find dependency
168166
should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " +

0 commit comments

Comments
 (0)
0