summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-06-14 15:06:41 (GMT)
committerBrian Curtin <brian@python.org>2011-06-14 15:06:41 (GMT)
commit4ff1a414f8a755036f889937d2703d6a7388904f (patch)
treef8c5f3ab659b909008a763c172683b6cac849804
parentc9d6a501db51db3038995aa014624f83e860ef63 (diff)
parentc8be84077bbd87e80b1697db6dbfe0fc6e5cbc2b (diff)
downloadcpython-4ff1a414f8a755036f889937d2703d6a7388904f.zip
cpython-4ff1a414f8a755036f889937d2703d6a7388904f.tar.gz
cpython-4ff1a414f8a755036f889937d2703d6a7388904f.tar.bz2
Merge 3.2 - update to the fix for #12084
-rw-r--r--Modules/posixmodule.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 14d18bc..d93d358 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1131,6 +1131,11 @@ get_target_path(HANDLE hdl, wchar_t **target_path)
return FALSE;
buf = (wchar_t *)malloc((buf_size+1)*sizeof(wchar_t));
+ if (!buf) {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+
result_length = Py_GetFinalPathNameByHandleW(hdl,
buf, buf_size, VOLUME_NAME_DOS);
@@ -1165,11 +1170,9 @@ win32_xstat_impl(const char *path, struct win32_stat *result,
const char *dot;
if(!check_GetFinalPathNameByHandle()) {
- /* If the OS doesn't have GetFinalPathNameByHandle, return a
- NotImplementedError. */
- PyErr_SetString(PyExc_NotImplementedError,
- "GetFinalPathNameByHandle not available on this platform");
- return -1;
+ /* If the OS doesn't have GetFinalPathNameByHandle, don't
+ traverse reparse point. */
+ traverse = FALSE;
}
hFile = CreateFileA(
@@ -1263,11 +1266,9 @@ win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result,
const wchar_t *dot;
if(!check_GetFinalPathNameByHandle()) {
- /* If the OS doesn't have GetFinalPathNameByHandle, return a
- NotImplementedError. */
- PyErr_SetString(PyExc_NotImplementedError,
- "GetFinalPathNameByHandle not available on this platform");
- return -1;
+ /* If the OS doesn't have GetFinalPathNameByHandle, don't
+ traverse reparse point. */
+ traverse = FALSE;
}
hFile = CreateFileW(