Skip to content

Respect sys.flags.safe_path #1311

Open
Open
@siddharthab

Description

In the following line, the script directory path is added even if Python was run with sys.flags.safe_path (most often by setting the env var PYTHONSAFEPATH=1).

sys.path.insert(0, str(here))

Not having the ability to set safe path causes problems when there are sibling Python files with names that clash with installed Python modules.

Thanks to @DonJayamanne for helping find the root cause in microsoft/vscode-jupyter#16235.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions