summaryrefslogtreecommitdiff
path: root/docker/utils
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-02-01 16:51:36 -0800
committerJoffrey F <joffrey@docker.com>2018-02-01 16:51:36 -0800
commit04bf470f6e7e06615be453e1adfe7c656bc5f153 (patch)
tree57980e95ccb77c6852d68c74af6deb1ce63a3e38 /docker/utils
parent05d34ed1fbaa8233a4cf51a0f52b67aef99a9521 (diff)
downloaddocker-py-04bf470f6e7e06615be453e1adfe7c656bc5f153.tar.gz
Add workaround for bpo-32713c5618-negative-mtime-tar
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/utils')
-rw-r--r--docker/utils/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py
index e4e2c0d..b145f11 100644
--- a/docker/utils/utils.py
+++ b/docker/utils/utils.py
@@ -107,6 +107,10 @@ def create_archive(root, files=None, fileobj=None, gzip=False):
# ignore it and proceed.
continue
+ # Workaround https://bugs.python.org/issue32713
+ if i.mtime < 0 or i.mtime > 8**11 - 1:
+ i.mtime = int(i.mtime)
+
if constants.IS_WINDOWS_PLATFORM:
# Windows doesn't keep track of the execute bit, so we make files
# and directories executable by default.