Skip to content

gh-136602: Fix wrong offset_data being used for sparse files with an additional size PAX keyword#136621

Open
mxmlnkn wants to merge 1 commit into
python:mainfrom
mxmlnkn:fix-issue-136602
Open

gh-136602: Fix wrong offset_data being used for sparse files with an additional size PAX keyword#136621
mxmlnkn wants to merge 1 commit into
python:mainfrom
mxmlnkn:fix-issue-136602

Conversation

@mxmlnkn

@mxmlnkn mxmlnkn commented Jul 13, 2025

Copy link
Copy Markdown

@mxmlnkn mxmlnkn requested a review from ethanfurman as a code owner July 13, 2025 10:26
@python-cla-bot

python-cla-bot Bot commented Jul 13, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@mxmlnkn

mxmlnkn commented Jul 13, 2025

Copy link
Copy Markdown
Author

_apply_pax_info suppresses all int-conversion errors:

cpython/Lib/tarfile.py

Lines 1628 to 1631 in 85ec3b3

try:
value = PAX_NUMBER_FIELDS[keyword](value)
except ValueError:
value = 0

Is this also necessary for this PR for int(pax_headers["size"])? It seems like it would break more than it helps, or are there use cases for this?

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 27, 2026
@mxmlnkn

mxmlnkn commented Apr 29, 2026

Copy link
Copy Markdown
Author

@ethanfurman Can you please take a look or ping someone else who can look at this?

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Next TAR header offset recomputation is wrong for GNU sparse 1.0 file combined with 'size' PAX header key

1 participant