Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TarFile.add: don't add recursively #1371

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

manics
Copy link
Member

@manics manics commented Sep 15, 2024

exclude_paths lists files and directories individually:
https://github.com/docker/docker-py/blob/7.1.0/docker/utils/build.py#L41-L48

TarFile.add defaults to recursive=True, leading to duplicate files being added. This may cause
https://github.com/manics/repo2podman/blob/141bf4f5902f58ac25ad9302eae23437e1d41e54/repo2podman/podman.py#L459-L460
to fail with PermissionError: [Errno 13] Permission denied: when it tries to overwrite the file that was just extracted with a duplicate copy (possible race condition?)

files and directories are already listed individually, recursive causes duplicate files to be added
@manics manics added the bug label Sep 15, 2024
@manics manics changed the title tar: don't add recursively TarFile.add: don't add recursively Sep 15, 2024
@minrk minrk merged commit 239c4f5 into jupyterhub:main Sep 16, 2024
18 checks passed
@manics manics deleted the tarfile-not-recursive branch September 16, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants