Changeset View
Changeset View
Standalone View
Standalone View
swh/core/tarball.py
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | Raises: | ||||
shutil.ReadError in case of issue uncompressing the archive (zippath | shutil.ReadError in case of issue uncompressing the archive (zippath | ||||
does not exist, extract_dir does not exist, etc...) | does not exist, extract_dir does not exist, etc...) | ||||
Returns: | Returns: | ||||
full path to the uncompressed directory. | full path to the uncompressed directory. | ||||
""" | """ | ||||
try: | try: | ||||
run(["unzip", "-d", extract_dir, zippath], check=True) | run(["unzip", "-q", "-d", extract_dir, zippath], check=True) | ||||
return extract_dir | return extract_dir | ||||
except Exception as e: | except Exception as e: | ||||
raise shutil.ReadError( | raise shutil.ReadError( | ||||
f"Unable to uncompress {zippath} to {extract_dir}. Reason: {e}" | f"Unable to uncompress {zippath} to {extract_dir}. Reason: {e}" | ||||
) | ) | ||||
def register_new_archive_formats(): | def register_new_archive_formats(): | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |