Skip to content

Commit

Permalink
apply data filter to tarfile.extractall addressing issue #2244
Browse files Browse the repository at this point in the history
It remains in some doctests, because filter bails on Windows tests
  • Loading branch information
nikohansen committed Nov 22, 2023
1 parent 4b1e064 commit fe9004f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code-postprocessing/cocopp/findfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def get_directory(directory, extract_files):
raise IOError(2, 'Some of the files cannot be extracted ' +
'from "%s". The path is too long.' % directory)

tar_file.extractall(dir_name)
try: tar_file.extractall(dir_name, filter='data')
except TypeError: tar_file.extractall(dir_name) # Windows
# TarFile.open handles tar.gz/tgz
print(' archive extracted to folder', dir_name, '...')
directory = dir_name
Expand Down

0 comments on commit fe9004f

Please sign in to comment.