Skip to content

Fix pathlib.Path.copy() Windows privilege errors with copyfile2 fallback #139134

@dynamicy

Description

@dynamicy

Feature or enhancement

Proposal:

Summary

Fix pathlib.Path.copy() failing on Windows when copying files that require elevated privileges (e.g., hidden or system files) by adding a fallback mechanism when copyfile2 encounters privilege-related errors.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions