{"action":"opened","number":5,"pull_request":{"url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/5","id":219870342,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5ODcwMzQy","html_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/pull/5","diff_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/pull/5.diff","patch_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/pull/5.patch","issue_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/5","number":5,"state":"open","locked":false,"title":"encode strings / chars as ascii before sending to the printer","user":{"login":"brennen","id":74990,"node_id":"MDQ6VXNlcjc0OTkw","avatar_url":"https://avatars2.githubusercontent.com/u/74990?v=4","gravatar_id":"","url":"https://api.github.com/users/brennen","html_url":"https://github.com/brennen","followers_url":"https://api.github.com/users/brennen/followers","following_url":"https://api.github.com/users/brennen/following{/other_user}","gists_url":"https://api.github.com/users/brennen/gists{/gist_id}","starred_url":"https://api.github.com/users/brennen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brennen/subscriptions","organizations_url":"https://api.github.com/users/brennen/orgs","repos_url":"https://api.github.com/users/brennen/repos","events_url":"https://api.github.com/users/brennen/events{/privacy}","received_events_url":"https://api.github.com/users/brennen/received_events","type":"User","site_admin":false},"body":"This or something like it seems to be necessary on CPython - otherwise you get a bunch of:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"thermal_printer_simpletest.py\", line 32, in <module>\r\n    printer = ThermalPrinter(uart, auto_warm_up=False)\r\n  File \"/home/pi/Adafruit_CircuitPython_Thermal_Printer/.env/lib/python3.5/site-packages/adafruit_circuitpython_thermal_printer-1.1.1.dev1+g9d776c7.d20181002-py3.5.egg/adafruit_thermal_printer/thermal_printer.py\", line 187, in __init__\r\n  File \"/home/pi/Adafruit_CircuitPython_Thermal_Printer/.env/lib/python3.5/site-packages/adafruit_circuitpython_thermal_printer-1.1.1.dev1+g9d776c7.d20181002-py3.5.egg/adafruit_thermal_printer/thermal_printer.py\", line 289, in reset\r\n  File \"/home/pi/Adafruit_CircuitPython_Thermal_Printer/.env/lib/python3.5/site-packages/adafruit_circuitpython_thermal_printer-1.1.1.dev1+g9d776c7.d20181002-py3.5.egg/adafruit_thermal_printer/thermal_printer.py\", line 241, in send_command\r\n  File \"/home/pi/Adafruit_CircuitPython_Thermal_Printer/.env/lib/python3.5/site-packages/serial/serialposix.py\", line 532, in write\r\n    d = to_bytes(data)\r\n  File \"/home/pi/Adafruit_CircuitPython_Thermal_Printer/.env/lib/python3.5/site-packages/serial/serialutil.py\", line 63, in to_bytes\r\n    raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))\r\nTypeError: unicode strings are not supported, please encode to bytes: '\\x1b@'\r\n```\r\n\r\nI'm unsure if this is the right way to handle the problem, or if I caught everything, but the simpletest runs with these changes.  Thoughts?\r\n\r\n(Hasn't yet been tested on CircuitPython hardware.)","created_at":"2018-10-02T22:59:51Z","updated_at":"2018-10-02T22:59:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/5/commits","review_comments_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/5/comments","review_comment_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/5/comments","statuses_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/statuses/7e361b688e8b51e52801059aa18f4f358b2966df","head":{"label":"adafruit:ascii_encoding","ref":"ascii_encoding","sha":"7e361b688e8b51e52801059aa18f4f358b2966df","user":{"login":"adafruit","id":181069,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTA2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/181069?v=4","gravatar_id":"","url":"https://api.github.com/users/adafruit","html_url":"https://github.com/adafruit","followers_url":"https://api.github.com/users/adafruit/followers","following_url":"https://api.github.com/users/adafruit/following{/other_user}","gists_url":"https://api.github.com/users/adafruit/gists{/gist_id}","starred_url":"https://api.github.com/users/adafruit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adafruit/subscriptions","organizations_url":"https://api.github.com/users/adafruit/orgs","repos_url":"https://api.github.com/users/adafruit/repos","events_url":"https://api.github.com/users/adafruit/events{/privacy}","received_events_url":"https://api.github.com/users/adafruit/received_events","type":"Organization","site_admin":false},"repo":{"id":115065616,"node_id":"MDEwOlJlcG9zaXRvcnkxMTUwNjU2MTY=","name":"Adafruit_CircuitPython_Thermal_Printer","full_name":"adafruit/Adafruit_CircuitPython_Thermal_Printer","private":false,"owner":{"login":"adafruit","id":181069,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTA2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/181069?v=4","gravatar_id":"","url":"https://api.github.com/users/adafruit","html_url":"https://github.com/adafruit","followers_url":"https://api.github.com/users/adafruit/followers","following_url":"https://api.github.com/users/adafruit/following{/other_user}","gists_url":"https://api.github.com/users/adafruit/gists{/gist_id}","starred_url":"https://api.github.com/users/adafruit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adafruit/subscriptions","organizations_url":"https://api.github.com/users/adafruit/orgs","repos_url":"https://api.github.com/users/adafruit/repos","events_url":"https://api.github.com/users/adafruit/events{/privacy}","received_events_url":"https://api.github.com/users/adafruit/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer","description":"CircuitPython module for interacting with serial thermal printers.","fork":false,"url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer","forks_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/forks","keys_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/teams","hooks_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/hooks","issue_events_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/events{/number}","events_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/events","assignees_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/assignees{/user}","branches_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/branches{/branch}","tags_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/tags","blobs_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/refs{/sha}","trees_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/statuses/{sha}","languages_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/languages","stargazers_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/stargazers","contributors_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/contributors","subscribers_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/subscribers","subscription_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/subscription","commits_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/commits{/sha}","git_commits_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/commits{/sha}","comments_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/comments{/number}","issue_comment_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/comments{/number}","contents_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/contents/{+path}","compare_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/merges","archive_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/downloads","issues_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues{/number}","pulls_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls{/number}","milestones_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/milestones{/number}","notifications_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/labels{/name}","releases_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/releases{/id}","deployments_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/deployments","created_at":"2017-12-22T02:02:40Z","updated_at":"2018-08-25T14:05:02Z","pushed_at":"2018-10-02T22:55:29Z","git_url":"git://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer.git","ssh_url":"git@github.com:adafruit/Adafruit_CircuitPython_Thermal_Printer.git","clone_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer.git","svn_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"adafruit:master","ref":"master","sha":"9d776c764f224f3b2447770ae6b821e15545d7ad","user":{"login":"adafruit","id":181069,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTA2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/181069?v=4","gravatar_id":"","url":"https://api.github.com/users/adafruit","html_url":"https://github.com/adafruit","followers_url":"https://api.github.com/users/adafruit/followers","following_url":"https://api.github.com/users/adafruit/following{/other_user}","gists_url":"https://api.github.com/users/adafruit/gists{/gist_id}","starred_url":"https://api.github.com/users/adafruit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adafruit/subscriptions","organizations_url":"https://api.github.com/users/adafruit/orgs","repos_url":"https://api.github.com/users/adafruit/repos","events_url":"https://api.github.com/users/adafruit/events{/privacy}","received_events_url":"https://api.github.com/users/adafruit/received_events","type":"Organization","site_admin":false},"repo":{"id":115065616,"node_id":"MDEwOlJlcG9zaXRvcnkxMTUwNjU2MTY=","name":"Adafruit_CircuitPython_Thermal_Printer","full_name":"adafruit/Adafruit_CircuitPython_Thermal_Printer","private":false,"owner":{"login":"adafruit","id":181069,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTA2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/181069?v=4","gravatar_id":"","url":"https://api.github.com/users/adafruit","html_url":"https://github.com/adafruit","followers_url":"https://api.github.com/users/adafruit/followers","following_url":"https://api.github.com/users/adafruit/following{/other_user}","gists_url":"https://api.github.com/users/adafruit/gists{/gist_id}","starred_url":"https://api.github.com/users/adafruit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adafruit/subscriptions","organizations_url":"https://api.github.com/users/adafruit/orgs","repos_url":"https://api.github.com/users/adafruit/repos","events_url":"https://api.github.com/users/adafruit/events{/privacy}","received_events_url":"https://api.github.com/users/adafruit/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer","description":"CircuitPython module for interacting with serial thermal printers.","fork":false,"url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer","forks_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/forks","keys_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/teams","hooks_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/hooks","issue_events_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/events{/number}","events_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/events","assignees_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/assignees{/user}","branches_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/branches{/branch}","tags_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/tags","blobs_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/refs{/sha}","trees_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/statuses/{sha}","languages_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/languages","stargazers_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/stargazers","contributors_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/contributors","subscribers_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/subscribers","subscription_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/subscription","commits_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/commits{/sha}","git_commits_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/git/commits{/sha}","comments_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/comments{/number}","issue_comment_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/comments{/number}","contents_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/contents/{+path}","compare_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/merges","archive_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/downloads","issues_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues{/number}","pulls_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls{/number}","milestones_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/milestones{/number}","notifications_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/labels{/name}","releases_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/releases{/id}","deployments_url":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/deployments","created_at":"2017-12-22T02:02:40Z","updated_at":"2018-08-25T14:05:02Z","pushed_at":"2018-10-02T22:55:29Z","git_url":"git://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer.git","ssh_url":"git@github.com:adafruit/Adafruit_CircuitPython_Thermal_Printer.git","clone_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer.git","svn_url":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/5"},"html":{"href":"https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/pull/5"},"issue":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/5"},"comments":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Thermal_Printer/statuses/7e361b688e8b51e52801059aa18f4f358b2966df"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":6,"deletions":3,"changed_files":2}}
{"actor":{"display_login":"brennen"}}