rlisagor/freshen — Issue #37: UnicodeDecodeError in formatFailure() with utf-8 feature file
Author: ajdavis
Created: 2011-11-29 23:47:16+00:00
State: open

Consider a utf-8 feature file containing:

Feature: test-feature
Scenario: test-scenario
When I say "имя"
Then no error

If the step 'I say "имя"' throws an exception (external to Freshen), then Freshen throws this error:

Traceback (most recent call last):
File "/Users/emptysquare/.virtualenvs/pymongo/lib/python2.7/site-packages/nose/case.py", line 133, in run
self.runTest(result)
File "/Users/emptysquare/.virtualenvs/pymongo/lib/python2.7/site-packages/nose/case.py", line 151, in runTest
test(result)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 376, in __call__
return self.run(*args, **kwds)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 340, in run
result.addError(self, sys.exc_info())
File "/Users/emptysquare/.virtualenvs/pymongo/lib/python2.7/site-packages/nose/proxy.py", line 131, in addError
formatted = plugins.formatError(self.test, err)
File "/Users/emptysquare/.virtualenvs/pymongo/lib/python2.7/site-packages/nose/plugins/manager.py", line 94, in __call__
return self.call(*arg, **kw)
File "/Users/emptysquare/.virtualenvs/pymongo/lib/python2.7/site-packages/nose/plugins/manager.py", line 136, in chain
result = meth(*arg, **kw)
File "/Users/emptysquare/.virtualenvs/pymongo/lib/python2.7/site-packages/freshen/noseplugin.py", line 201, in formatFailure
return (orig_ec, unicode(orig_ev) + '\n\n>> in "%s" # %s' % (unicode(ev.step.match), unicode(ev.step.source_location())), orig_tb)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1: ordinal not in range(128)