Files
openide/python/helpers/syspath.py
Mikhail Golubev 9d1044156d PY-58201 Add protection against CWD entries among interpreter paths
The problem was introduced in a5884f47c5f29e20915481944c4ad9390708f752
and then fixed in fb7c98e8df472dbe8cc0510f002fdde72f0b8770.

Namely, for a non-existing value of the system PYTHONPATH we ended up adding
an extra ":" at the end of our PYTHONPATH before running the syspath.py helper.
Whenever Python interpreter encounters a non-absolute entry in PYTHONPATH
it tries to resolve it relatively to the current working directory and for
the PyCharm process on macOS the latter was "/". Hence, we ended up with
the filesystem root among detected interpreter paths and started indexing it.

I added protection against such entries in syspath.py, assuming that no one
is going to intentionally include an IDE's working directory into PYTHONPATH,
as well as handling of an empty list of path entries in
PythonScripts.appendToPythonPath.

GitOrigin-RevId: d1f3ee4b844edf95e0d24e3245ab73b4a39194f5
2023-01-03 21:11:26 +00:00

349 B