Skip to content

Fix Windows system directory detection for anchored paths#6

Closed
AperturePlus wants to merge 1 commit intodevelopfrom
codex/fix-assertion-errors-in-windows-path-tests
Closed

Fix Windows system directory detection for anchored paths#6
AperturePlus wants to merge 1 commit intodevelopfrom
codex/fix-assertion-errors-in-windows-path-tests

Conversation

@AperturePlus
Copy link
Owner

Motivation

  • Property tests were failing on non-Windows CI because _is_windows_system_directory produced false negatives for Windows paths that include an anchor (for example C:\Program Files (x86)), due to how PureWindowsPath.parts represents anchored paths on POSIX hosts.

Description

  • Update _is_windows_system_directory in src/aci/core/path_utils.py to inspect PureWindowsPath.anchor and strip Windows anchor prefixes (e.g. C:\, \\server\share\) before examining leading path components against WINDOWS_SYSTEM_DIRS.
  • Preserve the defensive fallback that strips c:-style drive prefixes when present.
  • Leave the existing resolved-Path fallback logic intact so native Windows behavior is unchanged.

Testing

  • Ran pytest tests/unit/test_cli.py::TestCLIHelp::test_index_help tests/unit/test_cli.py::TestCLIHelp::test_search_help and both tests passed locally.
  • Attempted to run the property tests that originally failed, but test collection aborted with ModuleNotFoundError: No module named 'hypothesis' in this environment, so the property-suite validation could not be completed here.
  • Prior to the fix the full test run reported 4 failed, 665 passed; the change addresses the Windows-path detection failure that caused the property test failures in CI.

Codex Task

@AperturePlus
Copy link
Owner Author

@AperturePlus AperturePlus deleted the codex/fix-assertion-errors-in-windows-path-tests branch February 21, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant