Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
f00e76ca
Unverified
Kaydet (Commit)
f00e76ca
authored
Şub 02, 2018
tarafından
Joffrey F
Kaydeden (comit)
GitHub
Şub 02, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1897 from docker/c5618-negative-mtime-tar
Add workaround for bpo-32713
üst
05d34ed1
04bf470f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
utils.py
docker/utils/utils.py
+4
-0
utils_test.py
tests/unit/utils_test.py
+12
-0
No files found.
docker/utils/utils.py
Dosyayı görüntüle @
f00e76ca
...
@@ -107,6 +107,10 @@ def create_archive(root, files=None, fileobj=None, gzip=False):
...
@@ -107,6 +107,10 @@ def create_archive(root, files=None, fileobj=None, gzip=False):
# ignore it and proceed.
# ignore it and proceed.
continue
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
:
if
constants
.
IS_WINDOWS_PLATFORM
:
# Windows doesn't keep track of the execute bit, so we make files
# Windows doesn't keep track of the execute bit, so we make files
# and directories executable by default.
# and directories executable by default.
...
...
tests/unit/utils_test.py
Dosyayı görüntüle @
f00e76ca
...
@@ -995,6 +995,18 @@ class TarTest(unittest.TestCase):
...
@@ -995,6 +995,18 @@ class TarTest(unittest.TestCase):
tar_data
=
tarfile
.
open
(
fileobj
=
archive
)
tar_data
=
tarfile
.
open
(
fileobj
=
archive
)
assert
sorted
(
tar_data
.
getnames
())
==
[
'bar'
,
'foo'
]
assert
sorted
(
tar_data
.
getnames
())
==
[
'bar'
,
'foo'
]
def
tar_test_negative_mtime_bug
(
self
):
base
=
tempfile
.
mkdtemp
()
filename
=
os
.
path
.
join
(
base
,
'th.txt'
)
self
.
addCleanup
(
shutil
.
rmtree
,
base
)
with
open
(
filename
,
'w'
)
as
f
:
f
.
write
(
'Invisible Full Moon'
)
os
.
utime
(
filename
,
(
12345
,
-
3600.0
))
with
tar
(
base
)
as
archive
:
tar_data
=
tarfile
.
open
(
fileobj
=
archive
)
assert
tar_data
.
getnames
()
==
[
'th.txt'
]
assert
tar_data
.
getmember
(
'th.txt'
)
.
mtime
==
-
3600
class
ShouldCheckDirectoryTest
(
unittest
.
TestCase
):
class
ShouldCheckDirectoryTest
(
unittest
.
TestCase
):
exclude_patterns
=
[
exclude_patterns
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment