Skip to content

Commit ae3195f

Browse files
committed
finance.fetch_historical_yahoo: Create directories leading up to cachename.
Previously, if cachename was specified, it would create the directories to cachedir instead, resulting in OSError if the directories leading up to cachename were not specified.
1 parent 2b2fa46 commit ae3195f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/finance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def fetch_historical_yahoo(ticker, date1, date2, cachename=None,dividends=False)
184184
fh = open(cachename)
185185
verbose.report('Using cachefile %s for %s'%(cachename, ticker))
186186
else:
187-
mkdirs(cachedir)
187+
mkdirs(os.path.abspath(os.path.dirname(cachename)))
188188
urlfh = urlopen(url)
189189

190190
fh = open(cachename, 'wb')

0 commit comments

Comments
 (0)