Skip to content

gh-42477: Normalize temporary path in docbuild doctest - #42632

Open
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:codex/fix-docbuild-macos-realpath-doctest
Open

gh-42477: Normalize temporary path in docbuild doctest#42632
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:codex/fix-docbuild-macos-realpath-doctest

Conversation

@cxzhong

@cxzhong cxzhong commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • compare the namespace-package import root with the canonical temporary path
  • make the doctest portable to macOS, where a temporary path under /var may resolve under /private/var

Root cause

_extend_over_namespace_packages() deliberately canonicalizes both sys.path entries and the input directory with os.path.realpath(). The doctest compared the returned canonical path with the unnormalized string returned by TemporaryDirectory(). These strings can differ on macOS even though they identify the same directory.

This changes only the doctest expectation; runtime behavior is unchanged.

Follow-up to #42477.

Testing

  • python src/bin/sage-runtests --warn-long 5.0 src/sage_docbuild/builders.py
    • 136 tests passed

@cxzhong
cxzhong marked this pull request as ready for review August 6, 2026 05:01
@cxzhong
cxzhong requested a review from jhpalmieri August 6, 2026 05:19
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Documentation preview for this PR (built with commit cb04b4a; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@jhpalmieri

Copy link
Copy Markdown
Member

Marking as a blocker since without it there is a failing doctest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants