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.

classification
Title: support whence argument for GzipFile.seek (bug #1316069)
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: effbot Nosy List: effbot, georg.brandl, loewis
Priority: normal Keywords: patch

Created on 2005-11-12 10:55 by effbot, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch-gzip.txt effbot, 2005-11-12 10:55
Messages (5)
msg49011 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2005-11-12 10:55
This adds support for whence=0 and whence=1 to the GzipFile
seek method.  See

    www.python.org/sf/1316069 

for background.

Open questions:

Q: can/should whence=2 be supported?
Q: if not, should whence=2 give an IOError or a ValueError
Q: can patches be attached to bug reports?

</F>
msg49012 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-11-13 10:57
Logged In: YES 
user_id=21627

I think whence=2 can be supported, but shouldn't be. For
reading, only negative offsets would be meaningful, and they
can be supported the same way as they currently are (i.e.
read all over). For writing, whence=2 would have no effect.

seek apparently always gives a value error (e.g. also
file.seek, for whence=10), so it should do so also here.

Patches can be attached to bug reports if you are a patch admin.

The patch lacks documentation and test case changes.
msg49013 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2005-11-13 11:36
Logged In: YES 
user_id=38376

I'll add a test case and check it in.

From what I can tell, no documentation is affected by this
change
(maybe the gzip documentation should include a full
description of
what exactly "simulates most of the methods of a file
object" really
means, but that's a separate issue).
msg49014 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-04-29 13:33
Logged In: YES 
user_id=849994

Can this be checked in before 2.5a3?
msg49015 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-11-12 10:42
Logged In: YES 
user_id=21627

Thanks for the patch. Committed as r52737.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42585
2005-11-12 10:55:54effbotcreate