Skip to content

Generalize the possibility to configure sys.path with a ._pth file? #92801

Open
@fcollot

Description

@fcollot

On Windows it is possible, for embedding purposes, to use a ._pth file alongside the Python executable or shared library to override the path configuration at startup (https://docs.python.org/3/using/windows.html#finding-modules).

I've ported the Windows-specific code from PC/getpathp.c to Modules/getpath.c on my fork, as we need this functionality on all platforms. If you think this feature would be accepted I would be happy to clean the code and submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions