Skip to content

Commit

Permalink
Merge pull request #18888 from mvdbeek/compressed_file_tweak
Browse files Browse the repository at this point in the history
Raise exception if CompressedFile used on incompatible file
  • Loading branch information
mvdbeek authored Sep 25, 2024
2 parents 813ed02 + 45c5a38 commit 00ec042
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/galaxy/util/compression_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def __init__(self, file_path: StrPath, mode: str = "r") -> None:
self.file_type = "tar"
elif zipfile.is_zipfile(file_path) and not file_path_str.endswith(".jar"):
self.file_type = "zip"
else:
raise Exception("File must be valid zip or tar file.")
self.file_name = os.path.splitext(os.path.basename(file_path))[0]
if self.file_name.endswith(".tar"):
self.file_name = os.path.splitext(self.file_name)[0]
Expand Down

0 comments on commit 00ec042

Please sign in to comment.