mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Reset __PYVENV_LAUNCHER__ set by MacPorts that breaks site-packages in venvs (PY-18074)
Python 3.3+ interpreters installed via MacPorts set the system-wide __PYVENV_LAUNCHER__ environment variable to point to the original Python interpreter. That prevents any venvs from setting their correct site-packages directories, because this variable is used in site.py initialization logic for setting an alternative root for venvs. This fix sets the __PYVENV_LAUNCHER__ to point to the correct location of the project intepreter if this environment variable exists.
This commit is contained in:
@@ -46,9 +46,9 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jetbrains.python.sdk.PythonEnvUtil.setPythonIOEncoding;
|
||||
import static com.jetbrains.python.sdk.PythonEnvUtil.setPythonUnbuffered;
|
||||
import static com.jetbrains.python.sdk.PythonEnvUtil.*;
|
||||
|
||||
/**
|
||||
* User : catherine
|
||||
@@ -165,10 +165,14 @@ public class SphinxBaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
setPythonIOEncoding(cmd.getEnvironment(), "utf-8");
|
||||
setPythonUnbuffered(cmd.getEnvironment());
|
||||
cmd.getEnvironment().put("PYCHARM_EP_DIST", "Sphinx");
|
||||
cmd.getEnvironment().put("PYCHARM_EP_NAME", "sphinx-quickstart");
|
||||
final Map<String, String> env = cmd.getEnvironment();
|
||||
setPythonIOEncoding(env, "utf-8");
|
||||
setPythonUnbuffered(env);
|
||||
if (sdkHomePath != null) {
|
||||
resetHomePathChanges(sdkHomePath, env);
|
||||
}
|
||||
env.put("PYCHARM_EP_DIST", "Sphinx");
|
||||
env.put("PYCHARM_EP_NAME", "sphinx-quickstart");
|
||||
|
||||
List<String> pathList = Lists.newArrayList(PythonCommandLineState.getAddedPaths(sdk));
|
||||
pathList.addAll(PythonCommandLineState.collectPythonPath(module));
|
||||
|
||||
Reference in New Issue
Block a user