{"action":"created","comment":{"url":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments/229658651","pull_request_review_id":170206864,"id":229658651,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTY1ODY1MQ==","diff_hunk":"@@ -510,6 +516,8 @@ def to_str(s_or_u, encoding=\"utf-8\", errors=\"strict\"):\n \n def to_unicode(s_or_u, encoding=\"utf-8\", errors=\"strict\"):\n \t\"\"\"Make sure ``s_or_u`` is a unicode string.\"\"\"\n+\tif PY3:","path":"src/octoprint/util/__init__.py","position":33,"original_position":33,"commit_id":"96d516841057d1a6b8c639eb24d86d5886e6a7f8","original_commit_id":"f6bf8ab674a7e691b418dd803c30c209442733c7","user":{"login":"foosel","id":83657,"node_id":"MDQ6VXNlcjgzNjU3","avatar_url":"https://avatars0.githubusercontent.com/u/83657?v=4","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"body":"The thing is that `to_unicode` and `to_str` should probably have been called `to_unicode_string` and `to_byte_representation`. \r\n\r\n`to_unicode` should ensure that whatever it gets, py3 str or py3 bytes or py2 unicode or py2 str, a unicode string (py3 str & py2 unicode) is the result.\r\n\r\n`to_str` should ensure that whatever it gets, py3 str or py3 bytes or py2 unicode or py2 str, a byte representation (py3 bytes & py2 str) is the result.","created_at":"2018-10-31T11:37:55Z","updated_at":"2018-10-31T11:37:55Z","html_url":"https://github.com/foosel/OctoPrint/pull/2840#discussion_r229658651","pull_request_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments/229658651"},"html":{"href":"https://github.com/foosel/OctoPrint/pull/2840#discussion_r229658651"},"pull_request":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840"}},"in_reply_to_id":229386613},"pull_request":{"url":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840","id":221493054,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNDkzMDU0","html_url":"https://github.com/foosel/OctoPrint/pull/2840","diff_url":"https://github.com/foosel/OctoPrint/pull/2840.diff","patch_url":"https://github.com/foosel/OctoPrint/pull/2840.patch","issue_url":"https://api.github.com/repos/foosel/OctoPrint/issues/2840","number":2840,"state":"open","locked":false,"title":"Py3 unicode type removing","user":{"login":"razerraz","id":12051205,"node_id":"MDQ6VXNlcjEyMDUxMjA1","avatar_url":"https://avatars2.githubusercontent.com/u/12051205?v=4","gravatar_id":"","url":"https://api.github.com/users/razerraz","html_url":"https://github.com/razerraz","followers_url":"https://api.github.com/users/razerraz/followers","following_url":"https://api.github.com/users/razerraz/following{/other_user}","gists_url":"https://api.github.com/users/razerraz/gists{/gist_id}","starred_url":"https://api.github.com/users/razerraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razerraz/subscriptions","organizations_url":"https://api.github.com/users/razerraz/orgs","repos_url":"https://api.github.com/users/razerraz/repos","events_url":"https://api.github.com/users/razerraz/events{/privacy}","received_events_url":"https://api.github.com/users/razerraz/received_events","type":"User","site_admin":false},"body":"#### What does this PR do and why is it necessary?\r\nPrepare Python 3 migration by removing all references to unicode python2 string type\r\n\r\n#### How was it tested? How can it be tested by the reviewer?\r\n\r\n#### Any background context you want to provide?\r\n\r\n#### What are the relevant tickets if any?\r\n\r\n#### Screenshots (if appropriate)\r\n\r\n#### Further notes\r\n","created_at":"2018-10-09T15:50:09Z","updated_at":"2018-10-31T11:37:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41f2bf19e2969515328606346522e8ead775038b","assignee":{"login":"foosel","id":83657,"node_id":"MDQ6VXNlcjgzNjU3","avatar_url":"https://avatars0.githubusercontent.com/u/83657?v=4","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"assignees":[{"login":"foosel","id":83657,"node_id":"MDQ6VXNlcjgzNjU3","avatar_url":"https://avatars0.githubusercontent.com/u/83657?v=4","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":326463043,"node_id":"MDU6TGFiZWwzMjY0NjMwNDM=","url":"https://api.github.com/repos/foosel/OctoPrint/labels/pr:needs%20some%20work","name":"pr:needs some work","color":"eb6420","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840/commits","review_comments_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840/comments","review_comment_url":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/foosel/OctoPrint/issues/2840/comments","statuses_url":"https://api.github.com/repos/foosel/OctoPrint/statuses/96d516841057d1a6b8c639eb24d86d5886e6a7f8","head":{"label":"razerraz:Py3_Unicode_type_removing","ref":"Py3_Unicode_type_removing","sha":"96d516841057d1a6b8c639eb24d86d5886e6a7f8","user":{"login":"razerraz","id":12051205,"node_id":"MDQ6VXNlcjEyMDUxMjA1","avatar_url":"https://avatars2.githubusercontent.com/u/12051205?v=4","gravatar_id":"","url":"https://api.github.com/users/razerraz","html_url":"https://github.com/razerraz","followers_url":"https://api.github.com/users/razerraz/followers","following_url":"https://api.github.com/users/razerraz/following{/other_user}","gists_url":"https://api.github.com/users/razerraz/gists{/gist_id}","starred_url":"https://api.github.com/users/razerraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razerraz/subscriptions","organizations_url":"https://api.github.com/users/razerraz/orgs","repos_url":"https://api.github.com/users/razerraz/repos","events_url":"https://api.github.com/users/razerraz/events{/privacy}","received_events_url":"https://api.github.com/users/razerraz/received_events","type":"User","site_admin":false},"repo":{"id":152273211,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNzMyMTE=","name":"OctoPrint","full_name":"razerraz/OctoPrint","private":false,"owner":{"login":"razerraz","id":12051205,"node_id":"MDQ6VXNlcjEyMDUxMjA1","avatar_url":"https://avatars2.githubusercontent.com/u/12051205?v=4","gravatar_id":"","url":"https://api.github.com/users/razerraz","html_url":"https://github.com/razerraz","followers_url":"https://api.github.com/users/razerraz/followers","following_url":"https://api.github.com/users/razerraz/following{/other_user}","gists_url":"https://api.github.com/users/razerraz/gists{/gist_id}","starred_url":"https://api.github.com/users/razerraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razerraz/subscriptions","organizations_url":"https://api.github.com/users/razerraz/orgs","repos_url":"https://api.github.com/users/razerraz/repos","events_url":"https://api.github.com/users/razerraz/events{/privacy}","received_events_url":"https://api.github.com/users/razerraz/received_events","type":"User","site_admin":false},"html_url":"https://github.com/razerraz/OctoPrint","description":"OctoPrint is the snappy web interface for your 3D printer!","fork":true,"url":"https://api.github.com/repos/razerraz/OctoPrint","forks_url":"https://api.github.com/repos/razerraz/OctoPrint/forks","keys_url":"https://api.github.com/repos/razerraz/OctoPrint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/razerraz/OctoPrint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/razerraz/OctoPrint/teams","hooks_url":"https://api.github.com/repos/razerraz/OctoPrint/hooks","issue_events_url":"https://api.github.com/repos/razerraz/OctoPrint/issues/events{/number}","events_url":"https://api.github.com/repos/razerraz/OctoPrint/events","assignees_url":"https://api.github.com/repos/razerraz/OctoPrint/assignees{/user}","branches_url":"https://api.github.com/repos/razerraz/OctoPrint/branches{/branch}","tags_url":"https://api.github.com/repos/razerraz/OctoPrint/tags","blobs_url":"https://api.github.com/repos/razerraz/OctoPrint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/razerraz/OctoPrint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/razerraz/OctoPrint/git/refs{/sha}","trees_url":"https://api.github.com/repos/razerraz/OctoPrint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/razerraz/OctoPrint/statuses/{sha}","languages_url":"https://api.github.com/repos/razerraz/OctoPrint/languages","stargazers_url":"https://api.github.com/repos/razerraz/OctoPrint/stargazers","contributors_url":"https://api.github.com/repos/razerraz/OctoPrint/contributors","subscribers_url":"https://api.github.com/repos/razerraz/OctoPrint/subscribers","subscription_url":"https://api.github.com/repos/razerraz/OctoPrint/subscription","commits_url":"https://api.github.com/repos/razerraz/OctoPrint/commits{/sha}","git_commits_url":"https://api.github.com/repos/razerraz/OctoPrint/git/commits{/sha}","comments_url":"https://api.github.com/repos/razerraz/OctoPrint/comments{/number}","issue_comment_url":"https://api.github.com/repos/razerraz/OctoPrint/issues/comments{/number}","contents_url":"https://api.github.com/repos/razerraz/OctoPrint/contents/{+path}","compare_url":"https://api.github.com/repos/razerraz/OctoPrint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/razerraz/OctoPrint/merges","archive_url":"https://api.github.com/repos/razerraz/OctoPrint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/razerraz/OctoPrint/downloads","issues_url":"https://api.github.com/repos/razerraz/OctoPrint/issues{/number}","pulls_url":"https://api.github.com/repos/razerraz/OctoPrint/pulls{/number}","milestones_url":"https://api.github.com/repos/razerraz/OctoPrint/milestones{/number}","notifications_url":"https://api.github.com/repos/razerraz/OctoPrint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/razerraz/OctoPrint/labels{/name}","releases_url":"https://api.github.com/repos/razerraz/OctoPrint/releases{/id}","deployments_url":"https://api.github.com/repos/razerraz/OctoPrint/deployments","created_at":"2018-10-09T15:13:00Z","updated_at":"2018-10-09T15:13:04Z","pushed_at":"2018-10-29T08:18:48Z","git_url":"git://github.com/razerraz/OctoPrint.git","ssh_url":"git@github.com:razerraz/OctoPrint.git","clone_url":"https://github.com/razerraz/OctoPrint.git","svn_url":"https://github.com/razerraz/OctoPrint","homepage":"https://octoprint.org","size":59435,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"foosel:devel","ref":"devel","sha":"1ccc1fa47bd0ad4d57f88473d51d3b3411bee62d","user":{"login":"foosel","id":83657,"node_id":"MDQ6VXNlcjgzNjU3","avatar_url":"https://avatars0.githubusercontent.com/u/83657?v=4","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"repo":{"id":7386799,"node_id":"MDEwOlJlcG9zaXRvcnk3Mzg2Nzk5","name":"OctoPrint","full_name":"foosel/OctoPrint","private":false,"owner":{"login":"foosel","id":83657,"node_id":"MDQ6VXNlcjgzNjU3","avatar_url":"https://avatars0.githubusercontent.com/u/83657?v=4","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"html_url":"https://github.com/foosel/OctoPrint","description":"OctoPrint is the snappy web interface for your 3D printer!","fork":false,"url":"https://api.github.com/repos/foosel/OctoPrint","forks_url":"https://api.github.com/repos/foosel/OctoPrint/forks","keys_url":"https://api.github.com/repos/foosel/OctoPrint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foosel/OctoPrint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foosel/OctoPrint/teams","hooks_url":"https://api.github.com/repos/foosel/OctoPrint/hooks","issue_events_url":"https://api.github.com/repos/foosel/OctoPrint/issues/events{/number}","events_url":"https://api.github.com/repos/foosel/OctoPrint/events","assignees_url":"https://api.github.com/repos/foosel/OctoPrint/assignees{/user}","branches_url":"https://api.github.com/repos/foosel/OctoPrint/branches{/branch}","tags_url":"https://api.github.com/repos/foosel/OctoPrint/tags","blobs_url":"https://api.github.com/repos/foosel/OctoPrint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foosel/OctoPrint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foosel/OctoPrint/git/refs{/sha}","trees_url":"https://api.github.com/repos/foosel/OctoPrint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foosel/OctoPrint/statuses/{sha}","languages_url":"https://api.github.com/repos/foosel/OctoPrint/languages","stargazers_url":"https://api.github.com/repos/foosel/OctoPrint/stargazers","contributors_url":"https://api.github.com/repos/foosel/OctoPrint/contributors","subscribers_url":"https://api.github.com/repos/foosel/OctoPrint/subscribers","subscription_url":"https://api.github.com/repos/foosel/OctoPrint/subscription","commits_url":"https://api.github.com/repos/foosel/OctoPrint/commits{/sha}","git_commits_url":"https://api.github.com/repos/foosel/OctoPrint/git/commits{/sha}","comments_url":"https://api.github.com/repos/foosel/OctoPrint/comments{/number}","issue_comment_url":"https://api.github.com/repos/foosel/OctoPrint/issues/comments{/number}","contents_url":"https://api.github.com/repos/foosel/OctoPrint/contents/{+path}","compare_url":"https://api.github.com/repos/foosel/OctoPrint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foosel/OctoPrint/merges","archive_url":"https://api.github.com/repos/foosel/OctoPrint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foosel/OctoPrint/downloads","issues_url":"https://api.github.com/repos/foosel/OctoPrint/issues{/number}","pulls_url":"https://api.github.com/repos/foosel/OctoPrint/pulls{/number}","milestones_url":"https://api.github.com/repos/foosel/OctoPrint/milestones{/number}","notifications_url":"https://api.github.com/repos/foosel/OctoPrint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foosel/OctoPrint/labels{/name}","releases_url":"https://api.github.com/repos/foosel/OctoPrint/releases{/id}","deployments_url":"https://api.github.com/repos/foosel/OctoPrint/deployments","created_at":"2012-12-31T12:20:57Z","updated_at":"2018-10-30T19:56:56Z","pushed_at":"2018-10-31T10:58:29Z","git_url":"git://github.com/foosel/OctoPrint.git","ssh_url":"git@github.com:foosel/OctoPrint.git","clone_url":"https://github.com/foosel/OctoPrint.git","svn_url":"https://github.com/foosel/OctoPrint","homepage":"https://octoprint.org","size":35991,"stargazers_count":3035,"watchers_count":3035,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1024,"mirror_url":null,"archived":false,"open_issues_count":317,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":1024,"open_issues":317,"watchers":3035,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840"},"html":{"href":"https://github.com/foosel/OctoPrint/pull/2840"},"issue":{"href":"https://api.github.com/repos/foosel/OctoPrint/issues/2840"},"comments":{"href":"https://api.github.com/repos/foosel/OctoPrint/issues/2840/comments"},"review_comments":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840/comments"},"review_comment":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/foosel/OctoPrint/pulls/2840/commits"},"statuses":{"href":"https://api.github.com/repos/foosel/OctoPrint/statuses/96d516841057d1a6b8c639eb24d86d5886e6a7f8"}},"author_association":"NONE"}}
{"actor":{"display_login":"foosel"}}