Skip to content

Commit 1ad672b

Browse files
committed
global: clear out pax headers
See the inline comment. The presence of pax headers was causing our attribute/normalization assignments to effectively no-op. And for reasons I don't understand, the mtime on Windows was recorded as 0, despite the pax header being a float value.
1 parent 33c3d72 commit 1ad672b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pythonbuild/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,19 @@ def sort_key(v):
328328
# Normalize attributes on archive members.
329329
for entry in members:
330330
ti = entry[0]
331+
332+
# The pax headers attribute takes priority over the other named
333+
# attributes. To minimize potential for our assigns to no-op, we
334+
# clear out the pax headers. We can't reset all the pax headers,
335+
# as this would nullify symlinks.
336+
for a in ("mtime", "uid", "uname", "gid", "gname"):
337+
try:
338+
ti.pax_headers.__delattr__(a)
339+
except AttributeError:
340+
pass
341+
342+
ti.pax_headers = {}
343+
331344
ti.mtime = DEFAULT_MTIME
332345
ti.uid = 0
333346
ti.uname = "root"

0 commit comments

Comments
 (0)