Repository navigation
Conversation
EbookLib 0.21 (released 2026-11) changed write_epub: the EPUB 3
navigation document is no longer written into the archive, while the
package OPF still lists it in the manifest. Every EPUB produced by
0.21 therefore references EPUB/nav.xhtml without shipping it, and
read_epub raises KeyError before a single chapter is read:
File "ebooklib
eader.py", line 203, in _load_manifest
ei.content = self.read_file(zip_path.join(self.opf_dir, ei.file_name))
...
KeyError: "There is no item named 'EPUB/nav.xhtml' in the archive"
docreader declares "ebooklib>=0.18" with no upper bound, so a fresh
install (or any environment not pinned by uv.lock) gets 0.21 and every
EPUB silently degrades to the ZIP fallback — the contract test
"ZIP fallback only for a missing navigation document" goes red:
before (ebooklib 0.21, fresh install per the unbounded spec):
$ python -m pytest docreader/tests/test_epub_table_pipes.py -q
1 failed, 1 warning in 1.73s
AssertionError: True != False # "trying ZIP fallback" logged for a valid EPUB
after (cap at <0.21, uv.lock resolves 0.20):
$ python -m pytest docreader/tests/test_epub_table_pipes.py -q
2 passed, 2 warnings in 1.40s
uv lock --project docreader --check passes; the locked resolution is
unchanged (0.20), CI keeps using uv sync --locked.
This branch has not been deployed
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.
Observed
EbookLib 0.21 (released 2026-11,
requires-python >=3.10, no moresix) changedwrite_epub: the EPUB 3 navigation document is no longer written into the archive, while the package OPF it writes still listsEPUB/nav.xhtmlin the manifest. Every EPUB produced by 0.21 therefore references a file it never ships, andread_epubraisesKeyErrorbefore a single chapter is read:Minimal check on the same book object:
docreaderdeclaresebooklib>=0.18with no upper bound, so a fresh install — or any environment not pinned byuv.lock— gets 0.21,EPUBParser._parse_epubthrows, and every EPUB silently degrades to the ZIP fallback. The contract test that says "ZIP fallback only for a missing navigation document" goes red:Repro / verification
Before (ebooklib 0.21, fresh install per the unbounded specifier):
After (cap at
<0.21;uv.lockalready resolves 0.20):uv lock --project docreader --checkpasses with the updated specifier, and the locked resolution is unchanged (0.20), so CI'suv sync --lockedkeeps installing exactly what it installs today — the cap only stops unpinned environments from picking up the broken 0.21.