summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-09-17 12:51:14 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-09-17 12:51:14 (GMT)
commit052e4f18c4d1794952b03755ff80aa92b8d19180 (patch)
treef334d0efb6bd66f415c1f44da3d85efb875d54b7 /Modules
parentd508d00919dccbc9dd5d3c86508f2db7a7c753a7 (diff)
parent0b4dc4846b603025ee8da4403e87cad7739ac8f7 (diff)
downloadcpython-052e4f18c4d1794952b03755ff80aa92b8d19180.zip
cpython-052e4f18c4d1794952b03755ff80aa92b8d19180.tar.gz
cpython-052e4f18c4d1794952b03755ff80aa92b8d19180.tar.bz2
Issue #28075: Merge from 3.5
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 84566d8..ba54249 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -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;
}
}