Issue 45863: tarfile zeroes ustar header fields unnecessarily
Issue45863
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2021-11-22 08:01 by jmr, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 29693 | merged | jmr, 2021-11-22 08:23 | |
| PR 31232 | merged | miss-islington, 2022-02-09 17:06 | |
| PR 31233 | merged | miss-islington, 2022-02-09 17:06 | |
| PR 31248 | merged | sobolevn, 2022-02-10 08:51 | |
| Messages (7) | |||
|---|---|---|---|
| msg406744 - (view) | Author: Joshua Root (jmr) * | Date: 2021-11-22 08:01 | |
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. |
|||
| msg409228 - (view) | Author: Joshua Root (jmr) * | Date: 2021-12-27 07:11 | |
PR has been marked stale; friendly ping. |
|||
| msg412923 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2022-02-09 17:06 | |
New changeset bf2d44ffb06e8f49aacc6b1c140a6717df5cf897 by Joshua Root in branch 'main': bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693) https://github.com/python/cpython/commit/bf2d44ffb06e8f49aacc6b1c140a6717df5cf897 |
|||
| msg412930 - (view) | Author: miss-islington (miss-islington) | Date: 2022-02-09 17:31 | |
New changeset 42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed by Miss Islington (bot) in branch '3.10': bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693) https://github.com/python/cpython/commit/42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed |
|||
| msg412931 - (view) | Author: miss-islington (miss-islington) | Date: 2022-02-09 17:36 | |
New changeset b0517a12179a9fe444ca6ce1f31c307883e81c0c by Miss Islington (bot) in branch '3.9': bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693) https://github.com/python/cpython/commit/b0517a12179a9fe444ca6ce1f31c307883e81c0c |
|||
| msg412932 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2022-02-09 17:37 | |
Thanks Joshua Root for the bug report and the fix! |
|||
| msg412984 - (view) | Author: miss-islington (miss-islington) | Date: 2022-02-10 09:08 | |
New changeset dee020a6f5bf29f95bec6294da9bcd577114f592 by Nikita Sobolev in branch 'main': Fix sphinx-lint after #31097 and b878b3a (GH-31248) https://github.com/python/cpython/commit/dee020a6f5bf29f95bec6294da9bcd577114f592 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:52 | admin | set | github: 90021 |
| 2022-02-10 09:08:59 | miss-islington | set | messages: + msg412984 |
| 2022-02-10 08:51:43 | sobolevn | set | nosy:
+ sobolevn pull_requests: + pull_request29416 |
| 2022-02-09 17:37:25 | vstinner | set | status: open -> closed resolution: fixed messages: + msg412932 stage: patch review -> resolved |
| 2022-02-09 17:36:28 | miss-islington | set | messages: + msg412931 |
| 2022-02-09 17:31:21 | miss-islington | set | messages: + msg412930 |
| 2022-02-09 17:06:55 | miss-islington | set | pull_requests: + pull_request29403 |
| 2022-02-09 17:06:51 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request29402 |
| 2022-02-09 17:06:29 | vstinner | set | nosy:
+ vstinner messages: + msg412923 |
| 2021-12-27 08:35:25 | kumaraditya | set | nosy:
+ ethan.furman |
| 2021-12-27 07:11:28 | jmr | set | messages: + msg409228 |
| 2021-11-22 08:23:22 | jmr | set | keywords:
+ patch stage: patch review pull_requests: + pull_request27931 |
| 2021-11-22 08:01:20 | jmr | create | |
