TradingAgents/tradingagents/dataflows
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
..
discovery fix(discovery): commit risk_metrics.py and reduce Minervini max_tickers to 50 2026-04-07 16:24:29 -07:00
__init__.py WIP 2025-09-26 16:17:50 +08:00
alpha_vantage.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_analysts.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_common.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_fundamentals.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_indicator.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_news.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_stock.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
alpha_vantage_volume.py chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
config.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
delisted_cache.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
finnhub_api.py chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
finviz_scraper.py Update 2026-02-20 08:38:15 -08:00
fmp_api.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
google.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
googlenews_utils.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
interface.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
local.py chore: linter formatting + ML scanner logging, prompt control, ranker reasoning 2026-02-09 23:04:38 -08:00
market_data_utils.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
news_semantic_scanner.py Update 2026-02-20 08:39:37 -08:00
openai.py fix(filter): replace tqdm with logger in batch news functions to fix I/O error 2026-04-06 13:46:21 -07:00
reddit_api.py fix(filter): replace tqdm with logger in batch news functions to fix I/O error 2026-04-06 13:46:21 -07:00
reddit_utils.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
semantic_discovery.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
stockstats_utils.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
technical_analyst.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
ticker_semantic_db.py Remore unused code and improve the UI 2026-02-16 14:17:43 -08:00
tradier_api.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
twitter_data.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
utils.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
y_finance.py fix(y_finance): make suppress_yfinance_warnings thread-safe 2026-04-07 16:37:03 -07:00