Mercurial > repos > jdv > albacore
diff albacore_1D.py @ 3:d561e3f9ccbb draft
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/albacore commit d8cc434bd1704b2834f89b7d91370f356e3ac85a
author | jdv |
---|---|
date | Tue, 03 Oct 2017 20:12:09 -0400 |
parents | 0a4f83207e53 |
children | 8a9f61d08201 |
line wrap: on
line diff
--- a/albacore_1D.py Fri Sep 08 10:14:40 2017 -0400 +++ b/albacore_1D.py Tue Oct 03 20:12:09 2017 -0400 @@ -7,7 +7,6 @@ import shutil import h5py import numpy as np -import tarfile from distutils.util import strtobool def main(): @@ -93,8 +92,15 @@ if not os.path.exists(in_dir): os.makedirs(in_dir) - tar = tarfile.open(fn, mode='r') - tar.extractall(path=in_dir) + # python's tarfile interface does not sanitize file paths within + # tarballs, which can be a big security risk. GNU tar does sanitize by + # default, so it's easier/safer here just to call the system tar + subprocess.call([ + "tar", + "-xf", + fn, + "-C", + in_dir]) files = glob.glob( os.path.join(in_dir, "**", "*.fast5"),