mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #28075: Merge from 3.5
This commit is contained in:
commit
052e4f18c4
3 changed files with 26 additions and 2 deletions
|
@ -1545,7 +1545,9 @@ win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result,
|
|||
/* Either the target doesn't exist, or we don't have access to
|
||||
get a handle to it. If the former, we need to return an error.
|
||||
If the latter, we can use attributes_from_dir. */
|
||||
if (GetLastError() != ERROR_SHARING_VIOLATION)
|
||||
DWORD lastError = GetLastError();
|
||||
if (lastError != ERROR_ACCESS_DENIED &&
|
||||
lastError != ERROR_SHARING_VIOLATION)
|
||||
return -1;
|
||||
/* Could not get attributes on open file. Fall back to
|
||||
reading the directory. */
|
||||
|
@ -1555,7 +1557,7 @@ win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result,
|
|||
if (info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
|
||||
if (traverse) {
|
||||
/* Should traverse, but could not open reparse point handle */
|
||||
SetLastError(ERROR_SHARING_VIOLATION);
|
||||
SetLastError(lastError);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue