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.

classification
Title: Use FindFirstFile in ntpath.realpath() when access is denied
Type: Stage:
Components: Windows Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-09-16 12:53 by steve.dower, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg352543 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-09-16 12:53
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.
msg352544 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-09-16 12:56
See issue38081 and PR 16156 for related discussion and changes.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82367
2019-09-16 12:56:41steve.dowersetmessages: + msg352544
2019-09-16 12:53:57steve.dowercreate