Don't choke on modes like rb or wb.

This commit is contained in:
Raymond Hettinger 2004-11-06 00:31:51 +00:00
parent 93d9d5fb37
commit 8a92dd5866

View file

@ -193,7 +193,7 @@ def __init__(self, file, mode="r", compression=ZIP_STORED):
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):