Skip to content

Use FindFirstFile in ntpath.realpath() when access is denied #82367

Description

@zooba
BPO 38186
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba

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 = None
closed_at = None
created_at = <Date 2019-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 = <Date 2019-09-16.12:56:41.984>
user = 'https://github.com/zooba'

bugs.python.org fields:

activity = <Date 2019-09-16.12:56:41.984>
actor = 'steve.dower'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2019-09-16.12:53:56.807>
creator = 'steve.dower'
dependencies = []
files = []
hgrepos = []
issue_num = 38186
keywords = []
message_count = 2.0
messages = ['352543', '352544']
nosy_count = 5.0
nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'eryksun', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue38186'
versions = ['Python 3.8', 'Python 3.9']

Linked PRs

Activity

  1. zooba commented on Sep 16, 2019

    @zooba
    MemberAuthor

    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.

  2. zooba commented on Sep 16, 2019

    @zooba
    MemberAuthor

    See bpo-38081 and PR 16156 for related discussion and changes.

  3. transferred this issue fromon Apr 10, 2022
  4. added a commit that references this issue on Oct 3, 2023
  5. added 3 commits that reference this issue on Oct 4, 2023
  6. added a commit that references this issue on Oct 5, 2023
  7. zware commented on Oct 5, 2023

    @zware
    Member

    Completed by @moonsikpark in GH-110298. Thanks, Moonsik!

  8. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions