mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #26039: Document ZipInfo.is_dir() and make force_zip64 keyword-only.
Patch by Thomas Kluyver.
This commit is contained in:
parent
3d3f7e8b41
commit
f47fc5553b
2 changed files with 12 additions and 3 deletions
|
@ -502,6 +502,7 @@ class ZipInfo (object):
|
|||
return zinfo
|
||||
|
||||
def is_dir(self):
|
||||
"""Return True if this archive member is a directory."""
|
||||
return self.filename[-1] == '/'
|
||||
|
||||
|
||||
|
@ -1343,7 +1344,7 @@ class ZipFile:
|
|||
with self.open(name, "r", pwd) as fp:
|
||||
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'.
|
||||
|
||||
name is a string for the file name within the ZIP file, or a ZipInfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue