Index: Modules/posixmodule.c =================================================================== --- Modules/posixmodule.c (revision 55023) +++ Modules/posixmodule.c (working copy) @@ -948,7 +948,7 @@ char *dot; /* XXX not supported on Win95 and NT 3.x */ if (!Py_GetFileAttributesExA(path, GetFileExInfoStandard, &info)) { - if (GetLastError() != ERROR_SHARING_VIOLATION) { + if (GetLastError() != ERROR_ACCESS_DENIED) { /* Protocol violation: we explicitly clear errno, instead of setting it to a POSIX error. Callers should use GetLastError. */ errno = 0; @@ -986,7 +986,7 @@ WIN32_FILE_ATTRIBUTE_DATA info; /* XXX not supported on Win95 and NT 3.x */ if (!Py_GetFileAttributesExW(path, GetFileExInfoStandard, &info)) { - if (GetLastError() != ERROR_SHARING_VIOLATION) { + if (GetLastError() != ERROR_ACCESS_DENIED) { /* Protocol violation: we explicitly clear errno, instead of setting it to a POSIX error. Callers should use GetLastError. */ errno = 0;