summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorJoshua Root <jmr@macports.org>2022-02-09 17:06:19 (GMT)
committerGitHub <noreply@github.com>2022-02-09 17:06:19 (GMT)
commitbf2d44ffb06e8f49aacc6b1c140a6717df5cf897 (patch)
tree3a800a1bc6bf17b549cb2d0e43ff0046835a0baa /Misc
parentc0a5ebeb1239020f2ecc199053bb1a70d78841a1 (diff)
downloadcpython-bf2d44ffb06e8f49aacc6b1c140a6717df5cf897.zip
cpython-bf2d44ffb06e8f49aacc6b1c140a6717df5cf897.tar.gz
cpython-bf2d44ffb06e8f49aacc6b1c140a6717df5cf897.tar.bz2
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2022-02-09-00-53-23.bpo-45863.zqQXVv.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-02-09-00-53-23.bpo-45863.zqQXVv.rst b/Misc/NEWS.d/next/Library/2022-02-09-00-53-23.bpo-45863.zqQXVv.rst
new file mode 100644
index 0000000..3a1335c
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-02-09-00-53-23.bpo-45863.zqQXVv.rst
@@ -0,0 +1 @@
+When the :mod:`tarfile` module creates a pax format archive, it will put an integer representation of timestamps in the ustar header (if possible) for the benefit of older unarchivers, in addition to the existing full-precision timestamps in the pax extended header. \ No newline at end of file