{"action":"created","comment":{"url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments/53052516","id":53052516,"diff_hunk":"@@ -404,9 +406,8 @@ def display_info(self, dataset):\n             if info.find( '\\n' ) >= 0:\n                 info = info.replace( '\\n', '<br/>' )\n \n-            # Convert to unicode to display non-ascii characters.\n-            if not isinstance(info, unicode):\n-                info = unicode( info, 'utf-8')\n+            if not isinstance(info, text_type):\n+                info = unicodify( info, 'utf-8' )","path":"lib/galaxy/datatypes/data.py","position":57,"original_position":57,"commit_id":"00794ad4973b199879be306b90c590845f054cfc","original_commit_id":"00794ad4973b199879be306b90c590845f054cfc","user":{"login":"mvdbeek","id":6804901,"avatar_url":"https://avatars.githubusercontent.com/u/6804901?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdbeek","html_url":"https://github.com/mvdbeek","followers_url":"https://api.github.com/users/mvdbeek/followers","following_url":"https://api.github.com/users/mvdbeek/following{/other_user}","gists_url":"https://api.github.com/users/mvdbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdbeek/subscriptions","organizations_url":"https://api.github.com/users/mvdbeek/orgs","repos_url":"https://api.github.com/users/mvdbeek/repos","events_url":"https://api.github.com/users/mvdbeek/events{/privacy}","received_events_url":"https://api.github.com/users/mvdbeek/received_events","type":"User","site_admin":false},"body":"> What about just calling:\r\n> \r\n> info = unicodify( info, 'utf-8' )\r\n> without the if?\r\n\r\nI guess so, since `unicodify()` does that anyway. The question is wether `utf-8` is always the correct encoding. There is the theoretical possibility that info is already non-utf-8 unicode ...","created_at":"2016-02-16T18:14:46Z","updated_at":"2016-02-16T18:14:46Z","html_url":"https://github.com/galaxyproject/galaxy/pull/1731#discussion_r53052516","pull_request_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731","_links":{"self":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments/53052516"},"html":{"href":"https://github.com/galaxyproject/galaxy/pull/1731#discussion_r53052516"},"pull_request":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731"}}},"pull_request":{"url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731","id":59336575,"html_url":"https://github.com/galaxyproject/galaxy/pull/1731","diff_url":"https://github.com/galaxyproject/galaxy/pull/1731.diff","patch_url":"https://github.com/galaxyproject/galaxy/pull/1731.patch","issue_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/1731","number":1731,"state":"open","locked":false,"title":"Python 2/3 string handling","user":{"login":"mvdbeek","id":6804901,"avatar_url":"https://avatars.githubusercontent.com/u/6804901?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdbeek","html_url":"https://github.com/mvdbeek","followers_url":"https://api.github.com/users/mvdbeek/followers","following_url":"https://api.github.com/users/mvdbeek/following{/other_user}","gists_url":"https://api.github.com/users/mvdbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdbeek/subscriptions","organizations_url":"https://api.github.com/users/mvdbeek/orgs","repos_url":"https://api.github.com/users/mvdbeek/repos","events_url":"https://api.github.com/users/mvdbeek/events{/privacy}","received_events_url":"https://api.github.com/users/mvdbeek/received_events","type":"User","site_admin":false},"body":"To make the string handling python 2 and python 3 compatible, I \r\n- removed all instances of `unicode` and replaced it with six's `text_type` (which is `unicode` on python2, `str` on python3).\r\n- replaced `basestring` with six's `string_types`\r\n- replaced `isinstance(var, str)` with `isinstance(var, string_types)` or `isinstance(var, string_types) and not isinstance(var, text_type)`, depending on the context.\r\n","created_at":"2016-02-15T09:10:02Z","updated_at":"2016-02-16T18:14:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95a5b89d22e8431399c3a6c9f608a3e80366fb44","assignee":null,"milestone":{"url":"https://api.github.com/repos/galaxyproject/galaxy/milestones/2","html_url":"https://github.com/galaxyproject/galaxy/milestones/16.04","labels_url":"https://api.github.com/repos/galaxyproject/galaxy/milestones/2/labels","id":1435676,"number":2,"title":"16.04","description":"Update this after 16.01","creator":{"login":"erasche","id":458683,"avatar_url":"https://avatars.githubusercontent.com/u/458683?v=3","gravatar_id":"","url":"https://api.github.com/users/erasche","html_url":"https://github.com/erasche","followers_url":"https://api.github.com/users/erasche/followers","following_url":"https://api.github.com/users/erasche/following{/other_user}","gists_url":"https://api.github.com/users/erasche/gists{/gist_id}","starred_url":"https://api.github.com/users/erasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erasche/subscriptions","organizations_url":"https://api.github.com/users/erasche/orgs","repos_url":"https://api.github.com/users/erasche/repos","events_url":"https://api.github.com/users/erasche/events{/privacy}","received_events_url":"https://api.github.com/users/erasche/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":86,"state":"open","created_at":"2015-11-30T17:22:37Z","updated_at":"2016-02-15T15:56:21Z","due_on":"2016-04-01T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731/commits","review_comments_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731/comments","review_comment_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/1731/comments","statuses_url":"https://api.github.com/repos/galaxyproject/galaxy/statuses/00794ad4973b199879be306b90c590845f054cfc","head":{"label":"mvdbeek:python_2_3_string_handling","ref":"python_2_3_string_handling","sha":"00794ad4973b199879be306b90c590845f054cfc","user":{"login":"mvdbeek","id":6804901,"avatar_url":"https://avatars.githubusercontent.com/u/6804901?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdbeek","html_url":"https://github.com/mvdbeek","followers_url":"https://api.github.com/users/mvdbeek/followers","following_url":"https://api.github.com/users/mvdbeek/following{/other_user}","gists_url":"https://api.github.com/users/mvdbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdbeek/subscriptions","organizations_url":"https://api.github.com/users/mvdbeek/orgs","repos_url":"https://api.github.com/users/mvdbeek/repos","events_url":"https://api.github.com/users/mvdbeek/events{/privacy}","received_events_url":"https://api.github.com/users/mvdbeek/received_events","type":"User","site_admin":false},"repo":{"id":38568566,"name":"galaxy","full_name":"mvdbeek/galaxy","owner":{"login":"mvdbeek","id":6804901,"avatar_url":"https://avatars.githubusercontent.com/u/6804901?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdbeek","html_url":"https://github.com/mvdbeek","followers_url":"https://api.github.com/users/mvdbeek/followers","following_url":"https://api.github.com/users/mvdbeek/following{/other_user}","gists_url":"https://api.github.com/users/mvdbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdbeek/subscriptions","organizations_url":"https://api.github.com/users/mvdbeek/orgs","repos_url":"https://api.github.com/users/mvdbeek/repos","events_url":"https://api.github.com/users/mvdbeek/events{/privacy}","received_events_url":"https://api.github.com/users/mvdbeek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mvdbeek/galaxy","description":"Data intensive biology for everyone.","fork":true,"url":"https://api.github.com/repos/mvdbeek/galaxy","forks_url":"https://api.github.com/repos/mvdbeek/galaxy/forks","keys_url":"https://api.github.com/repos/mvdbeek/galaxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mvdbeek/galaxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mvdbeek/galaxy/teams","hooks_url":"https://api.github.com/repos/mvdbeek/galaxy/hooks","issue_events_url":"https://api.github.com/repos/mvdbeek/galaxy/issues/events{/number}","events_url":"https://api.github.com/repos/mvdbeek/galaxy/events","assignees_url":"https://api.github.com/repos/mvdbeek/galaxy/assignees{/user}","branches_url":"https://api.github.com/repos/mvdbeek/galaxy/branches{/branch}","tags_url":"https://api.github.com/repos/mvdbeek/galaxy/tags","blobs_url":"https://api.github.com/repos/mvdbeek/galaxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mvdbeek/galaxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mvdbeek/galaxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mvdbeek/galaxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mvdbeek/galaxy/statuses/{sha}","languages_url":"https://api.github.com/repos/mvdbeek/galaxy/languages","stargazers_url":"https://api.github.com/repos/mvdbeek/galaxy/stargazers","contributors_url":"https://api.github.com/repos/mvdbeek/galaxy/contributors","subscribers_url":"https://api.github.com/repos/mvdbeek/galaxy/subscribers","subscription_url":"https://api.github.com/repos/mvdbeek/galaxy/subscription","commits_url":"https://api.github.com/repos/mvdbeek/galaxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mvdbeek/galaxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mvdbeek/galaxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mvdbeek/galaxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mvdbeek/galaxy/contents/{+path}","compare_url":"https://api.github.com/repos/mvdbeek/galaxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mvdbeek/galaxy/merges","archive_url":"https://api.github.com/repos/mvdbeek/galaxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mvdbeek/galaxy/downloads","issues_url":"https://api.github.com/repos/mvdbeek/galaxy/issues{/number}","pulls_url":"https://api.github.com/repos/mvdbeek/galaxy/pulls{/number}","milestones_url":"https://api.github.com/repos/mvdbeek/galaxy/milestones{/number}","notifications_url":"https://api.github.com/repos/mvdbeek/galaxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mvdbeek/galaxy/labels{/name}","releases_url":"https://api.github.com/repos/mvdbeek/galaxy/releases{/id}","deployments_url":"https://api.github.com/repos/mvdbeek/galaxy/deployments","created_at":"2015-07-05T12:40:16Z","updated_at":"2016-01-14T19:06:53Z","pushed_at":"2016-02-16T17:02:47Z","git_url":"git://github.com/mvdbeek/galaxy.git","ssh_url":"git@github.com:mvdbeek/galaxy.git","clone_url":"https://github.com/mvdbeek/galaxy.git","svn_url":"https://github.com/mvdbeek/galaxy","homepage":"http://galaxyproject.org/","size":89288,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"galaxyproject:dev","ref":"dev","sha":"3ee0594c692faac542ffa58f4339d79b9b8aefbd","user":{"login":"galaxyproject","id":7937847,"avatar_url":"https://avatars.githubusercontent.com/u/7937847?v=3","gravatar_id":"","url":"https://api.github.com/users/galaxyproject","html_url":"https://github.com/galaxyproject","followers_url":"https://api.github.com/users/galaxyproject/followers","following_url":"https://api.github.com/users/galaxyproject/following{/other_user}","gists_url":"https://api.github.com/users/galaxyproject/gists{/gist_id}","starred_url":"https://api.github.com/users/galaxyproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galaxyproject/subscriptions","organizations_url":"https://api.github.com/users/galaxyproject/orgs","repos_url":"https://api.github.com/users/galaxyproject/repos","events_url":"https://api.github.com/users/galaxyproject/events{/privacy}","received_events_url":"https://api.github.com/users/galaxyproject/received_events","type":"Organization","site_admin":false},"repo":{"id":31211061,"name":"galaxy","full_name":"galaxyproject/galaxy","owner":{"login":"galaxyproject","id":7937847,"avatar_url":"https://avatars.githubusercontent.com/u/7937847?v=3","gravatar_id":"","url":"https://api.github.com/users/galaxyproject","html_url":"https://github.com/galaxyproject","followers_url":"https://api.github.com/users/galaxyproject/followers","following_url":"https://api.github.com/users/galaxyproject/following{/other_user}","gists_url":"https://api.github.com/users/galaxyproject/gists{/gist_id}","starred_url":"https://api.github.com/users/galaxyproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galaxyproject/subscriptions","organizations_url":"https://api.github.com/users/galaxyproject/orgs","repos_url":"https://api.github.com/users/galaxyproject/repos","events_url":"https://api.github.com/users/galaxyproject/events{/privacy}","received_events_url":"https://api.github.com/users/galaxyproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/galaxyproject/galaxy","description":"Data intensive science for everyone.","fork":false,"url":"https://api.github.com/repos/galaxyproject/galaxy","forks_url":"https://api.github.com/repos/galaxyproject/galaxy/forks","keys_url":"https://api.github.com/repos/galaxyproject/galaxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/galaxyproject/galaxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/galaxyproject/galaxy/teams","hooks_url":"https://api.github.com/repos/galaxyproject/galaxy/hooks","issue_events_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/events{/number}","events_url":"https://api.github.com/repos/galaxyproject/galaxy/events","assignees_url":"https://api.github.com/repos/galaxyproject/galaxy/assignees{/user}","branches_url":"https://api.github.com/repos/galaxyproject/galaxy/branches{/branch}","tags_url":"https://api.github.com/repos/galaxyproject/galaxy/tags","blobs_url":"https://api.github.com/repos/galaxyproject/galaxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/galaxyproject/galaxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/galaxyproject/galaxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/galaxyproject/galaxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/galaxyproject/galaxy/statuses/{sha}","languages_url":"https://api.github.com/repos/galaxyproject/galaxy/languages","stargazers_url":"https://api.github.com/repos/galaxyproject/galaxy/stargazers","contributors_url":"https://api.github.com/repos/galaxyproject/galaxy/contributors","subscribers_url":"https://api.github.com/repos/galaxyproject/galaxy/subscribers","subscription_url":"https://api.github.com/repos/galaxyproject/galaxy/subscription","commits_url":"https://api.github.com/repos/galaxyproject/galaxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/galaxyproject/galaxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/galaxyproject/galaxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/galaxyproject/galaxy/contents/{+path}","compare_url":"https://api.github.com/repos/galaxyproject/galaxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/galaxyproject/galaxy/merges","archive_url":"https://api.github.com/repos/galaxyproject/galaxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/galaxyproject/galaxy/downloads","issues_url":"https://api.github.com/repos/galaxyproject/galaxy/issues{/number}","pulls_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls{/number}","milestones_url":"https://api.github.com/repos/galaxyproject/galaxy/milestones{/number}","notifications_url":"https://api.github.com/repos/galaxyproject/galaxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/galaxyproject/galaxy/labels{/name}","releases_url":"https://api.github.com/repos/galaxyproject/galaxy/releases{/id}","deployments_url":"https://api.github.com/repos/galaxyproject/galaxy/deployments","created_at":"2015-02-23T14:18:06Z","updated_at":"2016-02-16T05:48:56Z","pushed_at":"2016-02-16T18:02:25Z","git_url":"git://github.com/galaxyproject/galaxy.git","ssh_url":"git@github.com:galaxyproject/galaxy.git","clone_url":"https://github.com/galaxyproject/galaxy.git","svn_url":"https://github.com/galaxyproject/galaxy","homepage":"https://galaxyproject.org/","size":113078,"stargazers_count":115,"watchers_count":115,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":293,"forks":170,"open_issues":293,"watchers":115,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731"},"html":{"href":"https://github.com/galaxyproject/galaxy/pull/1731"},"issue":{"href":"https://api.github.com/repos/galaxyproject/galaxy/issues/1731"},"comments":{"href":"https://api.github.com/repos/galaxyproject/galaxy/issues/1731/comments"},"review_comments":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731/comments"},"review_comment":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1731/commits"},"statuses":{"href":"https://api.github.com/repos/galaxyproject/galaxy/statuses/00794ad4973b199879be306b90c590845f054cfc"}}}}