Skip to content

Preserve case when loading firmware from WSL UNC shares - #142

Open
Prasana-sys wants to merge 1 commit into
dronecan:masterfrom
Prasana-sys:fix/wsl-unc-firmware-paths
Open

Prasana-sys wants to merge 1 commit into
dronecan:masterfrom
Prasana-sys:fix/wsl-unc-firmware-paths

Conversation

@Prasana-sys

@Prasana-sys Prasana-sys commented Sep 16, 2026

Copy link
Copy Markdown

Selecting firmware from a WSL share on Windows can fail with “Specified firmware file is not readable”: os.path.normcase() changes a directory such as FirmwareProject to firmwareproject, which does not exist on the case-sensitive Linux filesystem. The file-server widget repeats the same conversion after selection.

Add a shared normalize_local_path() helper and use it for firmware selection, FileServerWidget.add_path, and PathItem.path. Preserve case for both \\wsl.localhost\ and \\wsl$\, including Qt-style forward slashes, while retaining existing normalization for ordinary Windows paths, generic UNC paths, and POSIX paths. The existing short-key firmware protocol stays unchanged.

Add 23 pytest cases covering path normalization and the firmware-selection-to-file-read flow, and run them in the existing Python package workflow.

Validation:

  • All 23 tests pass on Windows with Python 3.12.14, DroneCAN 1.0.27, and PyQt6 6.11.0.
  • Restoring the original widget code reproduces both WSL integration failures; the local-file case still passes.
  • Real Windows-to-WSL testing reproduces FileNotFoundError before the fix in both namespaces. After the fix, selection, short-key resolution, GetInfo, and 895 chunks totaling 228,892 bytes succeed with matching SHA-256 hashes.
  • The patch applies cleanly to the base commit and all 23 tests pass again on that clean copy.

The CAN node was simulated; no physical device was flashed. Legacy non-key directory lookup in the DroneCAN dependency is outside this firmware-update fix.

@Prasana-sys
Prasana-sys force-pushed the fix/wsl-unc-firmware-paths branch from 62d6dc4 to 677122a Compare September 16, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant