[Python-checkins] cpython (merge 3.2 -> default): Merge 3.2 - update to the fix for #12084

brian.curtin python-checkins at python.org
Tue Jun 14 17:06:51 CEST 2011


http://hg.python.org/cpython/rev/23e14af406df
changeset:   70816:23e14af406df
parent:      70813:b290ca599df6
parent:      70815:1524a60016d0
user:        Brian Curtin <brian at python.org>
date:        Tue Jun 14 10:06:41 2011 -0500
summary:
  Merge 3.2 - update to the fix for #12084

files:
  Modules/posixmodule.c |  21 +++++++++++----------
  1 files changed, 11 insertions(+), 10 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1131,6 +1131,11 @@
         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 @@
     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 @@
     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(

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list