Skip to content

Fix Windows script path normalization - #874

Open
dajiaohuang wants to merge 1 commit into
custom-components:masterfrom
dajiaohuang:fix-windows-script-paths
Open

dajiaohuang wants to merge 1 commit into
custom-components:masterfrom
dajiaohuang:fix-windows-script-paths

Conversation

@dajiaohuang

Copy link
Copy Markdown

On Windows, load_scripts previously sliced the root path and removed only forward slashes, leaving backslashes in module names such as file.\hello. Normalize the relative path with os.path.relpath and slash separators so file, apps, modules, and scripts contexts are derived consistently across platforms. Adds a regression test for Windows-style paths. Validation: ruff check and format, pylint, mypy, py_compile, and git diff --check pass. The full pytest suite could not start on this Windows host because the Home Assistant test plugin imports POSIX-only fcntl; repository CI remains the complete test environment.

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