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
2ee1c760
Kaydet (Commit)
2ee1c760
authored
Ock 04, 2008
tarafından
Lars Gustäbel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #1735: TarFile.extractall() now correctly sets
directory permissions and times. (will backport to 2.5)
üst
0687561c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
tarfile.py
Lib/tarfile.py
+4
-4
test_tarfile.py
Lib/test/test_tarfile.py
+17
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/tarfile.py
Dosyayı görüntüle @
2ee1c760
...
...
@@ -2037,11 +2037,11 @@ class TarFile(object):
# Set correct owner, mtime and filemode on directories.
for
tarinfo
in
directories
:
path
=
os
.
path
.
join
(
path
,
tarinfo
.
name
)
dir
path
=
os
.
path
.
join
(
path
,
tarinfo
.
name
)
try
:
self
.
chown
(
tarinfo
,
path
)
self
.
utime
(
tarinfo
,
path
)
self
.
chmod
(
tarinfo
,
path
)
self
.
chown
(
tarinfo
,
dir
path
)
self
.
utime
(
tarinfo
,
dir
path
)
self
.
chmod
(
tarinfo
,
dir
path
)
except
ExtractError
,
e
:
if
self
.
errorlevel
>
1
:
raise
...
...
Lib/test/test_tarfile.py
Dosyayı görüntüle @
2ee1c760
...
...
@@ -244,6 +244,23 @@ class MiscReadTest(ReadTest):
data
=
open
(
os
.
path
.
join
(
TEMPDIR
,
"ustar/symtype"
),
"rb"
)
.
read
()
self
.
assertEqual
(
md5sum
(
data
),
md5_regtype
)
def
test_extractall
(
self
):
# Test if extractall() correctly restores directory permissions
# and times (see issue1735).
if
sys
.
platform
==
"win32"
:
# Win32 has no support for utime() on directories or
# fine grained permissions.
return
tar
=
tarfile
.
open
(
tarname
,
encoding
=
"iso8859-1"
)
directories
=
[
t
for
t
in
tar
if
t
.
isdir
()]
tar
.
extractall
(
TEMPDIR
,
directories
)
for
tarinfo
in
directories
:
path
=
os
.
path
.
join
(
TEMPDIR
,
tarinfo
.
name
)
self
.
assertEqual
(
tarinfo
.
mode
&
0777
,
os
.
stat
(
path
)
.
st_mode
&
0777
)
self
.
assertEqual
(
tarinfo
.
mtime
,
os
.
path
.
getmtime
(
path
))
tar
.
close
()
class
StreamReadTest
(
ReadTest
):
...
...
Misc/NEWS
Dosyayı görüntüle @
2ee1c760
...
...
@@ -342,6 +342,9 @@ Core and builtins
Library
-------
- Issue #1735: TarFile.extractall() now correctly sets directory permissions
and times.
- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a mountpoint.
- Bug #1687: Fxed plistlib.py restricts <integer> to Python int when writing
...
...
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