Skip to content

fix: create missing parent dirs for -o output path - #286

Open
r3wretrhy wants to merge 1 commit into
linkedin:mainfrom
r3wretrhy:fix/create-output-parent-dirs
Open

r3wretrhy wants to merge 1 commit into
linkedin:mainfrom
r3wretrhy:fix/create-output-parent-dirs

Conversation

@r3wretrhy

Copy link
Copy Markdown

When -o points at a nested path whose parent directories do not exist yet, create_archive raised FileNotFoundError on target.open.

This ensures the parent path exists first (mkdir(parents=True, exist_ok=True)) before opening the output file — matching what maintainer @lorencarvalho noted on #231.

Fixes #231

Test

  • Added test_create_archive_creates_missing_parent_dirs
  • Full suite: PYTHONPATH=src pytest — 60 passed

When -o points at a nested path whose directories do not exist yet,
create_archive raised FileNotFoundError on target.open. Ensure the
parent path exists first.

Fixes linkedin#231
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.

Error if output path doesn't exist

1 participant