]> granicus.if.org Git - python/commitdiff
Don't choke on modes like rb or wb.
authorRaymond Hettinger <python@rcn.com>
Sat, 6 Nov 2004 00:31:51 +0000 (00:31 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 6 Nov 2004 00:31:51 +0000 (00:31 +0000)
Lib/zipfile.py

index 31e6f83ce297623c3274342a8d4bcbb1715da4eb..958ee9e95a1298a95057c92d48ab7f8628bbbccc 100644 (file)
@@ -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):