Repository navigation
Conversation
Fields of a pax extended header that were read from an archive no longer have priority over TarInfo attributes that were changed afterwards. Fields set in TarInfo.pax_headers by the program and fields of unchanged members are written as before.
Documentation build overview
150 files changed ·
|
gpshead
marked this pull request as ready for review
November 1, 2026 03:18
A hdrcharset=BINARY field kept in pax_headers from reading was written in front of fields that create_pax_header() encodes in UTF-8, e.g. a changed non-ASCII name. _create_pax_generic_header() adds the field itself whenever it is needed. Also cover the link name in the GNU long header test.
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.
TarInfo.create_pax_header()gave every record inpax_headerspriority over the attributes, including records that were only there because the member was read from an archive, so renaming such a member (or changing its link name, owner, size or mtime) beforeaddfile()was undone in the output._apply_pax_info()now remembers each record it applied together with the attribute value it produced, andcreate_pax_header()drops a record that is still the one that was read when the attribute no longer has that value.Records a program sets in
pax_headersitself keep their priority (test_pax_extended_headeris unchanged), and unchanged members are written as before, including high-precisionmtimerecords. One side effect: a member whose name or link name came from a GNU long name or long link header preceding a paxpathorlinkpathrecord is now rewritten under the nametarfilereports for it.A
hdrcharsetrecord kept from reading is no longer written back. It describes the header it was read from, and_create_pax_generic_header()addshdrcharset=BINARYitself whenever a value needs it. Before,hdrcharset=BINARYcould end up in front of values encoded in UTF-8: already on main for an unchanged member read with a non-UTF-8encoding, and with the rest of this change also for a member renamed to a non-ASCII name.This is meant for main only. Output changes for members whose attributes were changed, and
TarInfogains a_pax_appliedslot, so aTarInfopickled by a patched version would not load in an unpatched one of the same feature release.Fixes #161045
ANT-2026-5IOHYLV3 ANT-2026-6CEC28KL
tarfilewrites a member's old pax records after its name or other attributes are changed #161045