Worker: recipe_dir con lettera di unita rifiutato su ogni OS (#46)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import asyncio
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
@@ -61,6 +62,8 @@ def _resolve_recipe_dir(recipe_dir: str | None) -> Path | None:
|
||||
root = Path(os.environ.get("VISION_RECIPES_ROOT", _RECIPES_ROOT_DEFAULT)).resolve()
|
||||
if (
|
||||
Path(rel).is_absolute()
|
||||
# #46: lettera di unita (C:/x) rifiutata su ogni OS; UNC coperto da startswith("\\")
|
||||
or re.match(r"^[A-Za-z]:", rel)
|
||||
or rel.startswith(("/", "\\"))
|
||||
or ".." in Path(rel.replace("\\", "/")).parts
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user