Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion openviking/parse/understanding_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from openviking.parse.base import NodeType, ParseResult, ResourceNode
from openviking.parse.parsers.base_parser import BaseParser
from openviking.storage.viking_fs import get_viking_fs
from openviking.utils.zip_safe import safe_extract_zip
from openviking_cli.utils.logger import get_logger

logger = get_logger(__name__)
Expand Down Expand Up @@ -460,7 +461,7 @@ async def _unpack_zip_to_temp_dir(self, zip_path: Path, resource_name: str) -> s

with tempfile.TemporaryDirectory() as extract_dir:
with zipfile.ZipFile(zip_path, "r") as zf:
zf.extractall(extract_dir)
safe_extract_zip(zf, extract_dir)
extract_path = Path(extract_dir)
items = [p for p in extract_path.iterdir() if p.name not in {".", ".."}]
if len(items) == 1 and items[0].is_dir():
Expand Down
Loading