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?
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.
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).