Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: OperationalError('unable to open database file') #1698

Merged
merged 4 commits into from
Sep 24, 2023

Conversation

ValueRaider
Copy link
Collaborator

Fix #1694
Also refactored timezone caching, and improve testing to detect cache folder issues.

@ValueRaider ValueRaider changed the title Fix download(): OperationalError('unable to open database file') Fix: OperationalError('unable to open database file') Sep 23, 2023
@ValueRaider ValueRaider merged commit 412cfbc into main Sep 24, 2023
@ValueRaider ValueRaider deleted the hotfix/download-database-error branch September 24, 2023 21:15
@ValueRaider ValueRaider mentioned this pull request Sep 27, 2023
@CharlesFr
Copy link

CharlesFr commented Oct 4, 2023

We're getting this seemingly related error on 0.2.30, any ideas?

File "/usr/local/lib/python3.10/site-packages/quantstats/__init__.py", line 26, in <module>
    from . import stats, utils, plots, reports
  File "/usr/local/lib/python3.10/site-packages/quantstats/stats.py", line 27, in <module>
    from . import utils as _utils
  File "/usr/local/lib/python3.10/site-packages/quantstats/utils.py", line 24, in <module>
    import yfinance as _yf
  File "/usr/local/lib/python3.10/site-packages/yfinance/__init__.py", line 23, in <module>
    from .ticker import Ticker
  File "/usr/local/lib/python3.10/site-packages/yfinance/ticker.py", line 29, in <module>
    from .base import TickerBase
  File "/usr/local/lib/python3.10/site-packages/yfinance/base.py", line 38, in <module>
    from . import utils
  File "/usr/local/lib/python3.10/site-packages/yfinance/utils.py", line 991, in <module>
    class _KV(_peewee.Model):
  File "/usr/local/lib/python3.10/site-packages/yfinance/utils.py", line 995, in _KV
    class Meta:
  File "/usr/local/lib/python3.10/site-packages/yfinance/utils.py", line 996, in Meta
    database = _DBManager.get_database()
  File "/usr/local/lib/python3.10/site-packages/yfinance/utils.py", line 953, in get_database
    cls._initialise()
  File "/usr/local/lib/python3.10/site-packages/yfinance/utils.py", line 972, in _initialise
    _os.mkdir(cls._cache_dir)
FileNotFoundError: [Errno 2] No such file or directory: '/home/django/.cache/py-yfinance'"

@ValueRaider
Copy link
Collaborator Author

@CharlesFr #1700 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.2.29 bug: OperationalError('unable to open database file')
2 participants