Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Windows-specific long-path detection lacks mocked-registry tests for enabled/disabled values, missing or inaccessible entries, and once-per-session caching.
1 open issue
What changed in this PR
Adds an early warning for DeepLabCut projects whose generated file paths may exceed Windows’ path-length limit.
Changes:
- Caches detection of the Windows long-path registry setting.
- Warns once per project using a path-length estimate, skipping nonexistent project directories.
- Tests warning behavior, deduplication, and repaired project paths.
| File | Description |
|---|---|
| tests/config/test_project_config.py | Adds path-length warning tests. |
| dlccore/config/validation.py | Adds cached Windows path-limit detection. |
| dlccore/config/project_config.py | Adds heuristic warnings with mitigation guidance. |
Review effort: Balanced
Comment on lines
+37
to
+41
| try: | ||
| with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SYSTEM\CurrentControlSet\Control\FileSystem") as key: | ||
| enabled, _ = winreg.QueryValueEx(key, "LongPathsEnabled") | ||
| except OSError: | ||
| return True |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

On Windows without long paths enabled, files DeepLabCut writes deep inside a project can exceed the 260-character
MAX_PATHand fail with a bareFileNotFoundError(e.g.savematincreate_training_dataset, at 277 characters).ProjectConfignow logs a warning, once per project, whenlen(project_path) + 2 * len(Task) + 120reaches 260. The estimate is a heuristic based on the evaluation results path.The message suggests toggling
LongPathsEnabled, moving the project closer to the drive root, or shorteningTask.Longer network or video names can still exceed the limit without a warning. It is meant as an estimate rather than a catch-all check.
LongPathsEnabledunset; the registry is read once per session (windows_max_path_appliesinvalidation.py).project_pathis not an existing directory, so a moved project's stale path does not warn. The repaired path is checked when_post_yaml_load_updatesassigns it (validate_assignmentreruns the validator).