Mercurial > cpython
changeset 70816:23e14af406df
Merge 3.2 - update to the fix for #12084 [#12084]
author | Brian Curtin <brian@python.org> |
---|---|
date | Tue, 14 Jun 2011 10:06:41 -0500 |
parents | b290ca599df6 (current diff) 1524a60016d0 (diff) |
children | dd775b1561ba |
files | Lib/test/support.py Misc/NEWS Modules/posixmodule.c |
diffstat | 1 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1131,6 +1131,11 @@ get_target_path(HANDLE hdl, wchar_t **ta 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, struc 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, 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(