Message154018
nt.realpath() should use GetFinalPathNameByHandleW() when available, instead of GetFullPathNameW(), to resolve symlinks.
By the way, it's strange that Py_GetFinalPathNameByHandleW() is called with VOLUME_NAME_NT to get the buffer size, and then with VOLUME_NAME_DOS. Is it a bug?
/* We have a good handle to the target, use it to determine the
target path name. */
buf_size = Py_GetFinalPathNameByHandleW(hFile, 0, 0, VOLUME_NAME_NT);
if(!buf_size)
return win32_error_object("GetFinalPathNameByHandle", po);
target_path = (wchar_t *)malloc((buf_size+1)*sizeof(wchar_t));
if(!target_path)
return PyErr_NoMemory();
result_length = Py_GetFinalPathNameByHandleW(hFile, target_path,
buf_size, VOLUME_NAME_DOS);
See also issue #9333 (issue which added os.symlink() on Windows). |
|
Date |
User |
Action |
Args |
2012-02-22 23:47:50 | vstinner | set | recipients:
+ vstinner, pitrou, brian.curtin |
2012-02-22 23:47:50 | vstinner | set | messageid: <1329954470.08.0.180096078595.issue14094@psf.upfronthosting.co.za> |
2012-02-22 23:47:49 | vstinner | link | issue14094 messages |
2012-02-22 23:47:49 | vstinner | create | |
|