fix(constants): render display_hermes_home tail with forward slashes - #49507
Open
Bartok9 wants to merge 2 commits into
Open
fix(constants): render display_hermes_home tail with forward slashes#49507Bartok9 wants to merge 2 commits into
Bartok9 wants to merge 2 commits into
Conversation
Contributor
|
Thanks for the focused Windows regression fix. Current main still has the reported behavior at Problems
Suggested changes
Automated hermes-sweeper review. |
Rebuilt on latest main (Bartok9 hygiene 2026-08-01). Original: NousResearch#49507
Contributor
Author
|
Rebuilt onto latest — Bartok9 public PR hygiene 2026-08-01 |
Bartok9
force-pushed
the
fix/49500-display-hermes-home-posix
branch
from
August 1, 2026 17:35
5a4f3e6 to
4c0870c
Compare
…tok9 Per-PR attribution so check-attribution passes on this branch (Teknium).
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.
Summary
display_hermes_home()rendered a mixed POSIX/Windows path on Windows.hermes doctor(and any other consumer) now shows a uniform~/-prefixed path.Motivation
Closes #49500.
hermes doctordisplayed:That mixes a POSIX
~/prefix, a WindowsAppData\Local\middle, and a POSIX/.envtail.Root cause is in
display_hermes_home():On Windows,
home.relative_to(Path.home())is aWindowsPathwhosestr()uses backslashes, so the POSIX~/prefix is concatenated to a backslash tail.doctor.pythen appends/.env, producing the reported mixed string.Fix
Use
.as_posix()on the relative tail so it renders with forward slashes, matching the~/prefix:On POSIX,
as_posix()is identical tostr(), so existing behavior is unchanged. TheValueErrorfallback (HERMES_HOME outside the user home) still returns the native absolute path.Verification
python3 -m pytest tests/test_hermes_constants.py— 52 passedTestDisplayHermesHomeregression test fails on current code without the fix and passes with it.Real behavior proof
C:\Users\tester\AppData\Local\hermesrendered as~/AppData\Local\hermes.get_hermes_home()/Path.home()):tests/test_hermes_constants.py::TestDisplayHermesHome::test_windows_relative_tail_uses_forward_slashes— asserts~/AppData/Local/hermesand"\\" not in result; FAILS without the fix (gets~/AppData\Local\hermes).Note on related PR
Open PR #38695 also touches this area but for cron-script validation; open #21929 edits
display_hermes_home()for the distinctHERMES_HOME == HOME(~/.) case by adding a guard above thetryblock. This change only touches thereturnline inside thetry, so the two are independent / non-conflicting.