SIGN IN SIGN UP

bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)

Numeric fields of type float, notably mtime, can't be represented
exactly in the ustar header, so the pax header is used. But it is
helpful to set them to the nearest int (i.e. second rather than
nanosecond precision mtimes) in the ustar header as well, for the
benefit of unarchivers that don't understand the pax header.

Add test for tarfile.TarInfo.create_pax_header to confirm correct
behaviour.
(cherry picked from commit bf2d44ffb06e8f49aacc6b1c140a6717df5cf897)

Co-authored-by: Joshua Root <jmr@macports.org>
M
Miss Islington (bot) committed
42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed
Parent: d29bbc2
Committed by GitHub <noreply@github.com> on 2/9/2022, 5:31:12 PM