summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/zipfile')
-rw-r--r--Lib/zipfile/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/zipfile/__init__.py b/Lib/zipfile/__init__.py
index e4603b5..31ef9bb 100644
--- a/Lib/zipfile/__init__.py
+++ b/Lib/zipfile/__init__.py
@@ -940,7 +940,7 @@ class ZipExtFile(io.BufferedIOBase):
result = ['<%s.%s' % (self.__class__.__module__,
self.__class__.__qualname__)]
if not self.closed:
- result.append(' name=%r mode=%r' % (self.name, self.mode))
+ result.append(' name=%r' % (self.name,))
if self._compress_type != ZIP_STORED:
result.append(' compress_type=%s' %
compressor_names.get(self._compress_type,
@@ -1217,6 +1217,14 @@ class _ZipWriteFile(io.BufferedIOBase):
def _fileobj(self):
return self._zipfile.fp
+ @property
+ def name(self):
+ return self._zinfo.filename
+
+ @property
+ def mode(self):
+ return 'wb'
+
def writable(self):
return True
@@ -1687,7 +1695,7 @@ class ZipFile:
else:
pwd = None
- return ZipExtFile(zef_file, mode, zinfo, pwd, True)
+ return ZipExtFile(zef_file, mode + 'b', zinfo, pwd, True)
except:
zef_file.close()
raise