Skip to content

Update to darkseid 9.0.0 - #278

Merged
bpepple merged 2 commits into
mainfrom
darkseid-9.0.0
Oct 13, 2026
Merged

bpepple merged 2 commits into
mainfrom
darkseid-9.0.0

Conversation

@bpepple

@bpepple bpepple commented Oct 13, 2026

Copy link
Copy Markdown
Member

Summary

Updates darkseid from 8.4.1 to 9.0.0 and makes page hashing handle unreadable pages explicitly.

darkseid 9.0.0 API change

darkseid#253 limits uncompressed archive reads to guard against decompression bombs:

  • Archiver.read_file() has a new max_size parameter (default 256 MiB per file). Oversized files raise the new ArchiverFileTooLargeError, a subclass of ArchiverReadError.
  • ComicInfo.xml and MetronInfo.xml are read with a tighter 10 MiB limit.

This API change only breaks custom Archiver subclasses. metron-tagger has none and never calls read_file() directly, and the existing ArchiverReadError handler in filesorter.py also catches the new error.

Changes

  • Raise the darkseid requirement to >=9.0.0 and update uv.lock.
  • Comic.get_page() returns None when a page can't be read, which now includes pages over the size limit. Before, a None page only worked because an empty BytesIO happened to raise an image error that was already caught. The code now checks for None explicitly:
    • Duplicates._calculate_image_hash() takes bytes | None and returns None for unreadable pages.
    • CoverHashMatcher.get_comic_cover_hash_cached() reports "Unable to get cover hash." when the cover is missing.
  • Add a test for None page data in duplicate hashing.

Behavior notes

  • Metadata files over 10 MiB now read as empty metadata.
  • Comic.validate_metadata() now returns UNKNOWN on read errors instead of raising AttributeError. With --validate, such files are reported as not valid, and removed if the user asked to remove invalid metadata.
  • darkseid 9.0.0 drops Python 3.10. metron-tagger already requires 3.11 or later, so nothing changes here.

darkseid 9.0.0 limits the uncompressed size of archive reads (Metron-Project/darkseid#253). Comic.get_page() returns None for pages over the limit. Before, a None page only worked because an empty BytesIO
happened to raise an image error that was already caught. Check for None explicitly instead.

- Return None from Duplicates._calculate_image_hash() for unreadable pages
- Handle a missing cover in CoverHashMatcher.get_comic_cover_hash_cached()
- Add test for None page data in duplicate hashing
@bpepple bpepple self-assigned this Oct 13, 2026
@bpepple bpepple added dependencies Pull requests that update a dependency file patch Backwards-compatible fix; bumps the patch version labels Oct 13, 2026
@bpepple
bpepple merged commit 4a27f83 into main Oct 13, 2026
11 checks passed
@bpepple
bpepple deleted the darkseid-9.0.0 branch October 13, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file patch Backwards-compatible fix; bumps the patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant