This fixes two issues with the caching on Windows / APPDATA #1575
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem is that Jedi starts to fill the organizational storage space in %APPDATA% on Windows. In my case (with just minimal use) I have a 400MB Jedi folder that gets synced across our organizational network each time I log in (I am using Visual Studio Code which in turn uses Jedi).
Fixes
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.
Reasoning and a historical side note:
This issue was already reported once here: #926
It got then partially fixed, but only for parso in a different place (thinking of which, the second issure should probably also get ported there as well): davidhalter/parso#1
Someone also temporarily fixed it in pythonVSCode (now maintained as microsoft/vscode-python): DonJayamanne/pythonVSCode#1035
But it got lost in microsoft/vscode-python@20a7bd5 when Jedi was introduced as an external dependency much rather than pulling it in as external code.