diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index a957e6e2a..cb383d8b6 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -176,6 +176,7 @@ class Configuration(object): elif 'user_data_dir' not in config: # Default to cwd/user_data (legacy option ...) config.update({'user_data_dir': str(Path.cwd() / "user_data")}) + # reset to user_data_dir so this contains the absolute path. config['user_data_dir'] = create_userdata_dir(config['user_data_dir']) logger.info('Using user-data directory: %s ...', config['user_data_dir']) diff --git a/freqtrade/configuration/folder_operations.py b/freqtrade/configuration/folder_operations.py index 2ea9cd268..fc516a8cc 100644 --- a/freqtrade/configuration/folder_operations.py +++ b/freqtrade/configuration/folder_operations.py @@ -20,8 +20,8 @@ def create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> str return str(folder) -def create_userdata_dir(directory: str) -> str: - sub_dirs = ["backtest_results", "data", "hyperopts", "plots", "strategies", ] +def create_userdata_dir(directory: str) -> Path: + sub_dirs = ["backtest_results", "data", "hyperopts", "plot", "strategies", ] folder = Path(directory) if not folder.is_dir(): folder.mkdir(parents=True) @@ -32,5 +32,4 @@ def create_userdata_dir(directory: str) -> str: subfolder = folder / f if not subfolder.is_dir(): subfolder.mkdir(parents=False) - # TODO: convert this to return Path return folder