From df8b3c2903a6553506cd3dcc0c1afb11507d71da Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 06:14:38 +0000 Subject: [PATCH] fix(typing): resolve mypy errors in utils.asyncio.aiozipstream --- gns3server/utils/asyncio/aiozipstream.py | 18 ++++++++---------- pyproject.toml | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gns3server/utils/asyncio/aiozipstream.py b/gns3server/utils/asyncio/aiozipstream.py index a6e1fc49b..1efafc37e 100644 --- a/gns3server/utils/asyncio/aiozipstream.py +++ b/gns3server/utils/asyncio/aiozipstream.py @@ -32,16 +32,14 @@ import asyncio import aiofiles from concurrent import futures -from zipfile import ( - structCentralDir, - structEndArchive64, - structEndArchive, - structEndArchive64Locator, - stringCentralDir, - stringEndArchive64, - stringEndArchive, - stringEndArchive64Locator, -) +structCentralDir = "<4s4B4HL2L5H2L" +structEndArchive64 = "<4sQ2H2L4Q" +structEndArchive = b"<4s4H2LH" +structEndArchive64Locator = "<4sLQL" +stringCentralDir = b"PK\x01\x02" +stringEndArchive64 = b"PK\x06\x06" +stringEndArchive = b"PK\x05\x06" +stringEndArchive64Locator = b"PK\x06\x07" ZIP_ZSTANDARD = 93 # zstandard is supported by WinZIP v24 and later, PowerArchiver 2021 and 7-Zip-zstd diff --git a/pyproject.toml b/pyproject.toml index 1179d2526..63bfde2eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -392,7 +392,6 @@ module = [ "gns3server.schemas.controller.settings", # 3 "gns3server.schemas.controller.templates.docker_templates", # 1 "gns3server.services.templates", # 18 - "gns3server.utils.asyncio.aiozipstream", # 8 "gns3server.utils.encryption", # 2 "gns3server.utils.http_client", # 4 "gns3server.utils.images", # 4