Skip to content

Fix Windows path resolution for normalization_path#81

Open
AnnihilatorChess wants to merge 1 commit intoPolymathicAI:masterfrom
AnnihilatorChess:patch-2
Open

Fix Windows path resolution for normalization_path#81
AnnihilatorChess wants to merge 1 commit intoPolymathicAI:masterfrom
AnnihilatorChess:patch-2

Conversation

@AnnihilatorChess
Copy link
Contributor

Summary

The normalization path refactor introduced in #69 breaks on Windows due to a platform-specific path separator issue.

.lstrip("./") on this line only strips Unix-style separators (. and /). On Windows, os.path.join produces backslash-separated paths, so .removeprefix(trunk_path) leaves a leading \ (e.g. \stats.yaml), which .lstrip("./") does not strip. When this is passed to os.path.join, Windows interprets the leading \ as a drive-root path, resolving to C:\stats.yaml instead of the correct dataset-relative path.

Fix

Adding \ to the lstrip characters: .lstrip("./\\") — this has no effect on macOS/Linux since backslashes don't appear in paths there.

Steps to reproduce

  1. On Windows, configure well_base_path as a relative path (e.g. ../../datasets/)
  2. Run training with use_normalization=True
  3. normalization_path incorrectly resolves to C:\stats.yaml

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