Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
be647e28
Kaydet (Commit)
be647e28
authored
Kas 01, 2010
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove extracted trees at the end of the test.
üst
16f344df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
test_tarfile.py
Lib/test/test_tarfile.py
+17
-8
No files found.
Lib/test/test_tarfile.py
Dosyayı görüntüle @
be647e28
...
@@ -355,11 +355,13 @@ class MiscReadTest(CommonReadTest):
...
@@ -355,11 +355,13 @@ class MiscReadTest(CommonReadTest):
# Test if extractall() correctly restores directory permissions
# Test if extractall() correctly restores directory permissions
# and times (see issue1735).
# and times (see issue1735).
tar
=
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
tar
=
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
DIR
=
os
.
path
.
join
(
TEMPDIR
,
"extractall"
)
os
.
mkdir
(
DIR
)
try
:
try
:
directories
=
[
t
for
t
in
tar
if
t
.
isdir
()]
directories
=
[
t
for
t
in
tar
if
t
.
isdir
()]
tar
.
extractall
(
TEMP
DIR
,
directories
)
tar
.
extractall
(
DIR
,
directories
)
for
tarinfo
in
directories
:
for
tarinfo
in
directories
:
path
=
os
.
path
.
join
(
TEMP
DIR
,
tarinfo
.
name
)
path
=
os
.
path
.
join
(
DIR
,
tarinfo
.
name
)
if
sys
.
platform
!=
"win32"
:
if
sys
.
platform
!=
"win32"
:
# Win32 has no support for fine grained permissions.
# Win32 has no support for fine grained permissions.
self
.
assertEqual
(
tarinfo
.
mode
&
0
o777
,
os
.
stat
(
path
)
.
st_mode
&
0
o777
)
self
.
assertEqual
(
tarinfo
.
mode
&
0
o777
,
os
.
stat
(
path
)
.
st_mode
&
0
o777
)
...
@@ -376,15 +378,22 @@ class MiscReadTest(CommonReadTest):
...
@@ -376,15 +378,22 @@ class MiscReadTest(CommonReadTest):
self
.
assertEqual
(
tarinfo
.
mtime
,
file_mtime
,
errmsg
)
self
.
assertEqual
(
tarinfo
.
mtime
,
file_mtime
,
errmsg
)
finally
:
finally
:
tar
.
close
()
tar
.
close
()
shutil
.
rmtree
(
DIR
)
def
test_extract_directory
(
self
):
def
test_extract_directory
(
self
):
dirtype
=
"ustar/dirtype"
dirtype
=
"ustar/dirtype"
with
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
as
tar
:
DIR
=
os
.
path
.
join
(
TEMPDIR
,
"extractdir"
)
tarinfo
=
tar
.
getmember
(
dirtype
)
os
.
mkdir
(
DIR
)
tar
.
extract
(
tarinfo
)
try
:
self
.
assertEqual
(
os
.
path
.
getmtime
(
dirtype
),
tarinfo
.
mtime
)
with
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
as
tar
:
if
sys
.
platform
!=
"win32"
:
tarinfo
=
tar
.
getmember
(
dirtype
)
self
.
assertEqual
(
os
.
stat
(
dirtype
)
.
st_mode
&
0
o777
,
0
o755
)
tar
.
extract
(
tarinfo
,
path
=
DIR
)
extracted
=
os
.
path
.
join
(
DIR
,
dirtype
)
self
.
assertEqual
(
os
.
path
.
getmtime
(
extracted
),
tarinfo
.
mtime
)
if
sys
.
platform
!=
"win32"
:
self
.
assertEqual
(
os
.
stat
(
extracted
)
.
st_mode
&
0
o777
,
0
o755
)
finally
:
shutil
.
rmtree
(
DIR
)
def
test_init_close_fobj
(
self
):
def
test_init_close_fobj
(
self
):
# Issue #7341: Close the internal file object in the TarFile
# Issue #7341: Close the internal file object in the TarFile
...
...
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