Skip to content

Commit

Permalink
Merge pull request #1162 from ranaroussi/patch/tz-csv-error
Browse files Browse the repository at this point in the history
Fix corrupt tkr-tz-csv halting code
  • Loading branch information
ValueRaider committed Nov 10, 2022
2 parents ddc3434 + 1687ae6 commit 2d32a6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yfinance/utils.py
Expand Up @@ -336,7 +336,7 @@ def cache_lookup_tkr_tz(tkr):
return None

mutex.acquire()
df = _pd.read_csv(fp, index_col="Ticker")
df = _pd.read_csv(fp, index_col="Ticker", on_bad_lines="skip")
mutex.release()
if tkr in df.index:
return df.loc[tkr,"Tz"]
Expand All @@ -355,7 +355,7 @@ def cache_store_tkr_tz(tkr,tz):
df.to_csv(fp)

else:
df = _pd.read_csv(fp, index_col="Ticker")
df = _pd.read_csv(fp, index_col="Ticker", on_bad_lines="skip")
if tz is None:
# Delete if in cache:
if tkr in df.index:
Expand Down

0 comments on commit 2d32a6e

Please sign in to comment.