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
8bc462fc
Kaydet (Commit)
8bc462fc
authored
Eki 20, 2004
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[Patch #1043972, for bug #1017553] filemode() returns an incorrect value for the mode 07111
üst
d4f2552e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
27 deletions
+34
-27
tarfile.py
Lib/tarfile.py
+34
-27
No files found.
Lib/tarfile.py
Dosyayı görüntüle @
8bc462fc
...
@@ -174,39 +174,46 @@ def copyfileobj(src, dst, length=None):
...
@@ -174,39 +174,46 @@ def copyfileobj(src, dst, length=None):
return
return
filemode_table
=
(
filemode_table
=
(
(
S_IFLNK
,
"l"
,
((
S_IFLNK
,
"l"
),
S_IFREG
,
"-"
,
(
S_IFREG
,
"-"
),
S_IFBLK
,
"b"
,
(
S_IFBLK
,
"b"
),
S_IFDIR
,
"d"
,
(
S_IFDIR
,
"d"
),
S_IFCHR
,
"c"
,
(
S_IFCHR
,
"c"
),
S_IFIFO
,
"p"
),
(
S_IFIFO
,
"p"
)),
(
TUREAD
,
"r"
),
(
TUWRITE
,
"w"
),
((
TUREAD
,
"r"
),),
(
TUEXEC
,
"x"
,
TSUID
,
"S"
,
TUEXEC
|
TSUID
,
"s"
),
((
TUWRITE
,
"w"
),),
(
TGREAD
,
"r"
),
((
TUEXEC
|
TSUID
,
"s"
),
(
TGWRITE
,
"w"
),
(
TSUID
,
"S"
),
(
TGEXEC
,
"x"
,
TSGID
,
"S"
,
TGEXEC
|
TSGID
,
"s"
),
(
TUEXEC
,
"x"
)),
(
TOREAD
,
"r"
),
(
TOWRITE
,
"w"
),
((
TGREAD
,
"r"
),),
(
TOEXEC
,
"x"
,
TSVTX
,
"T"
,
TOEXEC
|
TSVTX
,
"t"
))
((
TGWRITE
,
"w"
),),
((
TGEXEC
|
TSGID
,
"s"
),
(
TSGID
,
"S"
),
(
TGEXEC
,
"x"
)),
((
TOREAD
,
"r"
),),
((
TOWRITE
,
"w"
),),
((
TOEXEC
|
TSVTX
,
"t"
),
(
TSVTX
,
"T"
),
(
TOEXEC
,
"x"
))
)
def
filemode
(
mode
):
def
filemode
(
mode
):
"""Convert a file's mode to a string of the form
"""Convert a file's mode to a string of the form
-rwxrwxrwx.
-rwxrwxrwx.
Used by TarFile.list()
Used by TarFile.list()
"""
"""
s
=
""
perm
=
[]
for
t
in
filemode_table
:
for
table
in
filemode_table
:
while
True
:
for
bit
,
char
in
table
:
if
mode
&
t
[
0
]
==
t
[
0
]:
if
mode
&
bit
==
bit
:
s
+=
t
[
1
]
perm
.
append
(
char
)
elif
len
(
t
)
>
2
:
break
t
=
t
[
2
:]
else
:
continue
perm
.
append
(
"-"
)
else
:
return
""
.
join
(
perm
)
s
+=
"-"
break
return
s
if
os
.
sep
!=
"/"
:
if
os
.
sep
!=
"/"
:
normpath
=
lambda
path
:
os
.
path
.
normpath
(
path
)
.
replace
(
os
.
sep
,
"/"
)
normpath
=
lambda
path
:
os
.
path
.
normpath
(
path
)
.
replace
(
os
.
sep
,
"/"
)
...
...
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