{"action":"created","issue":{"url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect/issues/436","repository_url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect","labels_url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect/issues/436/labels{/name}","comments_url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect/issues/436/comments","events_url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect/issues/436/events","html_url":"https://github.com/NaturalHistoryMuseum/inselect/issues/436","id":258237413,"number":436,"title":"error reading YAML template with UTF-8 characters","user":{"login":"FetznerJ","id":12090615,"avatar_url":"https://avatars2.githubusercontent.com/u/12090615?v=4","gravatar_id":"","url":"https://api.github.com/users/FetznerJ","html_url":"https://github.com/FetznerJ","followers_url":"https://api.github.com/users/FetznerJ/followers","following_url":"https://api.github.com/users/FetznerJ/following{/other_user}","gists_url":"https://api.github.com/users/FetznerJ/gists{/gist_id}","starred_url":"https://api.github.com/users/FetznerJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FetznerJ/subscriptions","organizations_url":"https://api.github.com/users/FetznerJ/orgs","repos_url":"https://api.github.com/users/FetznerJ/repos","events_url":"https://api.github.com/users/FetznerJ/events{/privacy}","received_events_url":"https://api.github.com/users/FetznerJ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-16T15:10:22Z","updated_at":"2017-09-17T19:21:50Z","closed_at":null,"author_association":"NONE","body":"If the YAML file contains a UTF-8 character (e.g., Nuevo León), Inselect throws an error stating:\r\n\"An error occurred. 'utf-8' codec can't decide byte '0xf3' in position 3653: invalid continuation byte\"\r\n\r\nHere is the Traceback\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\gui\\utils.py\", line 113, in wrapper\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\gui\\user_template_popup_button.py\", line 78, in choose\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\gui\\user_template_choice.py\", line 60, in load\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\gui\\user_template_choice.py\", line 55, in _load\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\lib\\user_template.py\", line 102, in load\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\lib\\persist_user_template.py\", line 255, in load_specification_from_file\r\n  File \"C:\\Users\\Lawrence\\projects\\inselect\\inselect\\lib\\persist_user_template.py\", line 227, in _ordered_load\r\n  File \"C:\\Users\\Lawrence\\Miniconda2-64\\envs\\inselect\\lib\\site-packages\\yaml\\__init__.py\", line 69, in load\r\n  File \"C:\\Users\\Lawrence\\Miniconda2-64\\envs\\inselect\\lib\\site-packages\\yaml\\loader.py\", line 24, in __init__\r\n  File \"C:\\Users\\Lawrence\\Miniconda2-64\\envs\\inselect\\lib\\site-packages\\yaml\\reader.py\", line 85, in __init__\r\n  File \"C:\\Users\\Lawrence\\Miniconda2-64\\envs\\inselect\\lib\\site-packages\\yaml\\reader.py\", line 124, in determine_encoding\r\n  File \"C:\\Users\\Lawrence\\Miniconda2-64\\envs\\inselect\\lib\\site-packages\\yaml\\reader.py\", line 178, in update_raw\r\n  File \"C:\\Users\\Lawrence\\Miniconda2-64\\envs\\inselect\\lib\\codecs.py\", line 314, in decode\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 3653: invalid continuation byte\r\n\r\n\r\nAnd here is an example from the YAML template:\r\n    - Name: StateProv\r\n      Label: State or Province (e.g., Texas)\r\n      Choices:\r\n         - Hidalgo\r\n         - Jalisco\r\n         - Mexico State\r\n         - Michoacan\r\n         - Morelos\r\n         - Nayarit\r\n         - Nuevo León"},"comment":{"url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect/issues/comments/330076185","html_url":"https://github.com/NaturalHistoryMuseum/inselect/issues/436#issuecomment-330076185","issue_url":"https://api.github.com/repos/NaturalHistoryMuseum/inselect/issues/436","id":330076185,"user":{"login":"quicklizard99","id":1640027,"avatar_url":"https://avatars3.githubusercontent.com/u/1640027?v=4","gravatar_id":"","url":"https://api.github.com/users/quicklizard99","html_url":"https://github.com/quicklizard99","followers_url":"https://api.github.com/users/quicklizard99/followers","following_url":"https://api.github.com/users/quicklizard99/following{/other_user}","gists_url":"https://api.github.com/users/quicklizard99/gists{/gist_id}","starred_url":"https://api.github.com/users/quicklizard99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quicklizard99/subscriptions","organizations_url":"https://api.github.com/users/quicklizard99/orgs","repos_url":"https://api.github.com/users/quicklizard99/repos","events_url":"https://api.github.com/users/quicklizard99/events{/privacy}","received_events_url":"https://api.github.com/users/quicklizard99/received_events","type":"User","site_admin":false},"created_at":"2017-09-17T19:21:50Z","updated_at":"2017-09-17T19:21:50Z","author_association":"OWNER","body":"Hi,\r\n\r\nInselect can load the following template:\r\n\r\n```\r\nName: Test template\r\nFields:\r\n    - Name: StateProv\r\n      Label: State or Province (e.g., Texas)\r\n      Choices:\r\n        - Hidalgo\r\n        - Jalisco\r\n        - Mexico State\r\n        - Michoacan\r\n        - Morelos\r\n        - Nayarit\r\n        - Nuevo León\r\n```\r\n\r\nI suspect that your template file is not UTF-8 encoded. Does your text editor permit you to set the character-encoding of the file? If not, I recommend using Sublime Text (https://www.sublimetext.com/) - you can set the correct character-encoding by selecting 'File, Save with Encoding, UTF-8'.\r\n\r\nIf you are unable to get the template to load in Inselect, please email it to me and I can check it.\r\n\r\nHope this helps!\r\n"}}
{"actor":{"display_login":"quicklizard99"}}