Repository navigation
Update to darkseid 9.0.0 - #278
Merged
Merged
Conversation
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
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.
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 newmax_sizeparameter (default 256 MiB per file). Oversized files raise the newArchiverFileTooLargeError, a subclass ofArchiverReadError.ComicInfo.xmlandMetronInfo.xmlare read with a tighter 10 MiB limit.This API change only breaks custom
Archiversubclasses. metron-tagger has none and never callsread_file()directly, and the existingArchiverReadErrorhandler infilesorter.pyalso catches the new error.Changes
darkseidrequirement to>=9.0.0and updateuv.lock.Comic.get_page()returnsNonewhen a page can't be read, which now includes pages over the size limit. Before, aNonepage only worked because an emptyBytesIOhappened to raise an image error that was already caught. The code now checks forNoneexplicitly:Duplicates._calculate_image_hash()takesbytes | Noneand returnsNonefor unreadable pages.CoverHashMatcher.get_comic_cover_hash_cached()reports "Unable to get cover hash." when the cover is missing.Nonepage data in duplicate hashing.Behavior notes
Comic.validate_metadata()now returnsUNKNOWNon read errors instead of raisingAttributeError. With--validate, such files are reported as not valid, and removed if the user asked to remove invalid metadata.