1. Ned Batchelder
  2. coverage.py
  3. Issues
Issue #159 duplicate

UnicodeDecodeError: 'utf8' codec can't decode byte 0xef in position 20894: invalid continuation byte

Zooko O'Whielacronx
created an issue

{{{ PASSED (successes=188) HACK zompu:~/playground/tahoe-lafs/trunk$ coverage html Traceback (most recent call last): File "/usr/local/bin/coverage", line 9, in <module> load_entry_point('coverage==3.5.1', 'console_scripts', 'coverage')() File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/cmdline.py", line 657, in main status = CoverageScript().command_line(argv) File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/cmdline.py", line 549, in command_line directory=options.directory, **report_args) File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/control.py", line 599, in html_report reporter.report(morfs, config=self.config) File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/html.py", line 83, in report self.report_files(self.html_file, morfs, config, config.html_dir) File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/report.py", line 86, in report_files report_fn(cu, self.coverage._analyze(cu)) File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/html.py", line 198, in html_file self.write_html(html_path, html) File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/html.py", line 103, in write_html write_encoded(fname, html, 'ascii', 'xmlcharrefreplace') File "/usr/local/lib/python2.7/dist-packages/coverage-3.5.1-py2.7-linux-x86_64.egg/coverage/backward.py", line 137, in write_encoded f.write(text.decode('utf8')) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xef in position 20894: invalid continuation byte }}}

Comments (3)

  1. Anonymous

    I get this same error, and yes, I have a couple of tests dealing with latin-1 characters in them. Is a fix for this planned? It's currently blocking our use of html reports with coverage.

  2. Log in to comment