bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.17k stars 392 forks source link

`memray run` overwrites `sys.argv[0]` even when `-I` or `-P` is used #551

Closed godlygeek closed 7 months ago

godlygeek commented 7 months ago

memray run tries to match the updates to sys.path that are performed by the interpreter itself when it starts. When those path updates are suppressed (by the -I or -P command line flags or their corresponding environment variables), Memray's emulation winds up overwriting paths in sys.path that needed to be left alone.