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 cache error on read only system #1108

Merged
merged 3 commits into from Oct 23, 2022
Merged

Conversation

ValueRaider
Copy link
Collaborator

Silently handle errors in the timezone-cache without stopping execution.

Add set_tz_cache_location() so user can provide alternative location, in case default not accessible.

Resolves issue #1107

@ValueRaider ValueRaider merged commit 9619839 into main Oct 23, 2022
@ValueRaider
Copy link
Collaborator Author

@fredrik-corneliusson - would you mind porting these changes in base and utils into _TzCache?

@fredrik-corneliusson
Copy link
Contributor

Sure, but will probably not have time to work on it today.

Copy link

@paulmcq paulmcq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yfinance/utils.py in get_cache_dirpath:

    if _cache_dp is None:
        dp = _os.path.join(_ad.user_cache_dir(), "py-yfinance")
    else:
        dp = _os.path.join(_cache_dp, "py-yfinance")

may be more readable as:

    udc = _cache_dp or _ad.user_cache_dir()
    dp = _os.path.join(udc, "py-yfinance")
    return dp

@ValueRaider
Copy link
Collaborator Author

ValueRaider commented Oct 24, 2022

@paulmcq Thanks for reviewing. But I am planning to merge in big changes from dev branch soon, so these particular review comments will be redundant.

@ValueRaider ValueRaider deleted the hotfix/cache-on-read-only-system branch October 24, 2022 16:09
fredrik-corneliusson added a commit to fredrik-corneliusson/yfinance-tz-cache that referenced this pull request Oct 24, 2022
ValueRaider added a commit that referenced this pull request Oct 25, 2022
Fix cache error on read only system #1108
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.

None yet

3 participants