Fixed issue with bz2 files

Fixed issue with bz2 files
parent b5c85f8b
Pipeline #20894 passed with stage
in 9 minutes and 49 seconds
...@@ -15,11 +15,17 @@ def _unzip(zip_file, directory): ...@@ -15,11 +15,17 @@ def _unzip(zip_file, directory):
def _untar(tar_file, directory, mode): def _untar(tar_file, directory, mode):
if ".tar" in tar_file:
import tarfile import tarfile
with, mode='r:'+mode) as t: with, mode='r:'+mode) as t:
t.extractall(directory) t.extractall(directory)
if mode=="bz2":
import bz2
with bz2.BZ2File(tar_file) as t:
open(os.path.splitext(tar_file)[0:-1][0], 'wb').write(
raise ValueError("It was not possible to extract {0}".format(tar_file))
def download_file(url, out_file): def download_file(url, out_file):
"""Downloads a file from a given url """Downloads a file from a given url
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment