def _unpack_tarfile(filename, extract_dir):
try:<EOL><INDENT>tarobj = tarfile.open(filename)<EOL><DEDENT>except tarfile.TarError:<EOL><INDENT>raise ReadError(<EOL>"<STR_LIT>" % filename)<EOL><DEDENT>try:<EOL><INDENT>tarobj.extractall(extract_dir)<EOL><DEDENT>finally:<EOL><INDENT>tarobj.close()<EOL><DEDENT>
Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`