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

Recover from corrupted cache file #76

Merged
merged 1 commit into from
Sep 4, 2017
Merged

Conversation

ryu2
Copy link
Contributor

@ryu2 ryu2 commented May 3, 2016

This allows baron to recover in case the cache file has invalid JSON by deleting and recreating it. Before, it would fail with an exception on initialization.

@Psycojoker
Copy link
Member

Hello,

Do you think it would be possible to add a test for this situation? The code doesn't look ready for that (actually that rply code) but maybe you would have an idea.

I'm curious about how you got this bug. Are you running (red?)baron in a highlight concurrent environment?

Thanks for your contribution,

@ibizaman
Copy link
Collaborator

@Psycojoker I could imagine simply modifying the file randomly can cause this. Makes sense to protect from external inputs as much as possible.

Would you be okay with a test mocking external functions?

@Psycojoker Psycojoker merged commit b9eff65 into PyCQA:master Sep 4, 2017
@Psycojoker
Copy link
Member

Thanks for your contribuer :)

@ryanpetrello
Copy link

@Psycojoker any chance this could make it into a PyPI release? I'm encountering this bug in the baron==0.6.6 release.

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.

4 participants