bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592)

This commit is contained in:
Serhiy Storchaka 2018-11-25 09:51:14 +02:00 committed by GitHub
parent 7f4ba4afd4
commit 4bb186d7e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 16 deletions

View file

@ -402,7 +402,7 @@ class ZipInfo (object):
return ''.join(result)
def FileHeader(self, zip64=None):
"""Return the per-file header as a string."""
"""Return the per-file header as a bytes object."""
dt = self.date_time
dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2)
@ -1429,7 +1429,7 @@ class ZipFile:
self._didModify = True
def read(self, name, pwd=None):
"""Return file bytes (as a string) for name."""
"""Return file bytes for name."""
with self.open(name, "r", pwd) as fp:
return fp.read()