Draft
Conversation
CyMule
added a commit
that referenced
this pull request
Jul 31, 2025
## Problem S3 downloads were sometimes failing with `NotADirectoryError` and `FileExistsError` when S3 buckets contained objects with conflicting naming patterns that cannot be represented in traditional filesystem hierarchies. **Example conflict:** - S3 object: `foo` (file) - S3 object: `foo/documents` (file requiring foo to be a directory) This created a race condition where download order determined success/failure ## Solution Used tempfile to create unique download paths for each S3 object: **Before:** ``` S3: "foo" → Local: /downloads/foo S3: "foo/documents" → Local: /downloads/foo/documents Conflict: foo cannot be both file and directory ``` **After:** ``` S3: "foo" → Local: /downloads/a1b2c3d4e5f6/foo S3: "foo/documents" → Local: /downloads/9g8h7i6j5k4l/documents No conflicts: Each file gets unique directory ``` ## Future Work This PR targets only the s3 downloads. I think it would make sense to use tempfiles for all downloads (as in [PR #571](#571)), but that requires more extensive changes to implement cleanly. This fix provides immediate relief from the path conflict issues while we work on the more comprehensive tempfile solution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.