mirror of https://github.com/pypa/pip
Merge pull request #9920 from zip-ignore-timestamp
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
This commit is contained in:
commit
9b3bbee2b2
|
@ -0,0 +1 @@
|
|||
Allow ZIP to archive files with timestamps earlier than 1980.
|
|
@ -58,7 +58,10 @@ def _create_standalone_pip() -> Iterator[str]:
|
|||
|
||||
with TempDirectory(kind="standalone-pip") as tmp_dir:
|
||||
pip_zip = os.path.join(tmp_dir.path, "__env_pip__.zip")
|
||||
with zipfile.ZipFile(pip_zip, "w") as zf:
|
||||
kwargs = {}
|
||||
if sys.version_info >= (3, 8):
|
||||
kwargs["strict_timestamps"] = False
|
||||
with zipfile.ZipFile(pip_zip, "w", **kwargs) as zf:
|
||||
for child in source.rglob("*"):
|
||||
zf.write(child, child.relative_to(source.parent).as_posix())
|
||||
yield os.path.join(pip_zip, "pip")
|
||||
|
|
Loading…
Reference in New Issue