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.
This commit is contained in:
Luke Schiefelbein
2014-11-19 11:26:27 +01:00
committed by Thomas Wiecki
parent 8dd74b15b2
commit 1542b41fbd
+2 -1
View File
@@ -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)