Created
January 24, 2013 08:45
-
-
Save svetlyak40wt/4618817 to your computer and use it in GitHub Desktop.
An example, how to reproduce UnicodeEncodeError in nose-progressive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| # How to reproduce: | |
| # * Get a python2.6 (you can use pythonbrew, for example). | |
| # * virtualenv --python=python2.6 env | |
| # * env/bin/pip install -e 'git+git://github.com/erikrose/nose-progressive.git#egg=nose-progressive' | |
| # * env/bin/nosetests --with-progressive tests.py | |
| def bad_function(): | |
| print u"Из России с любовью" / 0 | |
| def test_unicode_traceback(): | |
| assert bad_function() | |
| # this works in python2.7, but fails in 2.6 with following errors: | |
| # [art@localhost]% env2.6.5/bin/nosetests --with-progressive tests.py | |
| # | |
| # ERROR: tests:test_unicode_traceback | |
| # | |
| # ERROR: tests:test_unicode_traceback | |
| # vim +133 env2.6.5/lib/python2.6/site-packages/nose/case.py # run | |
| # self.runTest(result) | |
| # vim +151 env2.6.5/lib/python2.6/site-packages/nose/case.py # runTest | |
| # test(result) | |
| # vim +300 /home/art/.pythonbrew/pythons/Python-2.6.5/lib/python2.6/unittest.py # __call__ | |
| # return self.run(*args, **kwds) | |
| # vim +286 /home/art/.pythonbrew/pythons/Python-2.6.5/lib/python2.6/unittest.py # run | |
| # result.addError(self, self._exc_info()) | |
| # vim +135 env2.6.5/lib/python2.6/site-packages/nose/proxy.py # addError | |
| # self.result.addError(self.test, self._prepareErr(err)) | |
| # vim +161 env2.6.5/src/nose-progressive/noseprogressive/result.py # addError | |
| # self._printTraceback(test, err) | |
| # vim +90 env2.6.5/src/nose-progressive/noseprogressive/result.py # _printTraceback | |
| # self._options.editor))) | |
| # UnicodeEncodeError: 'ascii' codec can't encode characters in position 160-161: ordinal not in range(128) # | |
| # 1 test, 0 failures, 2 errors in 0.0s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment