Lars Gustäbel <l...@gustaebel.de> added the comment:

If you pass an explicit mode, the error message is more or less what you want:

>>> tarfile.open("uga.tgz", mode="r:gz")
[...]
tarfile.CompressionError: gzip module is not available

The way mode="r" detects which compression format is used is to open the file 
with each open method (i.e. taropen, gzopen, bz2open) until one of them 
succeeds. If none of them matches it is impossible to say what the reason was.

As this would require more than just a simple one-line change, 2.7 is out of 
the question. But I see what I can do for 3.2.

----------
versions:  -Python 2.7

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

Reply via email to