Fix backup export abort on NULL attach_file_name - #331
Open
Flerpharos wants to merge 1 commit into
Open
Conversation
…p export _backup_tree called Path(part['attach_file_name']).name unconditionally for attachment parts, so a NULL attach_file_name in the backup database raised TypeError and aborted the entire backup-source export. Fall back to a generated name based on the part id when the column is NULL.
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.
Fixes #324
Summary
_backup_treecalledPath(part['attach_file_name']).nameunconditionally for attachment parts (part_type == 2). A backupdb.sqlite3whose attachmententry_parthasattach_file_nameNULL madePath(None)raiseTypeError, aborting the entire backup-source export instead of degrading gracefully for that one attachment. Now falls back tof"attachment_{part['id']}"when the column is NULL.Test plan
uv run pytest --ignore=tests/test_integration.py -q(432 passed)uv run ruff check .test_backup_tree_generates_name_for_null_attach_file_namecovers a NULLattach_file_nameend to end (export tree build + write), asserting the generated filename and metadata.