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

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Mar 2001 07:53:00 -0800


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

Category: Extension Modules
Group: None
>Status: Closed
Priority: 5
Submitted By: Matthew Mueller (donut)
Assigned to: A.M. Kuchling (akuchling)
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.



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

>Comment By: A.M. Kuchling (akuchling)
Date: 2001-03-20 07:52

Message:
Logged In: YES 
user_id=11375

I've deleted the seek() and tell() methods as suggested.


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

Comment By: A.M. Kuchling (akuchling)
Date: 2001-03-20 07:48

Message:
Logged In: YES 
user_id=11375

Good point; I'll resolve this.


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

Comment By: Tim Peters (tim_one)
Date: 2001-03-17 22:21

Message:
Logged In: YES 
user_id=31435

Assigned to Andrew, our resident gzip fan.

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

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