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
25f58f6b
Kaydet (Commit)
25f58f6b
authored
Ara 06, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1610437: fix a tarfile bug with long filename headers.
(backport from rev. 52938)
üst
19d12d4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
tarfile.py
Lib/tarfile.py
+6
-2
test_tarfile.py
Lib/test/test_tarfile.py
+13
-9
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/tarfile.py
Dosyayı görüntüle @
25f58f6b
...
@@ -857,7 +857,11 @@ class TarInfo(object):
...
@@ -857,7 +857,11 @@ class TarInfo(object):
if
self
.
name
.
endswith
(
"/"
):
if
self
.
name
.
endswith
(
"/"
):
type
=
DIRTYPE
type
=
DIRTYPE
name
=
normpath
(
self
.
name
)
if
type
in
(
GNUTYPE_LONGNAME
,
GNUTYPE_LONGLINK
):
# Prevent "././@LongLink" from being normalized.
name
=
self
.
name
else
:
name
=
normpath
(
self
.
name
)
if
type
==
DIRTYPE
:
if
type
==
DIRTYPE
:
# directories should end with '/'
# directories should end with '/'
...
@@ -913,7 +917,7 @@ class TarInfo(object):
...
@@ -913,7 +917,7 @@ class TarInfo(object):
]
]
buf
+=
struct
.
pack
(
"
%
ds"
%
BLOCKSIZE
,
""
.
join
(
parts
))
buf
+=
struct
.
pack
(
"
%
ds"
%
BLOCKSIZE
,
""
.
join
(
parts
))
chksum
=
calc_chksums
(
buf
)[
0
]
chksum
=
calc_chksums
(
buf
[
-
BLOCKSIZE
:]
)[
0
]
buf
=
buf
[:
-
364
]
+
"
%06
o
\0
"
%
chksum
+
buf
[
-
357
:]
buf
=
buf
[:
-
364
]
+
"
%06
o
\0
"
%
chksum
+
buf
[
-
357
:]
self
.
buf
=
buf
self
.
buf
=
buf
return
buf
return
buf
...
...
Lib/test/test_tarfile.py
Dosyayı görüntüle @
25f58f6b
...
@@ -388,13 +388,6 @@ class WriteGNULongTest(unittest.TestCase):
...
@@ -388,13 +388,6 @@ class WriteGNULongTest(unittest.TestCase):
is tested as well.
is tested as well.
"""
"""
def
setUp
(
self
):
self
.
tar
=
tarfile
.
open
(
tmpname
(),
"w"
)
self
.
tar
.
posix
=
False
def
tearDown
(
self
):
self
.
tar
.
close
()
def
_length
(
self
,
s
):
def
_length
(
self
,
s
):
blocks
,
remainder
=
divmod
(
len
(
s
)
+
1
,
512
)
blocks
,
remainder
=
divmod
(
len
(
s
)
+
1
,
512
)
if
remainder
:
if
remainder
:
...
@@ -423,12 +416,23 @@ class WriteGNULongTest(unittest.TestCase):
...
@@ -423,12 +416,23 @@ class WriteGNULongTest(unittest.TestCase):
tarinfo
.
linkname
=
link
tarinfo
.
linkname
=
link
tarinfo
.
type
=
tarfile
.
LNKTYPE
tarinfo
.
type
=
tarfile
.
LNKTYPE
self
.
tar
.
addfile
(
tarinfo
)
tar
=
tarfile
.
open
(
tmpname
(),
"w"
)
tar
.
posix
=
False
tar
.
addfile
(
tarinfo
)
v1
=
self
.
_calc_size
(
name
,
link
)
v1
=
self
.
_calc_size
(
name
,
link
)
v2
=
self
.
tar
.
offset
v2
=
tar
.
offset
self
.
assertEqual
(
v1
,
v2
,
"GNU longname/longlink creation failed"
)
self
.
assertEqual
(
v1
,
v2
,
"GNU longname/longlink creation failed"
)
tar
.
close
()
tar
=
tarfile
.
open
(
tmpname
())
member
=
tar
.
next
()
self
.
failIf
(
member
is
None
,
"unable to read longname member"
)
self
.
assert_
(
tarinfo
.
name
==
member
.
name
and
\
tarinfo
.
linkname
==
member
.
linkname
,
\
"unable to read longname member"
)
def
test_longname_1023
(
self
):
def
test_longname_1023
(
self
):
self
.
_test
((
"longnam/"
*
127
)
+
"longnam"
)
self
.
_test
((
"longnam/"
*
127
)
+
"longnam"
)
...
...
Misc/NEWS
Dosyayı görüntüle @
25f58f6b
...
@@ -110,6 +110,8 @@ Extension Modules
...
@@ -110,6 +110,8 @@ Extension Modules
Library
Library
-------
-------
-
Patch
#
1610437
:
fix
a
tarfile
bug
with
long
filename
headers
.
-
Patch
#
1472877
:
Fix
Tix
subwidget
name
resolution
.
-
Patch
#
1472877
:
Fix
Tix
subwidget
name
resolution
.
-
Patch
#
1594554
:
Always
close
a
tkSimpleDialog
on
ok
(),
even
-
Patch
#
1594554
:
Always
close
a
tkSimpleDialog
on
ok
(),
even
...
...
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