Skip to content

Fix publication_output_dir_fields to correctly handle Windows backslash paths on Linux#54

Merged
LuisMRaimundo merged 1 commit into
improve-density-edge-contract-tests-2from
chunk/fix-publication-output-dir-windows-path
Jun 12, 2026
Merged

Fix publication_output_dir_fields to correctly handle Windows backslash paths on Linux#54
LuisMRaimundo merged 1 commit into
improve-density-edge-contract-tests-2from
chunk/fix-publication-output-dir-windows-path

Conversation

@circleci-app

@circleci-app circleci-app Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • publication_output_dir_fields used Path(str(path)) to extract the basename, but on Linux Path does not split on backslashes. For a path like C:\Users\bob\Downloads\run\clip.wav, Path(...).name returned the entire string instead of clip.wav, leaving username fragments in the sanitized output.
  • Applied the same Windows-path detection pattern already used by sanitize_path_for_publication (lines 706–716): detect _WIN_ABS_START_EXPORT match or \\ in the string, then use PureWindowsPath for the name extraction.
  • Fixes job 159 failure: test_sanitized_export_tree_contains_no_windows_username_fragments asserted bob was absent from the sanitized JSON but found it in output_dir.

Test plan

  • tests/phase_12/test_metadata_sanitizer_contract_additional.py::test_sanitized_export_tree_contains_no_windows_username_fragments passes
  • Full test suite (tests/phase_12/test_metadata_sanitizer_contract_additional.py) passes
  • Existing publication_output_dir_fields callers (forward-slash Windows paths, POSIX paths) unaffected

https://app.circleci.com/agents/gh/LuisMRaimundo/chat/7cea25d8-448d-4fb1-bb6b-90a837e01e2e

…tyle paths

On Linux, Path(r"C:\Users\bob\...") treats the whole string as a single
path component, so .name returns the full path. Apply the same
Windows-detection logic already used by sanitize_path_for_publication
so backslash-style paths are parsed with PureWindowsPath, yielding the
correct basename without username fragments.

AI-Generated: true
@LuisMRaimundo LuisMRaimundo merged commit 6d46dc4 into improve-density-edge-contract-tests-2 Jun 12, 2026
4 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.

1 participant