ValueRaider / yfinance-cache

Caching wrapper for yfinance module. Intelligent caching, not dumb caching of web requests.
MIT License
22 stars 9 forks source link

Exception: Not tested. Does this make sense as cache dir in Windows? #27

Closed 34j closed 1 year ago

34j commented 1 year ago
----> 6 import yfinance_cache as yf

File c:\...\venv\lib\site-packages\yfinance_cache\__init__.py:4
      1 #!/usr/bin/env python
      3 from .yfc_dat import Period, Interval
----> 4 from .yfc_ticker import Ticker
      6 # __all__ = ['Ticker', 'Period', 'Interval']

File c:\...\venv\lib\site-packages\yfinance_cache\yfc_ticker.py:3
      1 import yfinance as yf
----> 3 from . import yfc_cache_manager as yfcm
      4 from . import yfc_dat as yfcd
      5 from . import yfc_utils as yfcu

File c:\...\venv\lib\site-packages\yfinance_cache\yfc_cache_manager.py:404
    400     with open(fp, 'wb') as outData:
    401         pickle.dump(pkData, outData, 4)
--> 404 ResetCacheDirpath()

File c:\...\venv\lib\site-packages\yfinance_cache\yfc_cache_manager.py:35, in ResetCacheDirpath()
     33 def ResetCacheDirpath():
     34     global cacheDirpath
---> 35     cacheDirpath = os.path.join(yfcu.GetUserCacheDirpath(), "yfinance-cache")

File c:\...\venv\lib\site-packages\yfinance_cache\yfc_utils.py:27, in GetUserCacheDirpath()
     25 if _os == OperatingSystem.Windows:
     26     dp = os.getenv("APPDATA")
---> 27     raise Exception("Not tested. Does this make sense as cache dir in Windows? - {0}".format(dp))
     28 elif _os == OperatingSystem.Linux:
     29     dp = os.path.join(os.getenv("HOME"), ".cache")

Exception: Not tested. Does this make sense as cache dir in Windows? - C:\Users\(my username)\AppData\Roaming
ValueRaider commented 1 year ago

Thanks for reporting back. I don't have Windows so rely on community to test. I'll fix soon.

ValueRaider commented 1 year ago

Try latest release

34j commented 1 year ago

Sorry, but I don't have time to try this immediately.😇 If you think you have solved the problem, please close this issue, or wait for another Windows user to come if you want it to be tested.