diff --git a/integration-tests/test_multi_data_set_archiving.py b/integration-tests/test_multi_data_set_archiving.py index 99ba5cd358d24c428ae102f2863dd9a4409aef37..7c412d02957f7759e204237fb5703ab5f866378b 100755 --- a/integration-tests/test_multi_data_set_archiving.py +++ b/integration-tests/test_multi_data_set_archiving.py @@ -73,8 +73,11 @@ class TestCase(systemtest.testcase.TestCase): def extractFromArchive(self, openbisController, tar_file, path_in_tar): temp_dir = "%s/data/tmp" % (openbisController.installPath) util.printAndFlush("Extract %s from archive %s" % (path_in_tar, tar_file)) - with tarfile.open(tar_file) as tf: + try: + tf = tarfile.open(tar_file) tf.extract(path_in_tar, temp_dir) + finally: + tf.close() return "%s/%s" % (temp_dir, path_in_tar) def calculateMD5(self, file_path):