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

htmlcov with corrupt status.dat #237

Closed
nedbat opened this issue Feb 22, 2013 · 1 comment
Closed

htmlcov with corrupt status.dat #237

nedbat opened this issue Feb 22, 2013 · 1 comment
Labels
bug Something isn't working html

Comments

@nedbat
Copy link
Owner

nedbat commented Feb 22, 2013

Originally reported by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren)


coverage.html.HtmlStatus.read tries to detect if the htmlcov/status.dat file is usable by catching IOError. That works when the file doesn't exist, but won't catch all cases of an unusable file.

In particular, I managed to end up with a status.dat file that exists but contains data that confuses pickle (but haven't managed to reproduce that problem). In my case pickle.load raised MemoryError (although I've seen lots of other exceptions when loading a corrupt file with pickle.load). And that crashed the html generation step.

It would be easy enough to avoid the crash by changing "exept IOError:" to "except:", but I'm not sure if it is worthwhile to do that.

It would be nice if 'coverage html' would print that it had a problem reading status.dat.

BTW. The workaround: just clobber the htmlcov directory and try again.


@nedbat
Copy link
Owner Author

nedbat commented Apr 25, 2015

HTML reports now use JSON instead of pickle, so this is much less likely to be an issue.

@nedbat nedbat closed this as completed Apr 25, 2015
@nedbat nedbat added minor bug Something isn't working html labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working html
Projects
None yet
Development

No branches or pull requests

1 participant