Repository navigation
Remove dead network.hide_exceptions toggle from download() - #3025
Open
louis75aubin-prog wants to merge 1 commit into
Open
louis75aubin-prog wants to merge 1 commit into
louis75aubin-prog wants to merge 1 commit into
Conversation
Collaborator
|
This stinks of bad AI. |
_download_one saved, set and restored YfConfig.network.hide_exceptions, but nothing reads that option: every reader uses debug.hide_exceptions. It came from the YfConfig redesign replacing history(raise_errors=True). Its only effect was a stray "hide_exceptions": null left in yf.config.network after every download(). Removing it changes no download behaviour.
louis75aubin-prog
force-pushed
the
fix/download-dead-hide-exceptions
branch
from
November 3, 2026 16:49
f6bb0ac to
1357687
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3019, where I raised this as a question.
Problem
multi._download_onesavesYfConfig.network.hide_exceptions, sets it toFalse, then restores it. Nothing in yfinance readsnetwork.hide_exceptions: every reader usesYfConfig.debug.hide_exceptions. The toggle came in with 4f38ecf ("Redesign YfConfig"), which replacedhistory(..., raise_errors=True)with it.So it has no effect on
download(). Its only visible effect is a stray key left in the global config after any download:Change
Remove the three lines and the now-unused
YfConfigimport frommulti.py.download()behaviour is unchanged: errors are still collected through_last_error/ theexceptblock and logged by_log_errors()exactly as before.I didn't switch it to
debug.hide_exceptions, which was probably the original intent. That would changedownload()'s behaviour:history()would raise again, and the "Failed downloads" messages would change. It would also mean flipping a process-wide flag from worker threads, which other threads and other concurrent yfinance calls would see.Tests
tests/test_multi.py::test_download_leaves_config_unchanged(no network):repr(yf.config)is the same before and after a threadeddownload(). It fails ondevand passes with this change.python -m unittest tests.test_multi tests.test_download_concurrency: 13 tests OK.ruff check yfinance/ tests/test_multi.py: clean.