Skip to content

Fix Windows path resolution for normalization_path#81

Merged
mikemccabe210 merged 1 commit intoPolymathicAI:masterfrom
AnnihilatorChess:patch-2
Mar 16, 2026
Merged

Fix Windows path resolution for normalization_path#81
mikemccabe210 merged 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

Copy link
Contributor

@mikemccabe210 mikemccabe210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Thanks for addressing this.

@mikemccabe210 mikemccabe210 merged commit b408b0b into PolymathicAI:master Mar 16, 2026
3 checks passed
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.

2 participants