`coverage xml` raises KeyError

Issue #368 duplicate
Steve Peak created an issue

(Founder of Codecov here) I had a customer report an issue and I tracked it down to an error being raised during coverage xml. I'm hoping to get this resolved soon, the customer thought it was Codecov's issue which looks bad for biz. Thank you so much.

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

Comments (6)

  1. Steve Peak reporter

    Have you had a change to checkout Codecov yet? I started this company with only Python support with your package 8 months ago. I would like to chat more on email if you have time.

    Thanks Ned

  2. Log in to comment