From 89932c368dc24d991e0418a032e96723dc5a1683 Mon Sep 17 00:00:00 2001 From: Mike Morearty Date: Sun, 22 Oct 2017 16:58:00 -0700 Subject: [PATCH] Fix the cache path Any caller of Parso can specify a cache path, and if none is specified, parso will fall back to a default. Parso's code to read a file from the cache handled this correctly; but its code to write a file to the cache had a bug -- any override of the default was ignored. In the case of Jedi, this is a significant problem, since Jedi overrides the default. The result is that files will be written to the cache, but will then never be found when reading from the cache. --- parso/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parso/cache.py b/parso/cache.py index 7d490ed..1479275 100644 --- a/parso/cache.py +++ b/parso/cache.py @@ -127,7 +127,7 @@ def save_module(hashed_grammar, path, module, lines, pickling=True, cache_path=N item = _NodeCacheItem(module, lines, p_time) parser_cache.setdefault(hashed_grammar, {})[path] = item if pickling and path is not None: - _save_to_file_system(hashed_grammar, path, item) + _save_to_file_system(hashed_grammar, path, item, cache_path=cache_path) def _save_to_file_system(hashed_grammar, path, item, cache_path=None):