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

gh-91985: Fix sys.path calculation with PYTHONHOME on Windows #92288

Closed
wants to merge 9 commits into from
Closed

gh-91985: Fix sys.path calculation with PYTHONHOME on Windows #92288

wants to merge 9 commits into from

Conversation

neonene
Copy link
Contributor

@neonene neonene commented May 4, 2022

This workaround inserts a dll build directory into sys.path to avoid import errors.
Here is an output of C code in the description of #91985:

  • set PYTHONHOME=C:\cpython-main
0
C:\cpython-main\PCbuild\amd64\python311.zip
c:\cpython-main\Lib
C:\cpython-main\PCbuild\amd64
c:\cpython-main
c:\cpython-main\Lib\site-packages

1
C:\cpython-main\PCbuild\amd64\python311.zip
c:\cpython-main\Lib
C:\cpython-main\PCbuild\amd64     # <<<<< inserted
c:\cpython-main\DLLs
c:\cpython-main
c:\cpython-main\Lib\site-packages

2
C:\cpython-main\PCbuild\amd64\python311.zip
c:\cpython-main\Lib
C:\cpython-main\PCbuild\amd64     # <<<<< inserted
c:\cpython-main\DLLs
c:\cpython-main
c:\cpython-main\Lib\site-packages

f'{PYTHONHOME}/DLLs' is left just for test_embed.test_init_setpythonhome.

Modules/getpath.py Outdated Show resolved Hide resolved
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.

4 participants