{"action":"created","issue":{"url":"https://api.github.com/repos/webpy/webpy/issues/371","repository_url":"https://api.github.com/repos/webpy/webpy","labels_url":"https://api.github.com/repos/webpy/webpy/issues/371/labels{/name}","comments_url":"https://api.github.com/repos/webpy/webpy/issues/371/comments","events_url":"https://api.github.com/repos/webpy/webpy/issues/371/events","html_url":"https://github.com/webpy/webpy/issues/371","id":162200816,"number":371,"title":"webapp crashes when unicode text is returned as response","user":{"login":"anandology","id":7569,"avatar_url":"https://avatars.githubusercontent.com/u/7569?v=3","gravatar_id":"","url":"https://api.github.com/users/anandology","html_url":"https://github.com/anandology","followers_url":"https://api.github.com/users/anandology/followers","following_url":"https://api.github.com/users/anandology/following{/other_user}","gists_url":"https://api.github.com/users/anandology/gists{/gist_id}","starred_url":"https://api.github.com/users/anandology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandology/subscriptions","organizations_url":"https://api.github.com/users/anandology/orgs","repos_url":"https://api.github.com/users/anandology/repos","events_url":"https://api.github.com/users/anandology/events{/privacy}","received_events_url":"https://api.github.com/users/anandology/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpy/webpy/labels/python3","name":"python3","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-24T18:09:25Z","updated_at":"2016-06-24T18:12:26Z","closed_at":null,"body":"Code to reproduce the bug is available at\r\n\r\nhttps://gist.github.com/anandology/72168ffbf33e87ebcfb419d12fd5e7cd\r\n\r\nIt crashes with the following error.\r\n\r\n\tUnicodeEncodeError('latin-1', '\\u0c05\\u0c06', 0, 2, 'ordinal not in range(256)')\r\n\tTraceback (most recent call last):\r\n\t  File \"/Users/anand/github/webpy/webpy/web/wsgiserver/wsgiserver3.py\", line 1089, in communicate\r\n\t    req.respond()\r\n\t  File \"/Users/anand/github/webpy/webpy/web/wsgiserver/wsgiserver3.py\", line 877, in respond\r\n\t    self.server.gateway(self).respond()\r\n\t  File \"/Users/anand/github/webpy/webpy/web/wsgiserver/wsgiserver3.py\", line 1991, in respond\r\n\t    chunk = chunk.encode('ISO-8859-1')\r\n\tUnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)\r\n\r\ncc: @Zashas"},"comment":{"url":"https://api.github.com/repos/webpy/webpy/issues/comments/228419455","html_url":"https://github.com/webpy/webpy/issues/371#issuecomment-228419455","issue_url":"https://api.github.com/repos/webpy/webpy/issues/371","id":228419455,"user":{"login":"anandology","id":7569,"avatar_url":"https://avatars.githubusercontent.com/u/7569?v=3","gravatar_id":"","url":"https://api.github.com/users/anandology","html_url":"https://github.com/anandology","followers_url":"https://api.github.com/users/anandology/followers","following_url":"https://api.github.com/users/anandology/following{/other_user}","gists_url":"https://api.github.com/users/anandology/gists{/gist_id}","starred_url":"https://api.github.com/users/anandology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandology/subscriptions","organizations_url":"https://api.github.com/users/anandology/orgs","repos_url":"https://api.github.com/users/anandology/repos","events_url":"https://api.github.com/users/anandology/events{/privacy}","received_events_url":"https://api.github.com/users/anandology/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T18:12:26Z","updated_at":"2016-06-24T18:12:26Z","body":"I think it is caused because `str` is returned from the wsgiapp. I think it should send only `bytes`. The conversion from `str` to `bytes` should happen in `web.py`, not in `wsgiserver`."}}
{"actor":{"display_login":"anandology"}}