Skip to content

Conversation

@allison-truhlar
Copy link
Collaborator

@allison-truhlar allison-truhlar commented Jan 6, 2026

This fix was triggered by test_patch_file_move in test_endpoints.py failing only when running on macOS due to /var being a symlink to /private/var. To fix this, and also to fix the new symlink redirect code on macOS, instances of os.path.normpath and os.path.abspath were replaced with os.realpath.

You can test this by running test_endpoints.py on macOS without the change (should fail) and then with the change (should pass).
You can also test it by running pixi run test-ui on macOS without the change (13/16 tests will fail) and then with the change (all should pass).

@krokicki @neomorphic

On macOS, /var is a symlink to /private/var. This resulted in test_path_file_move failing because the code would:
- resolve paths with realpath() → /private/var/...
- calculate relative path with os.path.relpath() → creates paths like ../../../../../../private/var/...
- on subsequent calls, joining this relative path with the unresolved root caused /private/private/var/...
- tests macOS behavior, eg., /var => /private/var
@allison-truhlar allison-truhlar changed the title fix: use os.path.relpath() to accommodate /var symlink on macos fix: use os.path.realpath() to accommodate /var symlink on macos Jan 15, 2026
@allison-truhlar allison-truhlar changed the title fix: use os.path.realpath() to accommodate /var symlink on macos fix: use os.path.realpath() to accommodate "private/" symlinks on macos Jan 15, 2026
Copy link
Member

@neomorphic neomorphic left a comment

Choose a reason for hiding this comment

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

I had done this already for another piece of code in commit 5d69b8f, so I approve.

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.

3 participants