Is negative seek() from EOF of a GzipFile supported on Python 2.5.2 ?

Steve Holden steve at
Mon Jan 12 09:09:41 CET 2009

Gabriel Genellina wrote:
> En Sun, 11 Jan 2009 08:12:27 -0200, Barak, Ron <Ron.Barak at>
> escribió:
>> I googled a bit, and found
>> It seems that this patch implemented fuller seek() for GzipFile around
>> November 2006 (including whence==2).
>> Do I misunderstand and this patch was not actually implemented,
>> namely, is seek(-n,2) not implemented in Python 2.5.2 ?
>> The source of on my system seems to suggest that negative
>> seeks are supported:
> The source comments are misleading: "negative seeks" means seeking
> backwards (towards the beginning of the file), not offset<0.
> The second argument to seek (whence) was added in 2.6, and only accepts 0
> or 1; whence==2 isn't supported.
Specifically in the case of a zip file that means the whole entry would
need to be expanded to allow such a seek to take place from the end of
the file; hence there are good pragmatic reasons for the restriction.

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC    

More information about the Python-list mailing list