From 77ece96356858953cfa9541638e1683e8bd19c49 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 24 Jan 2019 12:42:55 -0500 Subject: [PATCH] fix config error if $HOME is None -not seen on travis due to HOME being manually set to /tmp --- lbrynet/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 5cb23b17e..a0bef0e97 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -507,11 +507,10 @@ def get_linux_directories() -> typing.Tuple[str, str, str]: try: with open(os.path.join(user_config_dir(), 'user-dirs.dirs'), 'r') as xdg: down_dir = re.search(r'XDG_DOWNLOAD_DIR=(.+)', xdg.read()).group(1) - down_dir = re.sub('\$HOME', os.getenv('HOME'), down_dir) - download_dir = re.sub('\"', '', down_dir) + down_dir = re.sub('\$HOME', os.getenv('HOME') or os.path.expanduser("~/"), down_dir) + download_dir = re.sub('\"', '', down_dir) except EnvironmentError: download_dir = os.getenv('XDG_DOWNLOAD_DIR') - if not download_dir: download_dir = os.path.expanduser('~/Downloads')