rlisagor / freshen

Clone of the Cucumber BDD framework for Python
GNU General Public License v3.0
355 stars 56 forks source link

UnicodeDecodeError in formatFailure() with utf-8 feature file #37

Closed ajdavis closed 13 years ago

ajdavis commented 13 years ago

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)

ajdavis commented 13 years ago

Nevermind, the issue persists in the pip version but not in the latest git version.