Open seirl opened 5 years ago
The fix is just this:
diff --git a/pythonloc/pythonloc.py b/pythonloc/pythonloc.py
index f5f77bf..913223f 100644
--- a/pythonloc/pythonloc.py
+++ b/pythonloc/pythonloc.py
@@ -27,7 +27,7 @@ def _get_pypackages_lib_path(script_path=None):
def _get_env(script_path=None):
env = dict(os.environ)
env["PYTHONPATH"] = os.path.pathsep.join(
- [".", _get_pypackages_lib_path(script_path)]
+ [_get_pypackages_lib_path(script_path)]
+ os.getenv("PYTHONPATH", "").split(os.path.pathsep)
)
return env
Is this expected?
It doesn't seem reasonable at all to me that running a random script installed on my system with pythonloc would override its libraries with potentially arbitrary code in the directory I'm running the script from.