From ecc74e2ae5c641b7588dc6777cc033af83656c59 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Mon, 9 Sep 2019 15:29:54 -0400 Subject: [PATCH] if user has no Downloads dir on windows, use cwd --- lbry/lbry/conf.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lbry/lbry/conf.py b/lbry/lbry/conf.py index c9fda939f..1339be73e 100644 --- a/lbry/lbry/conf.py +++ b/lbry/lbry/conf.py @@ -630,9 +630,13 @@ class Config(CLIConfig): def get_windows_directories() -> typing.Tuple[str, str, str]: - from lbry.winpaths import get_path, FOLDERID, UserHandle # pylint: disable=import-outside-toplevel + from lbry.winpaths import get_path, FOLDERID, UserHandle, \ + PathNotFoundException # pylint: disable=import-outside-toplevel - download_dir = get_path(FOLDERID.Downloads, UserHandle.current) + try: + download_dir = get_path(FOLDERID.Downloads, UserHandle.current) + except PathNotFoundException: + download_dir = os.getcwd() # old appdata = get_path(FOLDERID.RoamingAppData, UserHandle.current) @@ -644,7 +648,6 @@ def get_windows_directories() -> typing.Tuple[str, str, str]: # new data_dir = user_data_dir('lbrynet', 'lbry') lbryum_dir = user_data_dir('lbryum', 'lbry') - download_dir = get_path(FOLDERID.Downloads, UserHandle.current) return data_dir, lbryum_dir, download_dir