Skip to content

Set entry type when adding to the tar file#2859

Merged
messense merged 1 commit intoPyO3:mainfrom
e-nomem:fix-tarfile
Nov 18, 2025
Merged

Set entry type when adding to the tar file#2859
messense merged 1 commit intoPyO3:mainfrom
e-nomem:fix-tarfile

Conversation

@e-nomem
Copy link
Copy Markdown
Contributor

@e-nomem e-nomem commented Nov 18, 2025

We need to explicitly set this because the header initializes with all null bytes. When this is not set, the python tarfile module can fail to process the file properly due to treating an entry of type AREGTYPE that also ends in a trailing slash as a directory instead of a regular file under some very specific circumstances.
See python/cpython#141707 for more details

Fixes #2855

@messense messense merged commit 5e42853 into PyO3:main Nov 18, 2025
44 of 45 checks passed
@e-nomem e-nomem deleted the fix-tarfile branch November 18, 2025 16:20
messense pushed a commit that referenced this pull request Nov 19, 2025
We need to explicitly set this because the header initializes with all
null bytes. When this is not set, the python `tarfile` module can fail
to process the file properly due to treating an entry of type `AREGTYPE`
that also ends in a trailing slash as a directory instead of a regular
file under some very specific circumstances.
See python/cpython#141707 for more details

Fixes #2855
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jan 8, 2026
https://build.opensuse.org/request/show/1325799
by user mia + anag_factory
- Update to version 1.11.2 (version bump only)
- Changes in 1.11.1:
  * Fix compiled artifacts being excluded by source path matching
    gh#PyO3/maturin#2910
  * Better error reporting for missing interpreters
    gh#PyO3/maturin#2918
  * Ignore unreadable excluded directories
    gh#PyO3/maturin#2916
- Changes in 1.11.0:
  * Correct tagging for x86_64 iOS simulator wheels.
    gh#PyO3/maturin#2851
  * Bump MSRV to 1.85.0 and use Rust 2024 edition
    gh#PyO3/maturin#2850
  * Upgrade goblin to 0.10
    gh#PyO3/maturin#2853
  * Set entry type when adding to the tar file
    gh#PyO3/maturin#2859
  * Split up module_writer.rs code for code organization
    gh#PyO3/maturin#2857
  * Update environment variables for Android cross-compilation
    support
    gh#PyO3/maturin#2825
  * Upgrade some
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.

twine check error with sdist on version 1.10.1

2 participants