New submission from Éric Araujo <mer...@netwok.org>:

shutil contains high-level functions to create a zipfile or a tarball.  When a 
new format is added to the tarfile module, then shutil needs to be updated 
manually.  If tarfile exposed the names of the compressors it supports, then 
shutil could just automatically support everything that tarfile supports 
instead of having to re-do import dances for optional modules (bz2, lzma, zlib) 
and also duplicate formats in its doc.

This may also be useful for other code wanting to do some introspection.

Attached patch implements tarfile.formats, a list of strings (I thought about 
using a frozenset but then followed the precedent set by the 3.3 crypt module). 
 Tests and docs not updated, I wanted to get Lars’ approval on the principle 
first.

One could argue that this is not needed: compression modules are not added 
often; updating shutil after updating tarfile is not hard; it is not that 
useful to have access to the list of supported formats.

----------
assignee: docs@python
components: Documentation, Library (Lib)
messages: 153350
nosy: docs@python, eric.araujo, lars.gustaebel, nadeem.vawda
priority: normal
severity: normal
stage: patch review
status: open
title: tarfile should expose supported formats
type: enhancement
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14013>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to