Skip to content

Fix single file download to an output path without a directory - #329

Open
harminius wants to merge 1 commit into
masterfrom
fix/download-file-bare-output-path
Open

harminius wants to merge 1 commit into
masterfrom
fix/download-file-bare-output-path

Conversation

@harminius

@harminius harminius commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

mergin download-file crashed with FileNotFoundError: '' when the output was a bare filename (db.gpkg or ./db.gpkg), because os.path.dirname returns an empty string and os.makedirs("") fails. This became easy to hit with the new --project option, where writing to the current directory is the natural usage.

The output directory is now resolved with os.path.abspath.

The same fix is applied in get_file_diff and create_report, which had the identical pattern.

Seems safe as abspath(p) is normpath(join(os.getcwd(), p)).

related #318

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 37923680629

Coverage increased (+0.03%) to 84.013%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 17 of 17 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 5980
Covered Lines: 5024
Line Coverage: 84.01%
Coverage Strength: 0.84 hits per line

💛 - Coveralls

@MarcelGeo MarcelGeo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

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.

4 participants