This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年02月22日 23:47 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11248 | closed | v2m, 2018年12月20日 07:34 | |
| Messages (10) | |||
|---|---|---|---|
| msg154018 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年02月22日 23:47 | |
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).
|
|||
| msg222954 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年07月13日 16:42 | |
I'm assuming that this should be treated as an enhancement request. |
|||
| msg297133 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月28日 01:44 | |
Python 3 now uses GetFinalPathNameByHandle()! |
|||
| msg297139 - (view) | Author: Eryk Sun (eryksun) * (Python triager) | Date: 2017年06月28日 02:25 | |
I assume by nt.realpath we're talking about ntpath.realpath. In that case nothing was done to fix this. It's still an alias for ntpath.abspath, which calls GetFullPathNameW. |
|||
| msg297188 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月28日 14:33 | |
Oh, only os.stat() was patched to use GetFinalPathNameByHandle()? It seems like most of the code was already written, so it shouldn't be hard to add a nt.GetFinalPathName() function using the win32_xstat_impl() code (and get_target_path()), to implement a real ntpath.realpath(), no? @Eryk: Are you interested to work on a patch? |
|||
| msg332094 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2018年12月18日 22:38 | |
Any update on this issue? |
|||
| msg332152 - (view) | Author: Vladimir Matveev (v2m) * | Date: 2018年12月19日 17:03 | |
I can give it a try. |
|||
| msg335040 - (view) | Author: Eryk Sun (eryksun) * (Python triager) | Date: 2019年02月07日 20:33 | |
Ping on PR 11248. It would be nice to get this into 3.8. |
|||
| msg335042 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2019年02月07日 22:08 | |
Posted a review. I suggest a few changes for the sake of tidying up, but I agree that I'd like to see more tests added. |
|||
| msg351857 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2019年09月11日 13:13 | |
As of 3.8, it (sort of) does. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58302 |
| 2019年09月11日 13:13:11 | steve.dower | set | status: open -> closed resolution: out of date messages: + msg351857 stage: patch review -> resolved |
| 2019年02月26日 02:32:10 | eryksun | link | issue36112 superseder |
| 2019年02月07日 22:08:46 | steve.dower | set | messages: + msg335042 |
| 2019年02月07日 20:33:37 | eryksun | set | messages: + msg335040 |
| 2019年02月07日 20:20:32 | eryksun | set | nosy:
+ paul.moore, tim.golden, zach.ware, steve.dower components: + Windows |
| 2019年02月07日 20:19:53 | eryksun | set | components: - Windows |
| 2018年12月20日 07:34:22 | v2m | set | keywords:
+ patch stage: needs patch -> patch review pull_requests: + pull_request10488 |
| 2018年12月19日 17:03:44 | v2m | set | nosy:
+ v2m messages: + msg332152 |
| 2018年12月18日 22:38:14 | vstinner | set | messages:
+ msg332094 versions: + Python 3.8, - Python 3.7 |
| 2017年06月28日 14:33:45 | vstinner | set | messages: + msg297188 |
| 2017年06月28日 14:13:19 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2017年06月28日 02:25:56 | eryksun | set | status: closed -> open title: nt.realpath() should use GetFinalPathNameByHandle() when available -> ntpath.realpath() should use GetFinalPathNameByHandle() nosy: + eryksun versions: + Python 3.7, - Python 3.5 messages: + msg297139 resolution: fixed -> (no value) stage: resolved -> needs patch |
| 2017年06月28日 01:44:50 | vstinner | set | status: open -> closed resolution: fixed messages: + msg297133 stage: resolved |
| 2014年07月13日 16:42:31 | BreamoreBoy | set | versions:
+ Python 3.5, - Python 3.3 nosy: + BreamoreBoy messages: + msg222954 type: enhancement |
| 2013年01月03日 01:15:21 | vstinner | set | components: + Windows |
| 2012年02月27日 09:31:35 | petri.lehtinen | set | nosy:
+ petri.lehtinen |
| 2012年02月22日 23:48:11 | vstinner | set | nosy:
+ amaury.forgeotdarc |
| 2012年02月22日 23:47:49 | vstinner | create | |