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
6e3d2ba2
Kaydet (Commit)
6e3d2ba2
authored
Kas 22, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
entries. Patch by Dingyuan Wang.
üst
36e4f760
8bc792a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
test_shutil.py
Lib/test/test_shutil.py
+23
-0
zipfile.py
Lib/zipfile.py
+3
-1
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_shutil.py
Dosyayı görüntüle @
6e3d2ba2
...
...
@@ -1105,6 +1105,29 @@ class TestShutil(unittest.TestCase):
names2
=
zf
.
namelist
()
self
.
assertEqual
(
sorted
(
names
),
sorted
(
names2
))
@requires_zlib
@unittest.skipUnless
(
ZIP_SUPPORT
,
'Need zip support to run'
)
@unittest.skipUnless
(
shutil
.
which
(
'unzip'
),
'Need the unzip command to run'
)
def
test_unzip_zipfile
(
self
):
root_dir
,
base_dir
=
self
.
_create_files
()
base_name
=
os
.
path
.
join
(
self
.
mkdtemp
(),
'archive'
)
archive
=
make_archive
(
base_name
,
'zip'
,
root_dir
,
base_dir
)
# check if ZIP file was created
self
.
assertEqual
(
archive
,
base_name
+
'.zip'
)
self
.
assertTrue
(
os
.
path
.
isfile
(
archive
))
# now check the ZIP file using `unzip -t`
zip_cmd
=
[
'unzip'
,
'-t'
,
archive
]
with
support
.
change_cwd
(
root_dir
):
try
:
subprocess
.
check_output
(
zip_cmd
,
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
exc
:
details
=
exc
.
output
.
decode
(
errors
=
"replace"
)
msg
=
"{}
\n\n
**Unzip Output**
\n
{}"
self
.
fail
(
msg
.
format
(
exc
,
details
))
def
test_make_archive
(
self
):
tmpdir
=
self
.
mkdtemp
()
base_name
=
os
.
path
.
join
(
tmpdir
,
'archive'
)
...
...
Lib/zipfile.py
Dosyayı görüntüle @
6e3d2ba2
...
...
@@ -1444,7 +1444,9 @@ class ZipFile:
arcname
+=
'/'
zinfo
=
ZipInfo
(
arcname
,
date_time
)
zinfo
.
external_attr
=
(
st
[
0
]
&
0xFFFF
)
<<
16
# Unix attributes
if
compress_type
is
None
:
if
isdir
:
zinfo
.
compress_type
=
ZIP_STORED
elif
compress_type
is
None
:
zinfo
.
compress_type
=
self
.
compression
else
:
zinfo
.
compress_type
=
compress_type
...
...
Misc/ACKS
Dosyayı görüntüle @
6e3d2ba2
...
...
@@ -1518,6 +1518,7 @@ Richard Walker
Larry Wall
Kevin Walzer
Rodrigo Steinmuller Wanderley
Dingyuan Wang
Ke Wang
Greg Ward
Tom Wardill
...
...
Misc/NEWS
Dosyayı görüntüle @
6e3d2ba2
...
...
@@ -77,6 +77,9 @@ Core and Builtins
Library
-------
-
Issue
#
25624
:
ZipFile
now
always
writes
a
ZIP_STORED
header
for
directory
entries
.
Patch
by
Dingyuan
Wang
.
-
Issue
#
25626
:
Change
three
zlib
functions
to
accept
sizes
that
fit
in
Py_ssize_t
,
but
internally
cap
those
sizes
to
UINT_MAX
.
This
resolves
a
regression
in
3.5
where
GzipFile
.
read
()
failed
to
read
chunks
larger
than
2
...
...
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