diff options
author | Fred Drake <fdrake@acm.org> | 1999-04-05 18:33:40 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-04-05 18:33:40 (GMT) |
commit | 9bb76d1b73d4498d87fbe75f23da466c1cb80e98 (patch) | |
tree | 907919351b58dc0c2c56a8b129d473c8f31ea152 /Lib | |
parent | 06ca948029492e277896e06fba3d9255ed2430c3 (diff) | |
download | cpython-9bb76d1b73d4498d87fbe75f23da466c1cb80e98.zip cpython-9bb76d1b73d4498d87fbe75f23da466c1cb80e98.tar.gz cpython-9bb76d1b73d4498d87fbe75f23da466c1cb80e98.tar.bz2 |
Made the default mode 'rb' instead of 'r', for better cross-platform
support. (Based on comment on the documentation by Bernhard Reiter
<bernhard@csd.uwm.edu>).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/gzip.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index c0179a4..793bf5c 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -30,13 +30,13 @@ class GzipFile: def __init__(self, filename=None, mode=None, compresslevel=9, fileobj=None): if fileobj is None: - fileobj = self.myfileobj = __builtin__.open(filename, mode or 'r') + fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb') if filename is None: if hasattr(fileobj, 'name'): filename = fileobj.name else: filename = '' if mode is None: if hasattr(fileobj, 'mode'): mode = fileobj.mode - else: mode = 'r' + else: mode = 'rb' if mode[0:1] == 'r': self.mode = READ |