This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: read1() from zipfile returns empty data
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4
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 2022-04-11 14:57 by admin. This issue is now closed.

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) (Python triager) 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

New changeset f1c6e7f86bbc by Serhiy Storchaka in branch 'default':
Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63253
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