feat: Enhance URL conversion and bridge script handling for improved drag-and-drop functionality
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
This commit is contained in:
parent
9edadc2c16
commit
cbd8ed0186
4 changed files with 275 additions and 37 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"""URL to local path conversion for Azure Blob Storage URLs."""
|
||||
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from urllib.parse import unquote
|
||||
|
|
@ -51,13 +52,14 @@ class URLConverter:
|
|||
# Combine with local path
|
||||
local_path = Path(mapping.local_path) / relative_path
|
||||
|
||||
# Normalize path (resolve .. and .) but don't follow symlinks yet
|
||||
try:
|
||||
# On Windows, normalize separators
|
||||
local_path = Path(str(local_path).replace("/", "\\"))
|
||||
except (OSError, RuntimeError) as e:
|
||||
logger.warning(f"Failed to normalize path {local_path}: {e}")
|
||||
return None
|
||||
# Keep legacy Windows separator normalization to preserve
|
||||
# existing Windows drag/drop behavior.
|
||||
if os.name == "nt":
|
||||
try:
|
||||
local_path = Path(str(local_path).replace("/", "\\"))
|
||||
except (OSError, RuntimeError) as e:
|
||||
logger.warning(f"Failed to normalize path {local_path}: {e}")
|
||||
return None
|
||||
|
||||
logger.debug(f"Converted URL to path: {url} -> {local_path}")
|
||||
return local_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue