Skip to content

Commit

Permalink
if a zip is expected do not unzip (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg authored Oct 12, 2020
1 parent cb78946 commit 176a473
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/sidecar/src/simcore_service_sidecar/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ async def _process_task_input(self, port: node_ports.Port, input_ports: Dict):
final_path,
path,
)
# check if the file is a zip, in that case extract all
if zipfile.is_zipfile(final_path):
# check if the file is a zip, in that case extract all if the service does not expect a zip file
if zipfile.is_zipfile(final_path) and (
str(port.type) != "data:application/zip"
):
with zipfile.ZipFile(final_path, "r") as zip_obj:
zip_obj.extractall(final_path.parents[0])
# finally remove the zip archive
Expand Down

0 comments on commit 176a473

Please sign in to comment.