diff options
author | Guido van Rossum <guido@python.org> | 2007-07-18 22:07:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-18 22:07:29 (GMT) |
commit | 814661e0d430e1ed8ebc4839fb49a668d02e5a07 (patch) | |
tree | 7d209049ad3b95766a946de74ef445b2c7231f34 /Lib/zipfile.py | |
parent | 697a84b16c9561a2035c0f74dfc0af0b5b868149 (diff) | |
download | cpython-814661e0d430e1ed8ebc4839fb49a668d02e5a07.zip cpython-814661e0d430e1ed8ebc4839fb49a668d02e5a07.tar.gz cpython-814661e0d430e1ed8ebc4839fb49a668d02e5a07.tar.bz2 |
Fix test_zipfile.py. (Why was it passing before?)
The usual str/bytes issues.
BTW, perhaps zipfp.open() should behave more like io.open()?
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r-- | Lib/zipfile.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 63551a6..e1fdc7f 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -412,7 +412,7 @@ class ZipExtFile: # ugly check for cases where half of an \r\n pair was # read on the last pass, and the \r was discarded. In this # case we just throw away the \n at the start of the buffer. - if (self.lastdiscard, self.linebuffer[0]) == (b'\r', b'\n'): + if (self.lastdiscard, self.linebuffer[:1]) == (b'\r', b'\n'): self.linebuffer = self.linebuffer[1:] for sep in self.nlSeps: @@ -479,9 +479,9 @@ class ZipExtFile: return result def read(self, size = None): - # act like file() obj and return empty string if size is 0 + # act like file obj and return empty string if size is 0 if size == 0: - return '' + return b'' # determine read size bytesToRead = self.compress_size - self.bytes_read |