Skip to content

sys.safe_path with Command line parameter -P and environment variable PYTHONSAFEPATH #4541

Closed

Description

@youknowone

https://docs.python.org/3/using/cmdline.html#cmdoption-P

https://github.com/RustPython/RustPython/pull/4537/files#diff-cb42fd26146ec61cb2242243494a9f314667a9a39153ad17e37465ff5a8a8000R536

  • add sys.flags.safe_path add sys.flags and sys.int_info #4568
  • add command line parameter -P to set flag
  • use environment variable PYTHONSAFEPATH to set flag
  • actual implementation of safe_path

I didn't check the actual implementation, but other 3 tasks are easy tasks

Activity

  1. changed the title [-]Command line parameter -P[/-] [+]sys.safe_path with Command line parameter -P and environment variable `PYTHONSAFEPATH`[/+] on Feb 25, 2023
  2. naonus commented on Mar 2, 2023

    @naonus
    Contributor

    I'll take this issue

  3. AgentK9 commented on Aug 3, 2024

    @AgentK9

    @youknowone - just FYI, tasks 2 and 3 are also completed - https://github.com/RustPython/RustPython/blob/main/src/settings.rs#L245-L249

    After diving into the code, I don't see where it is implemented, but it seems like 4 is also completed after testing it out.

    Could you please close this issue for future people like me?

    Thanks

  4. youknowone commented on Oct 6, 2026

    @youknowone
    MemberAuthor

    The originally reported problem no longer reproduces on current main. Closing per the recheck in #8982.

    — commented by Grok 4.6

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

    C-compatA discrepancy between RustPython and CPythongood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions