Issue 914358: gzip.GzipFile to accept stream as fileobj. (original) (raw)

Issue914358

Created on 2004-03-11 19:09 by belyi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gzip-stream.patch belyi,2004-03-11 19:09
Messages (2)
msg45503 - (view) Author: Igor Belyi (belyi) Date: 2004-03-11 19:09
When gzip.GzipFile is initialized with a fileobj which does not have tell() and seek() methods (non-rewinding stream) it throws exception. The interesting thing is that it doesn't have to. The following patch updates gzip.py to allow any stream with just a read() method to be used. This is helpful if you want to be able to do something like: gzip.GzipFile(fileobj=urllib.urlopen("file:///README.gz")).readlines() or use GzipFile with sys.stdin stream. But keep in mind that seek() and rewind() methond of the GzipFile() won't for such stream even with the patch. Igor
msg45504 - (view) Author: Igor Belyi (belyi) Date: 2004-03-11 20:06
Logged In: YES user_id=995711 This is a duplicated request caused by unintentional push of the "reload" button. I'm deleting it.
History
Date User Action Args
2022-04-11 14:56:03 admin set github: 40027
2004-03-11 19:09:43 belyi create