diff -r 4eee3d738d81 Modules/posixmodule.c --- a/Modules/posixmodule.c Mon Jun 13 16:10:32 2011 -0500 +++ b/Modules/posixmodule.c Tue Jun 14 16:44:36 2011 +0900 @@ -1102,6 +1102,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); @@ -1136,11 +1141,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( @@ -1234,11 +1237,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(