From 72608704d8fc631467f75f666868e717f702094e Mon Sep 17 00:00:00 2001 From: Siddhartha Gandhi Date: Tue, 6 Jun 2017 01:58:29 -0400 Subject: [PATCH] Change Windows default cache directory to local (#1) Change Windows default cache directory to local From an issue that called for: The default jedi cache directory is the roaming folder. In my company, we have restrictions on the file size of the Roaming folder (since I believe these settings are synced across computers). The jedi cache really isn't a fundamental user setting that needs to be synced across devices, so it really should be in the local app data folder. So I propose here that the default windows path use the environment variable %LocalAppData% instead. --- parso/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parso/cache.py b/parso/cache.py index 3a8f851..95d8d97 100644 --- a/parso/cache.py +++ b/parso/cache.py @@ -41,7 +41,7 @@ http://docs.python.org/3/library/sys.html#sys.implementation def _get_default_cache_path(): if platform.system().lower() == 'windows': - dir_ = os.path.join(os.getenv('APPDATA') or '~', 'Parso', 'Parso') + dir_ = os.path.join(os.getenv('LOCALAPPDATA') or '~', 'Parso', 'Parso') elif platform.system().lower() == 'darwin': dir_ = os.path.join('~', 'Library', 'Caches', 'Parso') else: @@ -53,7 +53,7 @@ _default_cache_path = _get_default_cache_path() The path where the cache is stored. On Linux, this defaults to ``~/.cache/parso/``, on OS X to -``~/Library/Caches/Parso/`` and on Windows to ``%APPDATA%\\Parso\\Parso\\``. +``~/Library/Caches/Parso/`` and on Windows to ``%LOCALAPPDATA%\\Parso\\Parso\\``. On Linux, if environment variable ``$XDG_CACHE_HOME`` is set, ``$XDG_CACHE_HOME/parso`` is used instead of the default one. """