1
0
forked from VimPlug/jedi

This fixes two issues with the caching on Windows:

* the cache directory should really be %LOCALAPPDATA%
 * ~ is not a meaningful directory on Windows. It should really be
   os.path.expanduser('~'). To be honest it is probably always safe to
   assume that os.getenv('LOCALAPPDATA') executes to something sensible
   on any Windows system that hasn't been tampered with.
This commit is contained in:
Max Mäusezahl
2020-05-10 11:16:12 +02:00
committed by Dave Halter
parent bf4ec2282f
commit 1115cbd94d
2 changed files with 4 additions and 3 deletions

View File

@@ -69,8 +69,8 @@ Adds an opening bracket after a function for completions.
# ----------------
if platform.system().lower() == 'windows':
_cache_directory = os.path.join(os.getenv('APPDATA') or '~', 'Jedi',
'Jedi')
_cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or
os.path.expanduser('~'), 'Jedi', 'Jedi')
elif platform.system().lower() == 'darwin':
_cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi')
else:
@@ -81,7 +81,7 @@ cache_directory = os.path.expanduser(_cache_directory)
The path where the cache is stored.
On Linux, this defaults to ``~/.cache/jedi/``, on OS X to
``~/Library/Caches/Jedi/`` and on Windows to ``%APPDATA%\\Jedi\\Jedi\\``.
``~/Library/Caches/Jedi/`` and on Windows to ``%LOCALAPPDATA%\\Jedi\\Jedi\\``.
On Linux, if the environment variable ``$XDG_CACHE_HOME`` is set,
``$XDG_CACHE_HOME/jedi`` is used instead of the default one.
"""