Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mxmlnkn
Copy link

@mxmlnkn mxmlnkn commented Jul 13, 2025

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

python-cla-bot bot commented Jul 13, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@mxmlnkn
Copy link
Author

mxmlnkn commented Jul 13, 2025

_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?

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