bpo-45863: tarfile: don't zero out header fields unnecessarily#29693
Conversation
b6a4c39 to
8aedc8a
Compare
November 22, 2021 09:27
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
Commenting to clear stale flag since this is still awaiting review. |
Sorry, something went wrong.
8aedc8a to
8e5afe3
Compare
February 5, 2022 05:27
|
@vstinner Changes made to address concerns brought up in our conversation on IRC. |
Sorry, something went wrong.
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.
8e5afe3 to
0684c9a
Compare
February 8, 2022 10:22
|
Can you please add a NEWS entry for this change? See for blurb or blurb-it. With no NEWS, I'm ok to merge the change in main, but not to backport it. |
Sorry, something went wrong.
|
Happy to write a NEWS entry, but TBH I was put off by the tool dependencies apparently needed to generate the required filename. |
Sorry, something went wrong.
|
OK, I see now that blurb-it is an option, which is at least a little more convenient than installing blurb locally. |
Sorry, something went wrong.
|
Sorry for manually squashing and force pushing BTW, I initially missed the part in the docs where it says not to. |
Sorry, something went wrong.
…nGH-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 bf2d44f) Co-authored-by: Joshua Root <jmr@macports.org>
…nGH-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 bf2d44f) Co-authored-by: Joshua Root <jmr@macports.org>
) 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 bf2d44f) Co-authored-by: Joshua Root <jmr@macports.org>
) 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 bf2d44f) Co-authored-by: Joshua Root <jmr@macports.org>
|
Thanks! |
Sorry, something went wrong.
…nGH-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 bf2d44f) Co-authored-by: Joshua Root <jmr@macports.org>
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.
https://bugs.python.org/issue45863