Message154121
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? |
|
Date |
User |
Action |
Args |
2012-02-24 07:48:13 | eric.araujo | set | recipients:
+ eric.araujo, georg.brandl, nadeem.vawda, tarek |
2012-02-24 07:48:13 | eric.araujo | set | messageid: <1330069693.37.0.507628867152.issue14061@psf.upfronthosting.co.za> |
2012-02-24 07:48:12 | eric.araujo | link | issue14061 messages |
2012-02-24 07:48:12 | eric.araujo | create | |
|