diff options
author | 2007-07-18 22:07:29 +0000 | |
---|---|---|
committer | 2007-07-18 22:07:29 +0000 | |
commit | 814661e0d430e1ed8ebc4839fb49a668d02e5a07 (patch) | |
tree | 7d209049ad3b95766a946de74ef445b2c7231f34 /Lib/zipfile.py | |
parent | Make test_unicode pass after the lexer was fixed to turn unicode errors (diff) | |
download | cpython-814661e0d430e1ed8ebc4839fb49a668d02e5a07.tar.gz cpython-814661e0d430e1ed8ebc4839fb49a668d02e5a07.tar.bz2 cpython-814661e0d430e1ed8ebc4839fb49a668d02e5a07.zip |
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 63551a653de..e1fdc7fa812 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 |