Skip to content

fix(sessions): support cross-platform path separators in is_anonymous_session - #1942

Open
zariffromlatif wants to merge 1 commit into
httpie:masterfrom
zariffromlatif:fix/cross-platform-anonymous-session-path
Open

fix(sessions): support cross-platform path separators in is_anonymous_session#1942
zariffromlatif wants to merge 1 commit into
httpie:masterfrom
zariffromlatif:fix/cross-platform-anonymous-session-path

Conversation

@zariffromlatif

Copy link
Copy Markdown

Summary

Fixes an issue where \is_anonymous_session()\ checked only \os.path.sep\ (\\\ on Windows), causing relative session paths using forward slash separators (e.g. \path/to/session.json) to be incorrectly classified as named host sessions on Windows.

Changes

  • Updated \is_anonymous_session()\ to check both \os.path.sep\ and \os.path.altsep\ (\os.path.sep in session_name or bool(os.path.altsep and os.path.altsep in session_name)).
  • Added unit test \ est_is_anonymous_session_cross_platform\ verifying POSIX, Windows, and named session inputs.

Verification

  • 62/62 session tests passing locally (\pytest tests/test_sessions.py).

Copilot AI lite review requested due to automatic review settings August 26, 2026 18:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants