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
f47fc555
Kaydet (Commit)
f47fc555
authored
May 15, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26039: Document ZipInfo.is_dir() and make force_zip64 keyword-only.
Patch by Thomas Kluyver.
üst
3d3f7e8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
zipfile.rst
Doc/library/zipfile.rst
+10
-2
zipfile.py
Lib/zipfile.py
+2
-1
No files found.
Doc/library/zipfile.rst
Dosyayı görüntüle @
f47fc555
...
@@ -207,7 +207,7 @@ ZipFile Objects
...
@@ -207,7 +207,7 @@ ZipFile Objects
..
index
::
..
index
::
single
:
universal
newlines
;
zipfile
.
ZipFile
.
open
method
single
:
universal
newlines
;
zipfile
.
ZipFile
.
open
method
..
method
::
ZipFile
.
open
(
name
,
mode
=
'r'
,
pwd
=
None
,
force_zip64
=
False
)
..
method
::
ZipFile
.
open
(
name
,
mode
=
'r'
,
pwd
=
None
,
*,
force_zip64
=
False
)
Access
a
member
of
the
archive
as
a
file
-
like
object
.
*
name
*
Access
a
member
of
the
archive
as
a
file
-
like
object
.
*
name
*
is
the
name
of
the
file
in
the
archive
,
or
a
:
class
:`
ZipInfo
`
object
.
The
is
the
name
of
the
file
in
the
archive
,
or
a
:
class
:`
ZipInfo
`
object
.
The
...
@@ -490,7 +490,15 @@ file:
...
@@ -490,7 +490,15 @@ file:
.. versionadded:: 3.6
.. versionadded:: 3.6
Instances have the following attributes:
Instances have the following methods and attributes:
.. method:: ZipInfo.is_dir()
Return True if this archive member is a directory.
This uses the entry's name: directories should always end with ``/``.
.. versionadded:: 3.6
.. attribute:: ZipInfo.filename
.. attribute:: ZipInfo.filename
...
...
Lib/zipfile.py
Dosyayı görüntüle @
f47fc555
...
@@ -502,6 +502,7 @@ class ZipInfo (object):
...
@@ -502,6 +502,7 @@ class ZipInfo (object):
return
zinfo
return
zinfo
def
is_dir
(
self
):
def
is_dir
(
self
):
"""Return True if this archive member is a directory."""
return
self
.
filename
[
-
1
]
==
'/'
return
self
.
filename
[
-
1
]
==
'/'
...
@@ -1343,7 +1344,7 @@ class ZipFile:
...
@@ -1343,7 +1344,7 @@ class ZipFile:
with
self
.
open
(
name
,
"r"
,
pwd
)
as
fp
:
with
self
.
open
(
name
,
"r"
,
pwd
)
as
fp
:
return
fp
.
read
()
return
fp
.
read
()
def
open
(
self
,
name
,
mode
=
"r"
,
pwd
=
None
,
force_zip64
=
False
):
def
open
(
self
,
name
,
mode
=
"r"
,
pwd
=
None
,
*
,
force_zip64
=
False
):
"""Return file-like object for 'name'.
"""Return file-like object for 'name'.
name is a string for the file name within the ZIP file, or a ZipInfo
name is a string for the file name within the ZIP file, or a ZipInfo
...
...
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