Unable to get history of ASIANPAINT.NS on May 4, 2022
Describe bug
My previously working script has started to throw the following error:
ERROR:yfinance:Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart' ERROR:yfinance:$ASIANPAINT.NS: possibly delisted; no timezone found
Simple code that reproduces your problem
import yfinance as yf
import datetime as datetime0
from datetime import datetime
yf.enable_debug_mode()
yf.__version__
stock=yf.Ticker('ASIANPAINT.NS')
date=datetime.strptime('4-May-22','%d-%b-%y').date()
details=stock.history(start=date,end=date+datetime0.timedelta(days=1))
### Debug log
> DEBUG Entering history()
DEBUG:yfinance:Entering history()
DEBUG Entering _fetch_ticker_tz()
DEBUG:yfinance: Entering _fetch_ticker_tz()
ERROR Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'
ERROR:yfinance: Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'
DEBUG Got response:
DEBUG:yfinance: Got response:
DEBUG -------------
DEBUG:yfinance: -------------
DEBUG {'finance': {'result': None, 'error': {'code': 'Internal Server Error', 'description': 'Duplicate key 1497411900'}}}
DEBUG:yfinance: {'finance': {'result': None, 'error': {'code': 'Internal Server Error', 'description': 'Duplicate key 1497411900'}}}
DEBUG -------------
DEBUG:yfinance: -------------
DEBUG Exiting _fetch_ticker_tz()
DEBUG:yfinance: Exiting _fetch_ticker_tz()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
ERROR $ASIANPAINT.NS: possibly delisted; no timezone found
ERROR:yfinance: $ASIANPAINT.NS: possibly delisted; no timezone found
DEBUG Exiting history()
DEBUG:yfinance: Exiting history()
DEBUG Exiting history()
DEBUG:yfinance:Exiting history()
### Bad data proof

### `yfinance` version
0.2.43
### Python version
3.10.12
### Operating system
Ubuntu v22.04
Your bad data proof must be from yahoo.com
Your
bad data proofmust be from yahoo.com Oops, here you go..
Looking closer, May 4 is irrelevant.
DEBUG:yfinance: Entering _fetch_ticker_tz()
ERROR Could not get exchangeTimezoneName for ticker 'ASIANPAINT.NS' reason: 'chart'
_fetch_ticker_tz is failing but only for you. Can you experiment with its code? Maybe the date range is too short. It's in base.py
Today I get the same error, till yesterday it worked for same Symbol, Error, Python, Yfinance version is same.
https://github.com/ranaroussi/yfinance/issues/2052