Skip to content

Python 3.11 and above adding default module search path from the “PythonPath” registry key if the standard library was found already #119920

Open
@tanzim

Description

@tanzim

Bug report

Bug description:

Please see https://discuss.python.org/t/behaviour-change-in-python-3-11-compatibility-break-or-genuine-fix/54729

There's also another issue highlited in the same module by the author, but it's not important as we can workaround by setting PYTHONNOUSERSITE as seen below.

"Including import site inadvertently enables the user site packages directory because the configuration with a ._pth file doesn’t explicitly disable it. I think it should because I can’t imagine why an embedding application would ever want that. You’ll have to set PYTHONNOUSERSITE to work around this."

CPython versions tested on:

3.10, 3.11, 3.12

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions