Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_run_env_systemroot seems to be failing on python 3.12.8 #902

Closed
Shawn8901 opened this issue Dec 12, 2024 · 1 comment · Fixed by #903
Closed

test_run_env_systemroot seems to be failing on python 3.12.8 #902

Shawn8901 opened this issue Dec 12, 2024 · 1 comment · Fixed by #903
Labels

Comments

@Shawn8901
Copy link

Shawn8901 commented Dec 12, 2024

Current Behavior

nox' test test_run_env_systemroot fails on python 3.12.8

Expected Behavior

test_run_env_systemroot should not fail on >=python 3.12.8

Steps To Reproduce

I am reporting this as a failure of a current rebuilding on NixOS that bumped python 3.12.7 -> 3.12.8.

The build logs from CI can be found here: https://hydra.nixos.org/build/281820678/nixlog/1

I tried to dig into the source code changes of 3.12.8 for shutil.which and i think the test is failing because of the following change:
python/cpython@8899e85

The change intention on cpython is to fix behavior for which on windows systems.
The test_run_env_systemroot is running shutil.which with mocked sys.platform = "win32" so should be affected by the change.

In Lib/shutil.py the line 1558 change removes cmd from the windows lookup path thus the test is failing in our ci suite.

Environment

- OS: NixOS 25.05 (nixos-unstable)
- Python: 3.12.8
- Nox: 2024.10.09

Anything else?

In addition os.pathsep (line 1553) does return an unexpected pathseperator when having the mock sys.platform = "win32" active. So i kind of have the feeling that the overall test setup is not correct when building in linux systems

I am actually not sure why sys.platform is mocked on the test at all, shouldnt it work the same on any platform?

@Shawn8901
Copy link
Author

Shawn8901 commented Dec 14, 2024

thx for the patch 🙂 seems to unbreak our ci.

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

Successfully merging a pull request may close this issue.

1 participant