Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pypi': 0.04; 'api.': 0.05; 'classes.': 0.05; 'agree,': 0.07; 'backwards': 0.07; 'behave': 0.07; 'exits': 0.07; 'migration': 0.07; 'modules.': 0.07; 'received:verizon.net': 0.07; 'terry': 0.07; 'python': 0.08; '21,': 0.09; '>>>>': 0.09; 'adjusting': 0.09; 'incompatible': 0.09; 'oh,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'since.': 0.09; 'thu': 0.09; 'files.': 0.10; 'am,': 0.13; 'wrote:': 0.15; '*args)': 0.16; "api's": 0.16; 'archives.': 0.16; 'different,': 0.16; 'differnet': 0.16; "guido's": 0.16; 'hmm.': 0.16; 'partly': 0.16; 'rantingrick': 0.16; 'reedy': 0.16; 'richardson': 0.16; 'see.': 0.16; 'should.': 0.16; 'subject:between': 0.16; 'such.': 0.16; 'tarfile': 0.16; 'zipfile': 0.16; 'pm,': 0.16; '>>>': 0.16; 'solution.': 0.19; 'jan': 0.19; 'seems': 0.20; 'posting': 0.21; 'archives': 0.22; 'maybe': 0.22; 'header:In-Reply-To:1': 0.22; 'complain': 0.23; 'least,': 0.23; 'archive': 0.23; 'interface': 0.23; "python's": 0.25; 'objects': 0.28; '3.0': 0.28; 'bugs': 0.28; 'import': 0.29; 'do.': 0.30; 'module': 0.30; '-0400': 0.30; 'get.': 0.30; 'tar': 0.30; 'changes': 0.31; 'developers': 0.32; 'propose': 0.32; 'break': 0.33; 'done': 0.33; 'entry': 0.33; 'to:addr:python-list': 0.34; 'header:X-Complaints-To:1': 0.34; 'instead': 0.34; 'header:User-Agent:1': 0.34; 'there': 0.34; 'however,': 0.34; 'normally': 0.34; 'google': 0.34; 'do?': 0.35; 'fixing': 0.35; 'file': 0.36; 'comparing': 0.37; 'interface.': 0.37; 'open': 0.37; 'some': 0.37; 'but': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'think': 0.38; 'two': 0.38; 'put': 0.38; 'header:Mime-Version:1': 0.39; 'unlike': 0.39; 'to:addr:python.org': 0.39; 'skip:z 10': 0.40; 'called': 0.40; 'where': 0.40; 'march': 0.62; 'act': 0.64; 'zip': 0.65; 'here.': 0.66; 'offer': 0.72; 'care': 0.73; 'hand,': 0.76; '*have*': 0.84; '12:48': 0.84; '2011:': 0.84; 'discourage': 0.84; 'resistance': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Inconsistencies between zipfile and tarfile APIs Date: Fri, 22 Jul 2011 01:45:57 -0400 References: <5fd8e664-c855-41a2-9d8b-36d4c486f0b9@n35g2000yqf.googlegroups.com> <3241cbe4-9829-438b-ac0e-a0b87aff62d9@q15g2000yqk.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: <3241cbe4-9829-438b-ac0e-a0b87aff62d9@q15g2000yqk.googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311313569 news.xs4all.nl 23948 [2001:888:2000:d::a6]:40959 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10072 On 7/22/2011 12:48 AM, rantingrick wrote: > On Jul 21, 11:13 pm, Corey Richardson 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