Skip to content

Commit

Permalink
temp: show information about the lcov file failing. #1553
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed May 11, 2023
1 parent 1eeb84d commit 3039880
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion coverage/lcovreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ def get_lcov(self, fr: FileReporter, analysis: Analysis, outfile: IO[str]) -> No
# characters of the encoding ("==") are removed from the hash to
# allow genhtml to run on the resulting lcov file.
if source_lines:
line = source_lines[covered-1].encode("utf-8")
try:
line = source_lines[covered-1].encode("utf-8")
except:
print(f"Failure processing {fr.filename=}:")
with open(fr.filename) as f:
print("=" * 80)
print(f.read())
print("=" * 80)
raise
else:
line = b""
hashed = base64.b64encode(md5(line).digest()).decode().rstrip("=")
Expand Down

0 comments on commit 3039880

Please sign in to comment.