Skip to content

Commit d34623b

Browse files
authored
Fix re-downloading of LanguageTool on Windows because of non-standardized folder path
1 parent cd8ec98 commit d34623b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎language_tool_python/utils.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ def correct(text: str, matches: [Match]) -> str:
6868

6969
def get_language_tool_download_path():
7070
# Get download path from environment or use default.
71-
download_path = os.environ.get('LTP_PATH', '~/.cache/language_tool_python/')
72-
download_path = os.path.expanduser(download_path)
71+
download_path = os.environ.get(
72+
'LTP_PATH',
73+
os.path.join(os.path.expanduser("~"), ".cache", "language_tool_python")
74+
)
7375
# Make download path, if it doesn't exist.
7476
os.makedirs(download_path, exist_ok=True)
7577
return download_path

0 commit comments

Comments
 (0)