[Python-bugs-list] [ python-Bugs-409420 ] gzip.py seek and tell methods are counter-productive (and seek is broken anyway)

noreply@sourceforge.net noreply@sourceforge.net
Sat, 17 Mar 2001 09:17:42 -0800


Bugs item #409420, was updated on 2001-03-17 09:17
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=409420&group_id=5470

Category: Python Library
Group: None
Status: Open
Priority: 5
Submitted By: Matt Mueller (donut)
Assigned to: Nobody/Anonymous (nobody)
Summary: gzip.py seek and tell methods are counter-productive (and seek is broken anyway)

Initial Comment:
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.



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=409420&group_id=5470