UnicodeDecodeError using pylons app

Issue #169 duplicate
Former user created an issue

Hello, I am using pylons framework for my web-app and nosetests to test it. I added coverage plug-in but it seems that there is something wrong, maybe, I am doing something wrong

here is how I launch the stuff with complete trace-back and my environment plus how to reproduce

Command {{{ #!bash

toto-computer:~/test_cov$ nosetests --with-pylons=test.ini --with-coverage --cover-html-dir=./coverage --cover-html --cover-package=./test_cov -w ./test_cov/tests/ }}}

but when the code coverage has finished to check all the module it throw an exception.

Trace-back: {{{ #!python

Traceback (most recent call last): File "/usr/local/bin/nosetests", line 9, in <module> load_entry_point('nose==1.1.2', 'console_scripts', 'nosetests')() File "/usr/local/lib/python2.6/dist-packages/nose/core.py", line 118, in init extra_args) File "/usr/lib/python2.6/unittest.py", line 817, in __init__ self.runTests() File "/usr/local/lib/python2.6/dist-packages/nose/core.py", line 197, in runTests result = self.testRunner.run(self.test) File "/usr/local/lib/python2.6/dist-packages/nose/core.py", line 63, in run result.printErrors() File "/usr/local/lib/python2.6/dist-packages/nose/result.py", line 110, in printErrors self.config.plugins.report(self.stream) File "/usr/local/lib/python2.6/dist-packages/nose/plugins/manager.py", line 94, in __call__ return self.call(*arg, kw) File "/usr/local/lib/python2.6/dist-packages/nose/plugins/manager.py", line 162, in simple result = meth(arg, *kw) File "/usr/local/lib/python2.6/dist-packages/nosexcover/nosexcover.py", line 45, in report super(XCoverage, self).report(stream) File "/usr/local/lib/python2.6/dist-packages/nose/plugins/cover.py", line 176, in report self.coverInstance.html_report(modules, self.coverHtmlDir) File "/usr/local/lib/python2.6/dist-packages/coverage/control.py", line 599, in html_report reporter.report(morfs, config=self.config) File "/usr/local/lib/python2.6/dist-packages/coverage/html.py", line 83, in report self.report_files(self.html_file, morfs, config, config.html_dir) File "/usr/local/lib/python2.6/dist-packages/coverage/report.py", line 86, in report_files report_fn(cu, self.coverage._analyze(cu)) File "/usr/local/lib/python2.6/dist-packages/coverage/html.py", line 198, in html_file self.write_html(html_path, html) File "/usr/local/lib/python2.6/dist-packages/coverage/html.py", line 103, in write_html write_encoded(fname, html, 'ascii', 'xmlcharrefreplace') File "/usr/local/lib/python2.6/dist-packages/coverage/backward.py", line 137, in write_encoded f.write(text.decode('utf8')) File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 3813-3815: invalid data }}}


OS: ubuntu 10.04


NOSE: v1.1.2

COVERAGE: v3.5.1


how to reproduce:

1- install pylons

2- install coverage

3- install nose

4- create a pylons project

5- launch nosetests with all arguments above

Also, something strange, even by specifying module to cover it check /usr/local/lib/.. is it normal?

Comments (1)

  1. Log in to comment