Skip to content

Ensure that deep paths exist before copying files.#2418

Merged
henryiii merged 1 commit intopypa:mainfrom
freakboy3742:deep-linux-file-copy
May 27, 2025
Merged

Ensure that deep paths exist before copying files.#2418
henryiii merged 1 commit intopypa:mainfrom
freakboy3742:deep-linux-file-copy

Conversation

@freakboy3742
Copy link
Contributor

The OCIContainer handler includes a copy_file utility that can copy single files, and directories. It uses cat to copy a single file; however, if it is provided a deep path to a file (i.e., path/to/file.py), it attempts to copy the file to the destination path without first confirming that the destination path exists.

This PR modifies the containerised copy_file implementation to ensure that the target directory exists when copying a deep file reference

Fixes #2405.

@henryiii henryiii merged commit 2b4a853 into pypa:main May 27, 2025
27 checks passed
@henryiii
Copy link
Contributor

Thanks!

@freakboy3742 freakboy3742 deleted the deep-linux-file-copy branch May 27, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files in subdirs in test-sources fail to copy into the test cwd on linux

2 participants