You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use FindFirstFile in ntpath.realpath() when access is denied #82367
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2019-09-16.12:53:56.807>labels= ['3.8', '3.9', 'OS-windows']
title='Use FindFirstFile in ntpath.realpath() when access is denied'updated_at=<Date2019-09-16.12:56:41.984>user='https://github.com/zooba'
There remains a case in ntpath.realpath() where a (handled) ERROR_ACCESS_DENIED or ERROR_SHARING_VIOLATION will break out of traversing a series of paths.
However, in this case (in os.stat(), for example), we could request the real name of the file from the directory using FindFirstFileW. This would correct the case and remove any path shortening (e.g. LONGFI~1 to LongFilename) without needing to directly access the file.
Activity
zooba commentedon Sep 16, 2019
There remains a case in ntpath.realpath() where a (handled) ERROR_ACCESS_DENIED or ERROR_SHARING_VIOLATION will break out of traversing a series of paths.
However, in this case (in os.stat(), for example), we could request the real name of the file from the directory using FindFirstFileW. This would correct the case and remove any path shortening (e.g. LONGFI~1 to LongFilename) without needing to directly access the file.
zooba commentedon Sep 16, 2019
See bpo-38081 and PR 16156 for related discussion and changes.
Merge branch 'python:main' into pythongh-82367-use-findfirstfile-in-n…
pythongh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (p…
pythongh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (p…
pythongh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (p…
gh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (GH-11…
zware commentedon Oct 5, 2023
Completed by @moonsikpark in GH-110298. Thanks, Moonsik!
pythongh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (p…