(original) (raw)

changeset: 79872:8afa3ce5ff3e user: Antoine Pitrou solipsis@pitrou.net date: Sun Oct 21 16:33:33 2012 +0200 files: Misc/NEWS Modules/posixmodule.c description: Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle. Patch by Atsuo Ishimoto. diff -r cf3a739345c6 -r 8afa3ce5ff3e Misc/NEWS --- a/Misc/NEWS Sun Oct 21 14:15:06 2012 +0200 +++ b/Misc/NEWS Sun Oct 21 16:33:33 2012 +0200 @@ -59,6 +59,9 @@ Library ------- +- Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle. + Patch by Atsuo Ishimoto. + - Issue #16220: wsgiref now always calls close() on an iterable response. Patch by Brent Tubbs. diff -r cf3a739345c6 -r 8afa3ce5ff3e Modules/posixmodule.c --- a/Modules/posixmodule.c Sun Oct 21 14:15:06 2012 +0200 +++ b/Modules/posixmodule.c Sun Oct 21 16:33:33 2012 +0200 @@ -1390,7 +1390,7 @@ } /* Grab GetFinalPathNameByHandle dynamically from kernel32 */ -static int has_GetFinalPathNameByHandle = 0; +static int has_GetFinalPathNameByHandle = -1; static DWORD (CALLBACK *Py_GetFinalPathNameByHandleW)(HANDLE, LPWSTR, DWORD, DWORD); static int @@ -1401,7 +1401,7 @@ DWORD); /* only recheck */ - if (!has_GetFinalPathNameByHandle) + if (-1 == has_GetFinalPathNameByHandle) { hKernel32 = GetModuleHandleW(L"KERNEL32"); *(FARPROC*)&Py_GetFinalPathNameByHandleA = GetProcAddress(hKernel32, /solipsis@pitrou.net