]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-18819: tarfile: only set device fields for device files (GH-18080)
authorWilliam Chargin <wchargin@gmail.com>
Wed, 12 Feb 2020 19:56:02 +0000 (11:56 -0800)
committerGitHub <noreply@github.com>
Wed, 12 Feb 2020 19:56:02 +0000 (11:56 -0800)
commit674935b8caf33e47c78f1b8e197b1b77a04992d2
treefc7f81510ae2bdf298f3fc8dd2c3d2b7584ebc18
parent4fac7ed43ebf1771a8fe86fdfe7b9991f3be78cd
bpo-18819: tarfile: only set device fields for device files (GH-18080)

The GNU docs describe the `devmajor` and `devminor` fields of the tar
header struct only in the context of character and block special files,
suggesting that in other cases they are not populated. Typical utilities
behave accordingly; this patch teaches `tarfile` to do the same.
Lib/tarfile.py
Lib/test/test_tarfile.py
Misc/ACKS
Misc/NEWS.d/next/Library/2020-01-20-10-06-19.bpo-18819.H4qsoS.rst [new file with mode: 0644]