Skip to content

sys.orig_argv is not original, at least on some systems #125006

@pkit

Description

@pkit

In an OSX .venv the "original" sys.orig_argv is not really original...

(.venv) % cat orig.py
import sys

print(sys.orig_argv)

(.venv) % python orig.py 
['/opt/homebrew/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python', 'orig.py']

(.venv) % which python
/Users/user/git/project/.venv/bin/python

I can use os.environ["_"] but it's a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions