[New-bugs-announce] [issue45863] tarfile zeroes ustar header fields unnecessarily
Joshua Root
report at bugs.python.org
Mon Nov 22 03:01:20 EST 2021
New submission from Joshua Root <josh+python at root.id.au>:
When using the pax format, tarfile will zero out the field in the ustar header for any values that are represented with a float, setting the correct value only in the pax header. This mainly seems to apply to the mtime. This behaviour doesn't cause problems when using an unarchiver that understands the pax header, but unarchivers that don't will extract incorrect metadata (most obviously all mtimes set to the epoch). Compatibility with such unarchivers can easily be achieved by rounding the float value to int for the ustar header only, thus at least giving mtimes that are accurate to the nearest second instead of nothing.
----------
components: Library (Lib)
messages: 406744
nosy: jmr
priority: normal
severity: normal
status: open
title: tarfile zeroes ustar header fields unnecessarily
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45863>
_______________________________________
More information about the New-bugs-announce
mailing list