TradingAgents/tradingagents
Youssef Aitousarrah c09cc7ec25 fix(y_finance): make suppress_yfinance_warnings thread-safe
The previous implementation redirected sys.stderr to /dev/null using a
context manager. This is not thread-safe: 8 concurrent scanner threads each
mutate sys.stderr, and when one thread's context manager closes the devnull
file, another thread that captured devnull as its saved stderr attempts to
write to the closed fd and raises "I/O operation on closed file".

This corrupted sys.stderr state caused _fetch_batch_prices to fail and
all per-ticker get_stock_price fallback calls to return None, resulting in
every candidate being dropped with "no data available".

Fix by suppressing at the Python logging level instead of redirecting
sys.stderr. Logger.setLevel() is protected by internal locks and is safe
to call from concurrent threads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 16:37:03 -07:00
..
agents Update 2026-02-20 08:38:15 -08:00
dataflows fix(y_finance): make suppress_yfinance_warnings thread-safe 2026-04-07 16:37:03 -07:00
graph fix(discovery): fix three scanner hang/validation bugs found in ranker_debug.log 2026-02-20 22:35:42 -08:00
ml chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
schemas feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
tools feat(scanners): add minervini scanner to registry 2026-04-06 13:51:42 -07:00
ui fix(ui): fix signal cards rendering as raw HTML in Streamlit 2026-02-20 11:33:15 -08:00
utils feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
__init__.py feat: discovery system code quality improvements and concurrent execution 2026-02-05 23:27:01 -08:00
config.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
default_config.py fix(discovery): commit risk_metrics.py and reduce Minervini max_tickers to 50 2026-04-07 16:24:29 -07:00