Skip to content

fix: download file will throw error when dir is empty #13

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

Conversation

jiuker
Copy link

@jiuker jiuker commented Jul 7, 2025

Summary

Details

if we run client like this client.download_file("dir/to-copy.py", "to-copy.py")
will got this

  File "/mnt/d/workspace/pythong/venv/lib/python3.12/site-packages/multistorageclient/providers/s3.py", line 751, in _download_file
    os.makedirs(os.path.dirname(f), exist_ok=True)
  File "<frozen os>", line 225, in makedirs
FileNotFoundError: [Errno 2] No such file or directory: ''

Usage

You can potentially add a usage example below.

# Add a code snippet demonstrating how to use this.

Before your PR is "Ready for review"

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Did you add notable changes to the client (i.e. not related to tooling, CI/CD, etc.) from this PR to .release_notes/.unreleased.md?

Additional Information

  • Related to issue link (an issue is needed to notify us on Slack).

@commiterate
Copy link
Collaborator

Need a rebase so the check workflow runs (bug in our GHA definitions).

fix: download file will throw error when dir is empty
@jiuker jiuker force-pushed the fix-download-file-will-throw-error-when-dir-is-empty branch from 6fb2991 to aa1420b Compare July 15, 2025 00:58
@jiuker
Copy link
Author

jiuker commented Jul 15, 2025

Need a rebase so the check workflow runs (bug in our GHA definitions).

Rebased

@commiterate
Copy link
Collaborator

commiterate commented Jul 15, 2025

Looks like some flakiness with the order glob returns stuff on the GitHub Actions runners. I'll pull this locally to test.

@commiterate
Copy link
Collaborator

Passed. Mirroring the PR internally (moving development to GitHub is the plan later on).

@commiterate
Copy link
Collaborator

commiterate commented Jul 15, 2025

Internally mirrored PR merged. Merged commit ID is 0a5e65874399b339c6ec0a3def6f2c5ebbd8f2b7.

This will be mirrored back to GitHub on the next release.

Note the author information will be wrong due to GitLab making the merging user the squashed + merged commit's author.

@commiterate commiterate changed the title fix: download file will throw error when dir is empty [Merged] fix: download file will throw error when dir is empty Jul 15, 2025
@commiterate commiterate changed the title [Merged] fix: download file will throw error when dir is empty fix: download file will throw error when dir is empty Jul 15, 2025
@commiterate commiterate added the merged Pull request merged label Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged Pull request merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants