sysconfig.get_paths() returns potentially unwanted paths.
Description of the bug
Calling sysconfig.get_paths() within plugin_host returns invalid paths such as
- %APPDATA%\Sublime Text\Lib\site-packages
On MacOS it even might fail due to missing _sysconfigdata__darwin_darwin module, which needs to be created at build time.
Steps to reproduce
- Start ST in SAFE MODE
- Open console
- run
import sysconfig;sysconfig.get_paths().
Expected behavior
It should return valid python version specific paths like %APPDATA%\Sublime Text\Lib\python38
Actual behavior
It returns invalid python version agnostic paths like %APPDATA%\Sublime Text\Lib\site-packages, which might cause issues, when used.
Note: I haven't checked whether ST would actually import from those. They however may cause issues with some python packages such as coverage v7.x.
Sublime Text build number
4173
Operating system & version
Windows
(Linux) Desktop environment and/or window manager
No response
Additional information
No response
OpenGL context information
No response
FWIW: UnitTesting monkey patches coverage's add_third_party_paths() function which uses sysinfo.get_path() to avoid issues with missing modules or returning invalid paths.
https://github.com/SublimeText/UnitTesting/blob/4238294c83d2dcd839a0035ec7fc6beaa3439a00/unittesting/unit.py#L38