Skip to content

Replace shutil.copy with shutil.copyfile #9798

@almarouk

Description

@almarouk

shutil.copy copies permission bits which fails when the user who's running the script is trying to use a common cache that was generated by another user, even though the first user has read & write permissions over the cache (through Group permission for example). A real case scenario: submitting jobs on a GPU cluster accessed by multiple users with common cache directory to reduce disk and network usage.

shutil.copy(resolved_module_file, submodule_path / module_file)

Suggested solution: replace shutil.copy by shutil.copyfile which doesn't copy ownership.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions