Repository navigation
Fix Windows Blender discovery test PosixPath on Python 3.13 - #17
Merged
Merged
Conversation
Python 3.13 refuses to construct PosixPath on native Windows. Capture the host concrete Path subclass before the platform mocks so the Program Files fixture still works on every OS.
10-X-eng
approved these changes
Nov 4, 2026
10-X-eng
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this looks right. Taking host_path = type(Path()) before the platform mocks is the key detail: Path() under the patched os.name would pick WindowsPath on Linux and fail.
- Linux and macOS:
host_pathis stillPosixPath, so the test behaves as it did before. - Windows:
host_pathisWindowsPath, so both_candidatesand theis_file()check infake_probecan reach the temp folder. The Program Files layout assertions are unchanged.
The change only touches tests/test_blender_runtime.py, so app behaviour isn't affected.
Two small notes, neither blocking:
- The comment in
fake_probeaboutpathlib.Pathmissing the file only describes non-Windows hosts. - The rest of this file writes assignments as
x=y, whilehost_path = type(Path())has spaces.
As you said, this hasn't been run on native Windows yet, so a run there would still be a useful confirmation.
Thanks, this looks good to us! Outside changes always get a final look from a maintainer before they go in.
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.
What doesn't work
test_windows_discover_keeps_program_files_layoutbuilds its Program Files fixture withpath_type=PosixPathand asserts withPosixPath(path).is_file(). On native Windows, Python 3.13 refuses to constructPosixPath(the same rule blocksWindowsPathon macOS and Linux), so the test can't run on the platform it covers. Thanks to @TheronRogers for flagging this on #15.The change
The test takes the host's own path class (
host_path = type(Path())) before the platform mocks and passes it to_candidatesandis_file(), and thePosixPathimport is removed. Discovery still gets a real path class that can reach the temp folder on any OS, and the Program Files layout check is unchanged.Tests
python -m unittest tests.test_blender_runtimepasses 15/15 before and after on macOS (Apple Silicon, Python 3.13). Not run on native Windows; a Windows check from a maintainer or Theron would be welcome. 1 file, +9/−5.