Skip to content

Values in pyvenv.cfg do not reflect the real paths on case insensitive file systems #2684

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

Closed
ofek opened this issue Jan 22, 2024 · 6 comments
Labels

Comments

@ofek
Copy link
Contributor

ofek commented Jan 22, 2024

I noticed this because within a virtual environment the paths that sysconfig returns are in all caps for some reason:

Screenshot 2024-01-21 220244

home = C:\USERS\OFEK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON311
implementation = CPython
version_info = 3.11.1.final.0
virtualenv = 20.25.0
include-system-site-packages = false
base-prefix = C:\USERS\OFEK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON311
base-exec-prefix = C:\USERS\OFEK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON311
base-executable = C:\USERS\OFEK\APPDATA\LOCAL\PROGRAMS\PYTHON\PYTHON311\PYTHON.EXE

This might not seem like a big deal but users see these paths in debug output when building packages if the build uses virtual environments.

@ofek ofek added the bug label Jan 22, 2024
@ofek
Copy link
Contributor Author

ofek commented Jan 22, 2024

Saving the resolved paths like this issue wants would also fix this because os.path.realpath returns the path as saved on disk.

@gaborbernat
Copy link
Contributor

PR welcome to address this is welcome 👍

@ofek
Copy link
Contributor Author

ofek commented Jan 22, 2024

Can you please point to the general area of the code base that I should look at?

@ofek
Copy link
Contributor Author

ofek commented Jan 22, 2024

I don't know why but upgrading from 3.11.1 to 3.11.7 fixed the issue.

@pelson
Copy link

pelson commented Jan 8, 2025

Would this equally have been solved by calling os.path.normpath? I ask because the use of os.path.realpath (instead of recursively calling os.readlink) in #2686 is problematic and diverges from venv (and now uv venv).

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

No branches or pull requests

3 participants