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
getpath miscalculates sys.path from second initialization with PYTHONHOME on Windows #91985
Comments
This comment was marked as outdated.
This comment was marked as outdated.
On
|
…th with PYTHONHOME
Okay, so the problem is that IIRC, other tests were broken if we check against real_executable for the build landmarks and ignore PYTHONHOME (presumably because they used symlinks to a new directory for tests?), so this probably just needs new logic. However, the fix in #92980 might also affect this, by not recalculating sys.path on subsequent calls. You might want to test again before changing too much. |
I can also start python in their file layouts, but |
Had a quick look at your changes, but honestly am going to need a lot more time to figure out that the logic is sound. That also concerns me, because I really want to avoid putting any logic for this stuff back in C - moving to Python was to fix that ;-) Another idea that might work: what if we just add a config field for "running in-tree build"? It can start as "unspecified" and then be updated if we detect landmarks. Then even if home is already set but we know we're in tree, we can go down the path that overrides platlibdir. What do you think? |
Thanks for your feedback. IIUC, we have no way to update the original config? getpath updates the config which was duplicated at I think the flag will work if you would be ok with saving it into the global config. |
Oh I see, it's the path config state that's keeping the values around. If we copy |
My experiment (#92411) passed the repeating tests, keeping |
All of |
…y path calculation
…y path calculation (pythonGH-93641) (cherry picked from commit 38af903) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
@neonene Is this fixed now or there is still work to be done ? |
I assume we delay 3.11 backporting just in case. |
When I ran the code below in a python build directory:
PYTHONHOME
:set PYTHONHOME=C:\cpython-main
:Currently, test_embed fails due to this. (#32313)
The text was updated successfully, but these errors were encountered: