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: gzip.py seek and tell methods are counter-productive (and seek is broken anyway)
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, donut, tim.peters
Priority: normal Keywords:

Created on 2001-03-17 17:17 by donut, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Messages (4)
msg3927 - (view) Author: Matthew Mueller (donut) Date: 2001-03-17 17:17
gzip.open returns an object that emulates a file type.  However, it does
not support seeking or telling.  That is not the problem, what is the
problem is that even though it does not support them, it has the methods
there anyway.  This means user code can not easily do a try: ... except:
AttributeError, to test if the object supports these methods.  Instead
it would have to except on IOError, and have no way of knowing if it was
a real file error. (other than the kludge of examing the error string)

Therefore, I believe it would be more correct if these methods were
removed entirely, or at least replace the exception with AttributeError
instead of IOError.

Oh, and if they aren't removed, the seek method should at least accept
an arg since as it is now it will never raise its desired exception
anyway.

msg3928 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-03-18 06:21
Logged In: YES 
user_id=31435

Assigned to Andrew, our resident gzip fan.
msg3929 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-20 15:48
Logged In: YES 
user_id=11375

Good point; I'll resolve this.
msg3930 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-20 15:52
Logged In: YES 
user_id=11375

I've deleted the seek() and tell() methods as suggested.
History
Date User Action Args
2022-04-10 16:03:52adminsetgithub: 34179
2001-03-17 17:17:34donutcreate