From: Raymond Hettinger Date: Sat, 6 Nov 2004 00:31:51 +0000 (+0000) Subject: Don't choke on modes like rb or wb. X-Git-Tag: v2.4c1~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a92dd5866061211d80ee4f61ae091aa4e0fdb5d;p=thirdparty%2FPython%2Fcpython.git Don't choke on modes like rb or wb. --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 31e6f83ce297..958ee9e95a12 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -193,7 +193,7 @@ class ZipFile: self.NameToInfo = {} # Find file info given name self.filelist = [] # List of ZipInfo instances for archive self.compression = compression # Method of compression - self.mode = key = mode[0] + self.mode = key = mode[0].replace('b', '') # Check if we were passed a file-like object if isinstance(file, basestring):