Skip to content

htmlcov with corrupt status.dat #237

Closed
@nedbat

Description

@nedbat

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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghtml

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions