{"action":"created","issue":{"url":"https://api.github.com/repos/bartdag/pylinkvalidator/issues/3","labels_url":"https://api.github.com/repos/bartdag/pylinkvalidator/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/bartdag/pylinkvalidator/issues/3/comments","events_url":"https://api.github.com/repos/bartdag/pylinkvalidator/issues/3/events","html_url":"https://github.com/bartdag/pylinkvalidator/issues/3","id":100310780,"number":3,"title":"UnicodeEncodeError","user":{"login":"jimpriest","id":197930,"avatar_url":"https://avatars.githubusercontent.com/u/197930?v=3","gravatar_id":"","url":"https://api.github.com/users/jimpriest","html_url":"https://github.com/jimpriest","followers_url":"https://api.github.com/users/jimpriest/followers","following_url":"https://api.github.com/users/jimpriest/following{/other_user}","gists_url":"https://api.github.com/users/jimpriest/gists{/gist_id}","starred_url":"https://api.github.com/users/jimpriest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimpriest/subscriptions","organizations_url":"https://api.github.com/users/jimpriest/orgs","repos_url":"https://api.github.com/users/jimpriest/repos","events_url":"https://api.github.com/users/jimpriest/events{/privacy}","received_events_url":"https://api.github.com/users/jimpriest/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-11T13:26:24Z","updated_at":"2015-08-12T13:25:59Z","closed_at":null,"body":"Making progress on CSV export but while testing plain text output I ran into this issue while scanning our site:\r\n\r\n    error (<type 'exceptions.UnicodeEncodeError'>): 'ascii' codec can't encode \r\n    character u'\\u2019' in position 58: ordinal not in range(128): \r\n    http://my.private.url/about/press-releases/joe-smith-named-sunshine’s-officer\r\n\r\nI can do: 'print u'\\u2019' - and it correctly prints the single quote in my terminal?  \r\n\r\nDigging through the code I found in crawler.py where it appears to be handling the exception  but I'm not sure how to fix (new to Python)\r\n\r\n    # Something bad happened when opening the url\r\n    exception = ExceptionStr(\r\n    unicode(type(response.exception)),\r\n    unicode(response.exception))"},"comment":{"url":"https://api.github.com/repos/bartdag/pylinkvalidator/issues/comments/130300665","html_url":"https://github.com/bartdag/pylinkvalidator/issues/3#issuecomment-130300665","issue_url":"https://api.github.com/repos/bartdag/pylinkvalidator/issues/3","id":130300665,"user":{"login":"bartdag","id":464322,"avatar_url":"https://avatars.githubusercontent.com/u/464322?v=3","gravatar_id":"","url":"https://api.github.com/users/bartdag","html_url":"https://github.com/bartdag","followers_url":"https://api.github.com/users/bartdag/followers","following_url":"https://api.github.com/users/bartdag/following{/other_user}","gists_url":"https://api.github.com/users/bartdag/gists{/gist_id}","starred_url":"https://api.github.com/users/bartdag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartdag/subscriptions","organizations_url":"https://api.github.com/users/bartdag/orgs","repos_url":"https://api.github.com/users/bartdag/repos","events_url":"https://api.github.com/users/bartdag/events{/privacy}","received_events_url":"https://api.github.com/users/bartdag/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T13:25:59Z","updated_at":"2015-08-12T13:25:59Z","body":"So I could finally reproduce the error. I created a branch, nonasciiiris, which contains a fix. I'll have to write a test and clean the code a little, but this works for me on Python 2.7 and 3.4. If you have a chance to test it, I would be interested in knowing if it worked for you.\r\n\r\nIf you look at the commit, you'll see a lot of encode/decode to make sure that we treat one byte at a time and support both Python 2 and Python 3.."}}