Skip to content

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

Closed

Description

@ofek

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.

Activity

  1. ofek commented on Jan 22, 2024

    @ofek
    SponsorContributorAuthor

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

  2. gaborbernat commented on Jan 22, 2024

    @gaborbernat
    Contributor

    PR welcome to address this is welcome 👍

  3. ofek commented on Jan 22, 2024

    @ofek
    SponsorContributorAuthor

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

  4. ofek commented on Jan 22, 2024

    @ofek
    SponsorContributorAuthor

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

  5. pelson commented on Jan 8, 2025

    @pelson

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions