Couldn't find chunk error when running coverage html

Issue #612 invalid
Andrew Dejonge
created an issue

I'm new to the coverage library for python. But I've immediately encountered a problem and I can't find mention of it on google..

In my virtual environment (pipenv) I do:

pipenv install coverage==3.6
coverage run test <app-name>
coverage report
coverage html

All of them work nicely, I get a nice text report in my shell, but when I run coverage html it crashes...

Traceback (most recent call last):
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 571, in _arcs
    ch = byte_chunks[byte]
KeyError: 22318

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\programming\Lib\", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\programming\Lib\", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Win7\.virtualenvs\app-87mb2psT\Scripts\coverage.exe\", line 9, in <module>
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 710, in main
    status = CoverageScript().command_line(argv)
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 452, in command_line
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 615, in html_report
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 90, in report
    self.report_files(self.html_file, morfs, self.config.html_dir)
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 84, in report_files
    report_fn(cu, self.coverage._analyze(cu))
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 164, in html_file
    missing_branch_arcs = analysis.missing_branch_arcs()
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 127, in missing_branch_arcs
    missing = self.arcs_missing()
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 88, in arcs_missing
    possible = self.arc_possibilities()
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 76, in arc_possibilities
    arcs = self.parser.arcs()
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 73, in _wrapped
    setattr(self, attr, fn(self))
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 230, in arcs
    for l1, l2 in self.byte_parser._all_arcs():
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 631, in _all_arcs
  File "c:\users\win7\.virtualenvs\app-87mb2pst\lib\site-packages\coverage\", line 578, in _arcs

    raise Exception("Couldn't find chunk @ %d" % byte)
Exception: Couldn't find chunk @ 22318

Comments (2)

  1. Log in to comment