XML Report Chunk Error

Issue #359 resolved
Justin Poehnelt created an issue

Here is what I am running...

coverage run --source=gfsad setup.py test
coverage html 

Those two work just fine and results are as expected. But when I run:

coverage xml

I get the following:

Traceback (most recent call last):
  File "/Users/justin/venv/GFSAD_VENV/bin/coverage", line 9, in <module>
    load_entry_point('coverage==3.7.1', 'console_scripts', 'coverage')()
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/cmdline.py", line 721, in main
    status = CoverageScript().command_line(argv)
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/cmdline.py", line 464, in command_line
    total = self.coverage.xml_report(outfile=outfile, **report_args)
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/control.py", line 694, in xml_report
    return reporter.report(morfs, outfile=outfile)
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/xmlreport.py", line 56, in report
    self.report_files(self.xml_file, morfs)
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/report.py", line 84, in report_files
    report_fn(cu, self.coverage._analyze(cu))
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/xmlreport.py", line 117, in xml_file
    branch_stats = analysis.branch_stats()
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/results.py", line 176, in branch_stats
    exit_counts = self.parser.exit_counts()
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/misc.py", line 75, in _wrapped
    setattr(self, attr, fn(self))
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/parser.py", line 252, in exit_counts
    for l1, l2 in self.arcs():
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/misc.py", line 75, in _wrapped
    setattr(self, attr, fn(self))
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/parser.py", line 236, in arcs
    for l1, l2 in self.byte_parser._all_arcs():
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/parser.py", line 632, in _all_arcs
  File "/Users/justin/venv/GFSAD_VENV/lib/python2.7/site-packages/coverage/parser.py", line 598, in _arcs
    next_chunk = byte_chunks[ex]
KeyError: 41564

Comments (13)

  1. Ned Batchelder repo owner

    @justinwp Can you provide me a reproducible test case? Even if it's a repo with your project, or a zip file with your code in it? I've never seen that error before, and I don't understand what the XML report would be doing that the HTML report would not.

  2. Ned Batchelder repo owner

    Thanks, I can reproduce the issue with this repo. It's because of gfsad/utils/countries.py, which is an unusual file :)

  3. Derek Miller

    I am still seeing this error even in your 4.0a5 branch (which is the version that has the fix based on the commit above). Any thoughts as to why this would be?

  4. Log in to comment