Skip to content

[3.13] gh-83869: tarfile: compute next header offset using pax size for sparse file (GH-18562) - #155868

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-1a52eae-3.13
Aug 15, 2026
Merged

[3.13] gh-83869: tarfile: compute next header offset using pax size for sparse file (GH-18562)#155868
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-1a52eae-3.13

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

In case of a sparse file, the tarinfo.size attribute is set to the sparse
file expanded size (pax attribute GNU.sparse.size or GNU.sparse.size) and
do not correspond to the actual size of the data block. The size of the
data block is specified by the size pax header if present or by the ustar
size header.
Moreover, for GNU sparse 1.0 files, the data block start at the beginning of
the sparse mapping and not after the sparse mapping and so the offset should
be computed from here.
(cherry picked from commit 1a52eae)

Co-authored-by: Valentin Samir valentin.samir@crans.org
Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…r sparse file (pythonGH-18562)

In case of a sparse file, the tarinfo.size attribute is set to the sparse
file expanded size (pax attribute GNU.sparse.size or GNU.sparse.size) and
do not correspond to the actual size of the data block. The size of the
data block is specified by the size pax header if present or by the ustar
size header.
Moreover, for GNU sparse 1.0 files, the data block start at the beginning of
the sparse mapping and not after the sparse mapping and so the offset should
be computed from here.
(cherry picked from commit 1a52eaedce6f1d32cdb5ee18ecec74cfd82d5550)

Co-authored-by: Valentin Samir <valentin.samir@crans.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 15, 2026 19:53
@serhiy-storchaka
serhiy-storchaka merged commit 66861f1 into python:3.13 Aug 15, 2026
44 of 47 checks passed
@miss-islington
miss-islington deleted the backport-1a52eae-3.13 branch August 15, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants