From 7ede41afdbb5c7261fcd1bd0c54b96a83eaffdd9 Mon Sep 17 00:00:00 2001 From: Andrei Neagu Date: Mon, 16 Dec 2024 14:33:36 +0100 Subject: [PATCH] mypy --- .../modules/seven_zip_wrapper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/seven_zip_wrapper.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/seven_zip_wrapper.py index 5e5896c226e..200c0667be1 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/seven_zip_wrapper.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/seven_zip_wrapper.py @@ -18,7 +18,7 @@ async def _get_file_count(zip_path: Path) -> int: raise SevenZipError(command=result.command, command_result=result.message) match = re.search(r"\s*(\d+)\s*files", result.message) - return int(match.group().replace("files", "").strip()) + return int(match.group().replace("files", "").strip() if match else "0") async def unarchive_zip_to( @@ -37,6 +37,8 @@ async def unarchive_zip_to( process = await asyncio.create_subprocess_shell( command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE ) + assert process.stdout # nosec + assert process.stderr # nosec async with progress_bar.sub_progress( steps=file_count, description=IDStr("...")