{"action":"created","issue":{"url":"https://api.github.com/repos/pybuilder/pybuilder/issues/121","labels_url":"https://api.github.com/repos/pybuilder/pybuilder/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/pybuilder/pybuilder/issues/121/comments","events_url":"https://api.github.com/repos/pybuilder/pybuilder/issues/121/events","html_url":"https://github.com/pybuilder/pybuilder/issues/121","id":60807467,"number":121,"title":"Make pybuilder Unicode safe","user":{"login":"schlomo","id":101384,"avatar_url":"https://avatars.githubusercontent.com/u/101384?v=3","gravatar_id":"","url":"https://api.github.com/users/schlomo","html_url":"https://github.com/schlomo","followers_url":"https://api.github.com/users/schlomo/followers","following_url":"https://api.github.com/users/schlomo/following{/other_user}","gists_url":"https://api.github.com/users/schlomo/gists{/gist_id}","starred_url":"https://api.github.com/users/schlomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schlomo/subscriptions","organizations_url":"https://api.github.com/users/schlomo/orgs","repos_url":"https://api.github.com/users/schlomo/repos","events_url":"https://api.github.com/users/schlomo/events{/privacy}","received_events_url":"https://api.github.com/users/schlomo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-12T11:53:05Z","updated_at":"2015-03-12T17:11:08Z","closed_at":null,"body":"When writing unit tests that contain Unicode strings pybuilder fails with an error:\r\n\r\n```\r\nBUILD FAILED - 'ascii' codec can't encode character u'\\xe4' in position 118: ordinal not in range(128)\r\n```\r\n\r\nRunning the same build with `-X` showed that pybuilder fails to display a message containing Unicode strings:\r\n\r\n```\r\n  File \".../venv/local/lib/python2.7/site-packages/pybuilder/plugins/python/unittest_plugin.py\", line 70, in addFailure\r\n    self.failed_test_names_and_reasons[test] = '{0}: {1}'.format(exception_type, exception).replace('\\'', '')\r\nUnicodeEncodeError: 'ascii' codec can't encode character u'\\xe4' in position 118: ordinal not in range(128)\r\n------------------------------------------------------------\r\nBUILD FAILED - 'ascii' codec can't encode character u'\\xe4' in position 118: ordinal not in range(128)\r\n```\r\n\r\nManually adding *u* in front of the string literal in unittest_plugin.py solved the problem. \r\n\r\nIn this test I used assertEquals to compare two Unicode strings and they where different so that pybuilder wanted to show print the difference and failed."},"comment":{"url":"https://api.github.com/repos/pybuilder/pybuilder/issues/comments/78531592","html_url":"https://github.com/pybuilder/pybuilder/issues/121#issuecomment-78531592","issue_url":"https://api.github.com/repos/pybuilder/pybuilder/issues/121","id":78531592,"user":{"login":"mriehl","id":1955590,"avatar_url":"https://avatars.githubusercontent.com/u/1955590?v=3","gravatar_id":"","url":"https://api.github.com/users/mriehl","html_url":"https://github.com/mriehl","followers_url":"https://api.github.com/users/mriehl/followers","following_url":"https://api.github.com/users/mriehl/following{/other_user}","gists_url":"https://api.github.com/users/mriehl/gists{/gist_id}","starred_url":"https://api.github.com/users/mriehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mriehl/subscriptions","organizations_url":"https://api.github.com/users/mriehl/orgs","repos_url":"https://api.github.com/users/mriehl/repos","events_url":"https://api.github.com/users/mriehl/events{/privacy}","received_events_url":"https://api.github.com/users/mriehl/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T17:11:08Z","updated_at":"2015-03-12T17:11:08Z","body":"Nice catch, thanks for the report."}}