fix(zip): read an entry name with a leading slash as relative - #862
Merged
Conversation
andiwand
force-pushed
the
fix/zip-absolute-entry-name
branch
from
September 8, 2026 18:23
c5deb67 to
5649601
Compare
APPNOTE.TXT 4.4.17.1 makes an entry name relative to the archive root, so a leading slash is read away and a name that is nothing but the root, addressing no entry, is dropped. The reported `.odt` carries the odf manifest's root entry as a real zip entry named "/", which threw before and which LibreOffice refuses too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WR6c2WEdi9553WjWmbxZka
andiwand
force-pushed
the
fix/zip-absolute-entry-name
branch
from
September 8, 2026 18:25
5649601 to
393fb0b
Compare
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.
🤖 Generated with Claude Code
A reported
.odtdid not open: its zip carries the odf manifest's root entry(
manifest:full-path="/") as a real zip entry named/, holding a second copyof
content.xml's bytes.zip::Archive::Entry::path()built aRelPathfromthat name and threw
not a relative path, so the file failed before anydecoding began. LibreOffice refuses the file too — removing that one entry is
what makes
soffice --convert-toload it.APPNOTE.TXT 4.4.17.1 says an entry name is always relative to the archive root,
so a leading slash is malformed and the tolerant read is to drop it. The name
now goes through
Path(...).make_relative(), and a name that is nothing butthe root normalises to the empty path, which addresses no entry —
ZipArchiveskips it.
Nothing else in the corpus moves: a well-formed name is unchanged by
make_relative(), and any input that did carry an absolute name would havethrown before, so none is in there.
The rendered text of the new fixture matches LibreOffice's
.txtexport of thesame file with the stray entry removed, character for character.
Test data
odt/zip-root+entry-1.odt, with the original name recorded inindex.csvand flagged confidential — it is a filled-in police form withpersonal data