Skip to content

Conversation

@emontnemery
Copy link
Contributor

@emontnemery emontnemery commented Jan 24, 2025

Allow configuring the record size of a tarfile from the default of 20, as requested in #75955, by adding a new optional parameter blocking_factor to tarfile.TarFile. This matches the --blocking-factor parameter supported by GNU tar.

The blocking_factor is only used to influence the padding when writing to an archive, just as the previously hard coded blocking factor of 20.


📚 Documentation preview 📚: https://cpython-previews--129260.org.readthedocs.build/

errors="surrogateescape", pax_headers=None, debug=None,
errorlevel=None, copybufsize=None, stream=False):
errorlevel=None, copybufsize=None, stream=False,
blocking_factor=None):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of None, should the blocking_factor default to 20, or a constant BLOCKING_FACTOR?

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.

1 participant