classification
Title: read1() from zipfile returns empty data
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: jcea, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-09-19 15:29 by serhiy.storchaka, last changed 2013-09-30 23:46 by jcea. This issue is now closed.

Files
File name Uploaded Description Edit
zipfile_read1.patch serhiy.storchaka, 2013-09-19 17:17 review
Messages (3)
msg198085 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-09-19 15:29
Bzip2 is block-based compression with large (up to 800 Kb) size of block. It means that while decompressor not read enough data it can't produce any output (actually this issue exists for other compression algorithms too, but less frequent). And the read1() method which makes only one low-level read can return empty bytes when there is still data available. This issue was fixed for gzip, bz2, and lzma modules in issue15546, but left in the zipfile module. In zipfile this bug less catastrophic because other read functions do not use read1() directly, but use lower level internal function.
msg198095 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-09-19 17:17
Here is a patch.
msg198499 - (view) Author: Roundup Robot (python-dev) Date: 2013-09-27 19:15
New changeset 460b0ccbab7f by Serhiy Storchaka in branch '3.3':
Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
http://hg.python.org/cpython/rev/460b0ccbab7f

New changeset f1c6e7f86bbc by Serhiy Storchaka in branch 'default':
Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
http://hg.python.org/cpython/rev/f1c6e7f86bbc
History
Date User Action Args
2013-09-30 23:46:24jceasetnosy: + jcea
2013-09-27 19:34:32serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-09-27 19:15:21python-devsetnosy: + python-dev
messages: + msg198499
2013-09-19 17:18:42serhiy.storchakasetstage: needs patch -> patch review
2013-09-19 17:17:52serhiy.storchakasetfiles: + zipfile_read1.patch
keywords: + patch
messages: + msg198095
2013-09-19 15:29:16serhiy.storchakacreate