diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-08-31 14:01:45 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-08-31 14:10:38 +0100 |
commit | ffea01c73732241742d804881377f537f282e5af (patch) | |
tree | a4ad0b930862e1dd6e4c0e646449d3b3415c959e /README | |
parent | dfd41a201e9d7efd3e98653e94c11434302fe7a4 (diff) | |
download | morph-ffea01c73732241742d804881377f537f282e5af.tar.gz |
Fix error reporting from tar extract errors
Mutliple issues here:
* tarfile can throw IOErrors in addition to OSErrors, and both may need
the filename attribute set
* tarfile needs to be told to raise exceptions for errors, rather than
ignoring them (errorlevel=1 to the constructor)
* tarfile needs to be told to raise exceptions for tar format corruptions
and not just I/O errors (errorlevel=2)
* the exception should be re-raised with a plain "raise" instead of "raise e"
to preserve the stack trace correctly; it's OK to modify the exception
before re-raising it
Also moved the creating of tf to the rest of the code that sets it up,
for clarity.
I've tested these changes manually, but not written a test case,
since a test case is tricky to write for this.
Originally found by Joe Burmeister.
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions