Files
mempalace/tests
mvalentsev 765478d37a fix(init): also strip leaked sys.path entries (#1423)
Popping PYTHONPATH from os.environ alone is insufficient: the interpreter
populates sys.path from PYTHONPATH at startup, before package init runs.
Transitive imports of compiled extensions (pydantic_core,
chromadb_rust_bindings) would still resolve from the leaked path even
after the env var is cleared.

Now also remove the matching entries from sys.path so the import search
path no longer contains the wrong Python's site-packages.

Test extended with a multi-path PYTHONPATH case and assertions on both
os.environ and sys.path after import.
2026-05-13 22:53:36 +05:00
..