From a1ba57186b22f1a74f9e0fb44fd4e67fc9b695b3 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Thu, 15 Feb 2018 08:56:13 +0200 Subject: [PATCH] correctly join paths and debug log the found results --- freqtrade/optimize/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/freqtrade/optimize/__init__.py b/freqtrade/optimize/__init__.py index 52ea55853..931c720ee 100644 --- a/freqtrade/optimize/__init__.py +++ b/freqtrade/optimize/__init__.py @@ -33,19 +33,20 @@ def load_tickerdata_file(datadir, pair, ticker_interval, timerange=None): :return dict OR empty if unsuccesful """ path = make_testdata_path(datadir) - file = '{abspath}/{pair}-{ticker_interval}.json'.format( - abspath=path, + file = os.path.join(path, '{pair}-{ticker_interval}.json'.format( pair=pair, ticker_interval=ticker_interval, - ) + )) gzipfile = file + '.gz' # If the file does not exist we download it when None is returned. # If file exists, read the file, load the json if os.path.isfile(gzipfile): + logger.debug('Loading ticker data from file %s', gzipfile) with gzip.open(gzipfile) as tickerdata: pairdata = json.load(tickerdata) elif os.path.isfile(file): + logger.debug('Loading ticker data from file %s', file) with open(file) as tickerdata: pairdata = json.load(tickerdata) else: