{"action":"created","issue":{"url":"https://api.github.com/repos/abjer/tsds/issues/4","repository_url":"https://api.github.com/repos/abjer/tsds","labels_url":"https://api.github.com/repos/abjer/tsds/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/abjer/tsds/issues/4/comments","events_url":"https://api.github.com/repos/abjer/tsds/issues/4/events","html_url":"https://github.com/abjer/tsds/issues/4","id":303081815,"number":4,"title":"Loading Marvel Data","user":{"login":"Krier","id":10084961,"avatar_url":"https://avatars3.githubusercontent.com/u/10084961?v=4","gravatar_id":"","url":"https://api.github.com/users/Krier","html_url":"https://github.com/Krier","followers_url":"https://api.github.com/users/Krier/followers","following_url":"https://api.github.com/users/Krier/following{/other_user}","gists_url":"https://api.github.com/users/Krier/gists{/gist_id}","starred_url":"https://api.github.com/users/Krier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krier/subscriptions","organizations_url":"https://api.github.com/users/Krier/orgs","repos_url":"https://api.github.com/users/Krier/repos","events_url":"https://api.github.com/users/Krier/events{/privacy}","received_events_url":"https://api.github.com/users/Krier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-07T12:36:57Z","updated_at":"2018-03-07T13:51:45Z","closed_at":null,"author_association":"NONE","body":"I'm trying to load the Marvel Data from Ex 2 of week 4. And i get the following error. I have tried around on Google a bit, but I could't get it to work. \r\n\r\nCan anyone help, or maybe upload the data? \r\n\r\nCheers\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nUnicodeEncodeError                        Traceback (most recent call last)\r\n<ipython-input-1-6ea2e96be28f> in <module>()\r\n     62     # Save it\r\n     63     with open(\"%s/%s.txt\" % (folder, c[0]), 'w') as fp:\r\n---> 64         fp.write(markup)\r\n\r\n~\\AppData\\Local\\Continuum\\anaconda3\\lib\\encodings\\cp1252.py in encode(self, input, final)\r\n     17 class IncrementalEncoder(codecs.IncrementalEncoder):\r\n     18     def encode(self, input, final=False):\r\n---> 19         return codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\n     20 \r\n     21 class IncrementalDecoder(codecs.IncrementalDecoder):\r\n\r\nUnicodeEncodeError: 'charmap' codec can't encode character '\\u0131' in position 427: character maps to <undefined>\r\n```"},"comment":{"url":"https://api.github.com/repos/abjer/tsds/issues/comments/371144151","html_url":"https://github.com/abjer/tsds/issues/4#issuecomment-371144151","issue_url":"https://api.github.com/repos/abjer/tsds/issues/4","id":371144151,"user":{"login":"ulfaslak","id":6390218,"avatar_url":"https://avatars1.githubusercontent.com/u/6390218?v=4","gravatar_id":"","url":"https://api.github.com/users/ulfaslak","html_url":"https://github.com/ulfaslak","followers_url":"https://api.github.com/users/ulfaslak/followers","following_url":"https://api.github.com/users/ulfaslak/following{/other_user}","gists_url":"https://api.github.com/users/ulfaslak/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfaslak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfaslak/subscriptions","organizations_url":"https://api.github.com/users/ulfaslak/orgs","repos_url":"https://api.github.com/users/ulfaslak/repos","events_url":"https://api.github.com/users/ulfaslak/events{/privacy}","received_events_url":"https://api.github.com/users/ulfaslak/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T13:51:45Z","updated_at":"2018-03-07T13:51:45Z","author_association":"COLLABORATOR","body":"Must be a problem with the encoding scheme. I didn't encounter this. You may be able to solve this by encoding the `markup` as utf-8 before writing it to the file. Another solution is to remove all non-ascii characters. Here's a function that does that.\r\n\r\n```Python\r\ndef force_ascii(text):\r\n    return \"\".join([c for c in text if ord(c) < 128])\r\n```\r\n\r\nThen you just wrap that around `markup` on line 64, and you probably won't get that error."}}
{"actor":{"display_login":"ulfaslak"}}