Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10072

Re: Inconsistencies between zipfile and tarfile APIs

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Inconsistencies between zipfile and tarfile APIs
Date 2011-07-22 01:45 -0400
References <5fd8e664-c855-41a2-9d8b-36d4c486f0b9@n35g2000yqf.googlegroups.com> <mailman.1344.1311308080.1164.python-list@python.org> <3241cbe4-9829-438b-ac0e-a0b87aff62d9@q15g2000yqk.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1347.1311313569.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 7/22/2011 12:48 AM, rantingrick wrote:
> On Jul 21, 11:13 pm, Corey Richardson<kb1...@aim.com>  wrote:
>> Excerpts from rantingrick's message of Thu Jul 21 23:46:05 -0400 2011:
>>
>>> I may have found the mother of all inconsitency warts when comparing
>>> the zipfile and tarfile modules. Not only are the API's different, but
>>> the entry and exits are differnet AND zipfile/tarfile do not behave
>>> like proper file objects should.
>>
>> I agree, actually.

Hmm. Archives are more like directories than files. Windows, at least, 
seems to partly treat zipfiles as more or less as such. Certainly, 7zip 
present a directory interface. So opening a zipfile/tarfile would be 
like opening a directory, which we normally do not do. On the other 
hand, I am not sure I like python's interface to directories that much.

It would be more sensible to open files within the archives. Certainly, 
it would be nice to have the result act like file objects as much as 
possible.

Seaching open issues for 'tarfile' or 'zipfile' returns about 40 issues 
each. So I think some people would care more about fixing bugs than 
adjusting the interfaces. Of course, some of the issues may be about the 
interface and increasing consistency where it can be done without 
compatibility issues. However, I do not think there are any active 
developers focued on those two modules.

> Unfortunately i know what the "powers that be" are going to say about
> fixing this wart.
>
> PTB: "Sorry we cannot break backwards compatibility"

Do you propose we break compatibility more than we do? You are not the 
only Python ranter. People at Google march into Guido's office to 
complain instead of posting here.

> Rick: But what about Python 3000?
> PTB: " Oh, well, umm, lets see. Well that was then and this is now!

The changes made for 3.0 were more than enough for some people to 
discourage migration to Py3. And we *have* made additional changes 
since. So the resistance to incompatible feature changes has increased.

> Maybe i can offer a solution. A NEW module called "archive.py" (could
> even be a package!) which exports both the zip and tar file classes.
> However, unlike the current situation this archive module will be
> consistent with it's API.
>
>>>> from archive import ZipFile, TarFile
>>>> zf = ZipFile(path, *args)
>>>> tf = TarFile(path, *args)

Not a bad idea. Put it on PyPI and see how much support you can get.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PyWart 1001] Inconsistencies between zipfile and tarfile APIs rantingrick <rantingrick@gmail.com> - 2011-07-21 20:46 -0700
  Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs Corey Richardson <kb1pkl@aim.com> - 2011-07-22 00:13 -0400
    Re: Inconsistencies between zipfile and tarfile APIs rantingrick <rantingrick@gmail.com> - 2011-07-21 21:48 -0700
      Re: Inconsistencies between zipfile and tarfile APIs Corey Richardson <kb1pkl@aim.com> - 2011-07-22 01:05 -0400
        Re: Inconsistencies between zipfile and tarfile APIs rantingrick <rantingrick@gmail.com> - 2011-07-21 22:58 -0700
          Re: Inconsistencies between zipfile and tarfile APIs Lars Gustäbel <lars@gustaebel.de> - 2011-07-22 10:49 +0200
            Re: Inconsistencies between zipfile and tarfile APIs rantingrick <rantingrick@gmail.com> - 2011-07-22 10:38 -0700
      Re: Inconsistencies between zipfile and tarfile APIs Terry Reedy <tjreedy@udel.edu> - 2011-07-22 01:45 -0400
        Re: Inconsistencies between zipfile and tarfile APIs rantingrick <rantingrick@gmail.com> - 2011-07-21 23:40 -0700
          Re: Inconsistencies between zipfile and tarfile APIs Corey Richardson <kb1pkl@aim.com> - 2011-07-22 03:19 -0400
          Re: Inconsistencies between zipfile and tarfile APIs Terry Reedy <tjreedy@udel.edu> - 2011-07-22 15:33 -0400
          Re: Inconsistencies between zipfile and tarfile APIs Ned Deily <nad@acm.org> - 2011-07-22 14:17 -0700
          Re: Inconsistencies between zipfile and tarfile APIs Terry Reedy <tjreedy@udel.edu> - 2011-07-22 20:31 -0400
      Re: Inconsistencies between zipfile and tarfile APIs Ryan Kelly <ryan@rfk.id.au> - 2011-07-22 15:56 +1000
  Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs Lars Gustäbel <lars@gustaebel.de> - 2011-07-22 10:26 +0200
    Re: Inconsistencies between zipfile and tarfile APIs rantingrick <rantingrick@gmail.com> - 2011-07-22 10:11 -0700
      Re: Inconsistencies between zipfile and tarfile APIs Chris Angelico <rosuav@gmail.com> - 2011-07-23 03:23 +1000
      Re: Inconsistencies between zipfile and tarfile APIs Chris Angelico <rosuav@gmail.com> - 2011-07-23 03:25 +1000
  Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs Thomas Jollans <t@jollybox.de> - 2011-07-22 12:31 +0200
  Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs Tim Chase <python.list@tim.thechases.com> - 2011-07-22 06:25 -0500
  Re: [PyWart 1001] Inconsistencies between zipfile and tarfile APIs Terry Reedy <tjreedy@udel.edu> - 2011-07-22 15:49 -0400

csiph-web