[Python-Dev] Enhancing the shutil module

Sridhar Ratnakumar sridharr at activestate.com
Sun Jan 17 22:50:52 CET 2010


On 1/17/2010 12:09 PM, Tarek Ziadé wrote:
> On Sun, Jan 17, 2010 at 8:55 PM, Brett Cannon<brett at python.org>  wrote:
>> >  On Sun, Jan 17, 2010 at 11:51, Tarek Ziadé<ziade.tarek at gmail.com>  wrote:
>>> >>  Another module I would like to move away from Distutils is
>>> >>  "archive_util". It contains helpers to build archives, whether they
>>> >>  are zip or tar files. I propose to move those useful functions into
>>> >>  shutil, as this seems the most logical place.
>> >  If it's archive-agnostic then shutil is probably the best place.
> In more details:
> It allows the creation of gzip, bzip2, tar and zip files through a single API.
> There's a registry of supported formats and the API is driven by a
> format identifier.

Will it also allow decompression of the said archive types? Distribute 
has some utility code to handle zip/tar archives. So does PyPM. This is 
because the `tarfile` and `zipfile` modules do not "just work" due to 
several issues.

See http://gist.github.com/279606

Take note of the following in the above code:

  1) _ensure_read_write_access
  2) *File.is_valid
  3) ZippedFile.extract ... issue 6510
  4) ZippedFile.extract ... issue 6609
  5) TarredFile.extract ... issue 6584
  6) The way unpack() detects the unpacked directory.

-srid



More information about the Python-Dev mailing list