From 1542b41fbd57820bd22f5b2b9ac38190e0e07719 Mon Sep 17 00:00:00 2001 From: Luke Schiefelbein Date: Mon, 3 Nov 2014 16:43:34 -0500 Subject: [PATCH] BUG: Fix price caching for tickers with '/' char On Ubuntu (assume this is true for all posix) tickers containing a slash char ("CRD/A", "BRK/A", both valid tickers with yahoo api accessible timeseries) lead to a path error in loader.py line 286. --- zipline/data/loader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zipline/data/loader.py b/zipline/data/loader.py index 19a16290..2bebb47f 100644 --- a/zipline/data/loader.py +++ b/zipline/data/loader.py @@ -272,8 +272,9 @@ must specify stocks or indexes""" if stocks is not None: for stock in stocks: print(stock) + stock_pathsafe = stock.replace(os.path.sep, '--') cache_filename = "{stock}-{start}-{end}.csv".format( - stock=stock, + stock=stock_pathsafe, start=start, end=end).replace(':', '-') cache_filepath = get_cache_filepath(cache_filename)