This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients eric.araujo, georg.brandl, nadeem.vawda, tarek
Date 2012-02-24.07:48:12
SpamBayes Score 1.0108189e-05
Marked as misclassified No
Message-id <1330069693.37.0.507628867152.issue14061@psf.upfronthosting.co.za>
In-reply-to
Content
I intend to commit this simple fix for all branches:

-    _UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [],
+    _UNPACK_FORMATS['bztar'] = (['.tar.bz2'], _unpack_tarfile, [],

I could write a unit test, but it would be coupled to the exact text of the exception* (i.e. with assertRaisesRegex) and IMO not very useful.  I tested manually: I compressed a text file with bzip2, passed the filename to unpack_archive, and it tried to unpack it with tarfile.  With my fix, it does not try to unpack it.


* unpack_archive raises ValueError when you give an unsupported value to its format
  parameter, but when it’s in autodetect mode and can’t find an unpacker for the file
  extension, then it raises a ReadError.  Is it okay to change that to ValueError?
History
Date User Action Args
2012-02-24 07:48:13eric.araujosetrecipients: + eric.araujo, georg.brandl, nadeem.vawda, tarek
2012-02-24 07:48:13eric.araujosetmessageid: <1330069693.37.0.507628867152.issue14061@psf.upfronthosting.co.za>
2012-02-24 07:48:12eric.araujolinkissue14061 messages
2012-02-24 07:48:12eric.araujocreate