New submission from Joshua Root <josh+pyt...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue45863>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to