[New-bugs-announce] [issue38186] Use FindFirstFile in ntpath.realpath() when access is denied

Steve Dower report at bugs.python.org
Mon Sep 16 08:53:57 EDT 2019


New submission from Steve Dower <steve.dower at python.org>:

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.

----------
components: Windows
messages: 352543
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Use FindFirstFile in ntpath.realpath() when access is denied
versions: Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38186>
_______________________________________


More information about the New-bugs-announce mailing list