Skip to content

sysconfig values for platstdlib do not appear to be accurate #119845

Open
@ncoghlan

Description

@ncoghlan

Bug report

Bug description:

The values set for platstdlib in the sysconfig scheme paths are not consistent with the way sys.path is configured in getpath.py

sysconfig: https://github.com/python/cpython/blob/main/Lib/sysconfig/__init__.py#L28
getpath: https://github.com/python/cpython/blob/main/Modules/getpath.py#L182

Given this appears to have been wrong essentially forever, it appears nobody is using platstdlib for anything important (even I only noticed because running -m sysconfig inside a venv reports a platstdlib path inside the venv, which is definitely not right).

Still, it should be possible to make them at least a bit more consistent with the way sys.path is actually initialised (appending lib-dynload to the stdlib path looks to be sufficient for non-Windows system, but I'm less sure on Windows)

CPython versions tested on:

3.12

Operating systems tested on:

Linux, Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-sysconfigtopic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions