{"action":"created","comment":{"url":"https://api.github.com/repos/jelmer/dulwich/pulls/comments/43585604","id":43585604,"diff_hunk":"@@ -97,6 +98,14 @@\n GitStatus = namedtuple('GitStatus', 'staged unstaged untracked')\n \n \n+if sys.version_info[0] < 3:\n+    STDOUT = sys.stdout\n+    STDERR = sys.stderr\n+else:\n+    STDOUT = codecs.getwriter('utf-8')(sys.stdout.buffer)","path":"dulwich/porcelain.py","position":16,"original_position":16,"commit_id":"2a355bcaedc132b95544cb345c39e8c1c89f52c7","original_commit_id":"2a355bcaedc132b95544cb345c39e8c1c89f52c7","user":{"login":"jelmer","id":49032,"avatar_url":"https://avatars.githubusercontent.com/u/49032?v=3","gravatar_id":"","url":"https://api.github.com/users/jelmer","html_url":"https://github.com/jelmer","followers_url":"https://api.github.com/users/jelmer/followers","following_url":"https://api.github.com/users/jelmer/following{/other_user}","gists_url":"https://api.github.com/users/jelmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jelmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelmer/subscriptions","organizations_url":"https://api.github.com/users/jelmer/orgs","repos_url":"https://api.github.com/users/jelmer/repos","events_url":"https://api.github.com/users/jelmer/events{/privacy}","received_events_url":"https://api.github.com/users/jelmer/received_events","type":"User","site_admin":false},"body":"The system encoding is not necessarily utf-8. Is there any reason why just sys.stdout.buffer wouldn't work?","created_at":"2015-11-01T18:30:30Z","updated_at":"2015-11-01T18:30:30Z","html_url":"https://github.com/jelmer/dulwich/pull/388#discussion_r43585604","pull_request_url":"https://api.github.com/repos/jelmer/dulwich/pulls/388","_links":{"self":{"href":"https://api.github.com/repos/jelmer/dulwich/pulls/comments/43585604"},"html":{"href":"https://github.com/jelmer/dulwich/pull/388#discussion_r43585604"},"pull_request":{"href":"https://api.github.com/repos/jelmer/dulwich/pulls/388"}}},"pull_request":{"url":"https://api.github.com/repos/jelmer/dulwich/pulls/388","id":49374806,"html_url":"https://github.com/jelmer/dulwich/pull/388","diff_url":"https://github.com/jelmer/dulwich/pull/388.diff","patch_url":"https://github.com/jelmer/dulwich/pull/388.patch","issue_url":"https://api.github.com/repos/jelmer/dulwich/issues/388","number":388,"state":"open","locked":false,"title":"Fix local cloning under Python 3","user":{"login":"myint","id":1235108,"avatar_url":"https://avatars.githubusercontent.com/u/1235108?v=3","gravatar_id":"","url":"https://api.github.com/users/myint","html_url":"https://github.com/myint","followers_url":"https://api.github.com/users/myint/followers","following_url":"https://api.github.com/users/myint/following{/other_user}","gists_url":"https://api.github.com/users/myint/gists{/gist_id}","starred_url":"https://api.github.com/users/myint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myint/subscriptions","organizations_url":"https://api.github.com/users/myint/orgs","repos_url":"https://api.github.com/users/myint/repos","events_url":"https://api.github.com/users/myint/events{/privacy}","received_events_url":"https://api.github.com/users/myint/received_events","type":"User","site_admin":false},"body":"This gets local cloning working. It supports Python 3 while leaving the Python 2 effectively untouched.\r\n\r\n```\r\n$ python examples/clone.py . /tmp/clone\r\n```\r\n\r\nThe above used to result in a `TypeError`. This did not show up in the tests since the tests don't use the default arguments.","created_at":"2015-11-01T16:09:34Z","updated_at":"2015-11-01T18:30:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"388ea4a6efa2ccff6312b686bedff1425c6327eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jelmer/dulwich/pulls/388/commits","review_comments_url":"https://api.github.com/repos/jelmer/dulwich/pulls/388/comments","review_comment_url":"https://api.github.com/repos/jelmer/dulwich/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jelmer/dulwich/issues/388/comments","statuses_url":"https://api.github.com/repos/jelmer/dulwich/statuses/2a355bcaedc132b95544cb345c39e8c1c89f52c7","head":{"label":"myint:master","ref":"master","sha":"2a355bcaedc132b95544cb345c39e8c1c89f52c7","user":{"login":"myint","id":1235108,"avatar_url":"https://avatars.githubusercontent.com/u/1235108?v=3","gravatar_id":"","url":"https://api.github.com/users/myint","html_url":"https://github.com/myint","followers_url":"https://api.github.com/users/myint/followers","following_url":"https://api.github.com/users/myint/following{/other_user}","gists_url":"https://api.github.com/users/myint/gists{/gist_id}","starred_url":"https://api.github.com/users/myint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myint/subscriptions","organizations_url":"https://api.github.com/users/myint/orgs","repos_url":"https://api.github.com/users/myint/repos","events_url":"https://api.github.com/users/myint/events{/privacy}","received_events_url":"https://api.github.com/users/myint/received_events","type":"User","site_admin":false},"repo":{"id":44888039,"name":"dulwich","full_name":"myint/dulwich","owner":{"login":"myint","id":1235108,"avatar_url":"https://avatars.githubusercontent.com/u/1235108?v=3","gravatar_id":"","url":"https://api.github.com/users/myint","html_url":"https://github.com/myint","followers_url":"https://api.github.com/users/myint/followers","following_url":"https://api.github.com/users/myint/following{/other_user}","gists_url":"https://api.github.com/users/myint/gists{/gist_id}","starred_url":"https://api.github.com/users/myint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myint/subscriptions","organizations_url":"https://api.github.com/users/myint/orgs","repos_url":"https://api.github.com/users/myint/repos","events_url":"https://api.github.com/users/myint/events{/privacy}","received_events_url":"https://api.github.com/users/myint/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/myint/dulwich","description":"Pure-Python Git implementation","fork":true,"url":"https://api.github.com/repos/myint/dulwich","forks_url":"https://api.github.com/repos/myint/dulwich/forks","keys_url":"https://api.github.com/repos/myint/dulwich/keys{/key_id}","collaborators_url":"https://api.github.com/repos/myint/dulwich/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/myint/dulwich/teams","hooks_url":"https://api.github.com/repos/myint/dulwich/hooks","issue_events_url":"https://api.github.com/repos/myint/dulwich/issues/events{/number}","events_url":"https://api.github.com/repos/myint/dulwich/events","assignees_url":"https://api.github.com/repos/myint/dulwich/assignees{/user}","branches_url":"https://api.github.com/repos/myint/dulwich/branches{/branch}","tags_url":"https://api.github.com/repos/myint/dulwich/tags","blobs_url":"https://api.github.com/repos/myint/dulwich/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/myint/dulwich/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/myint/dulwich/git/refs{/sha}","trees_url":"https://api.github.com/repos/myint/dulwich/git/trees{/sha}","statuses_url":"https://api.github.com/repos/myint/dulwich/statuses/{sha}","languages_url":"https://api.github.com/repos/myint/dulwich/languages","stargazers_url":"https://api.github.com/repos/myint/dulwich/stargazers","contributors_url":"https://api.github.com/repos/myint/dulwich/contributors","subscribers_url":"https://api.github.com/repos/myint/dulwich/subscribers","subscription_url":"https://api.github.com/repos/myint/dulwich/subscription","commits_url":"https://api.github.com/repos/myint/dulwich/commits{/sha}","git_commits_url":"https://api.github.com/repos/myint/dulwich/git/commits{/sha}","comments_url":"https://api.github.com/repos/myint/dulwich/comments{/number}","issue_comment_url":"https://api.github.com/repos/myint/dulwich/issues/comments{/number}","contents_url":"https://api.github.com/repos/myint/dulwich/contents/{+path}","compare_url":"https://api.github.com/repos/myint/dulwich/compare/{base}...{head}","merges_url":"https://api.github.com/repos/myint/dulwich/merges","archive_url":"https://api.github.com/repos/myint/dulwich/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/myint/dulwich/downloads","issues_url":"https://api.github.com/repos/myint/dulwich/issues{/number}","pulls_url":"https://api.github.com/repos/myint/dulwich/pulls{/number}","milestones_url":"https://api.github.com/repos/myint/dulwich/milestones{/number}","notifications_url":"https://api.github.com/repos/myint/dulwich/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/myint/dulwich/labels{/name}","releases_url":"https://api.github.com/repos/myint/dulwich/releases{/id}","created_at":"2015-10-24T22:50:25Z","updated_at":"2015-10-25T03:31:54Z","pushed_at":"2015-11-01T16:05:38Z","git_url":"git://github.com/myint/dulwich.git","ssh_url":"git@github.com:myint/dulwich.git","clone_url":"https://github.com/myint/dulwich.git","svn_url":"https://github.com/myint/dulwich","homepage":"https://www.dulwich.io/","size":8130,"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":"master"}},"base":{"label":"jelmer:master","ref":"master","sha":"234e8a1649342aab34d6821c3fbca01001f24c21","user":{"login":"jelmer","id":49032,"avatar_url":"https://avatars.githubusercontent.com/u/49032?v=3","gravatar_id":"","url":"https://api.github.com/users/jelmer","html_url":"https://github.com/jelmer","followers_url":"https://api.github.com/users/jelmer/followers","following_url":"https://api.github.com/users/jelmer/following{/other_user}","gists_url":"https://api.github.com/users/jelmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jelmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelmer/subscriptions","organizations_url":"https://api.github.com/users/jelmer/orgs","repos_url":"https://api.github.com/users/jelmer/repos","events_url":"https://api.github.com/users/jelmer/events{/privacy}","received_events_url":"https://api.github.com/users/jelmer/received_events","type":"User","site_admin":false},"repo":{"id":156187,"name":"dulwich","full_name":"jelmer/dulwich","owner":{"login":"jelmer","id":49032,"avatar_url":"https://avatars.githubusercontent.com/u/49032?v=3","gravatar_id":"","url":"https://api.github.com/users/jelmer","html_url":"https://github.com/jelmer","followers_url":"https://api.github.com/users/jelmer/followers","following_url":"https://api.github.com/users/jelmer/following{/other_user}","gists_url":"https://api.github.com/users/jelmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jelmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelmer/subscriptions","organizations_url":"https://api.github.com/users/jelmer/orgs","repos_url":"https://api.github.com/users/jelmer/repos","events_url":"https://api.github.com/users/jelmer/events{/privacy}","received_events_url":"https://api.github.com/users/jelmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jelmer/dulwich","description":"Pure-Python Git implementation","fork":false,"url":"https://api.github.com/repos/jelmer/dulwich","forks_url":"https://api.github.com/repos/jelmer/dulwich/forks","keys_url":"https://api.github.com/repos/jelmer/dulwich/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jelmer/dulwich/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jelmer/dulwich/teams","hooks_url":"https://api.github.com/repos/jelmer/dulwich/hooks","issue_events_url":"https://api.github.com/repos/jelmer/dulwich/issues/events{/number}","events_url":"https://api.github.com/repos/jelmer/dulwich/events","assignees_url":"https://api.github.com/repos/jelmer/dulwich/assignees{/user}","branches_url":"https://api.github.com/repos/jelmer/dulwich/branches{/branch}","tags_url":"https://api.github.com/repos/jelmer/dulwich/tags","blobs_url":"https://api.github.com/repos/jelmer/dulwich/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jelmer/dulwich/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jelmer/dulwich/git/refs{/sha}","trees_url":"https://api.github.com/repos/jelmer/dulwich/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jelmer/dulwich/statuses/{sha}","languages_url":"https://api.github.com/repos/jelmer/dulwich/languages","stargazers_url":"https://api.github.com/repos/jelmer/dulwich/stargazers","contributors_url":"https://api.github.com/repos/jelmer/dulwich/contributors","subscribers_url":"https://api.github.com/repos/jelmer/dulwich/subscribers","subscription_url":"https://api.github.com/repos/jelmer/dulwich/subscription","commits_url":"https://api.github.com/repos/jelmer/dulwich/commits{/sha}","git_commits_url":"https://api.github.com/repos/jelmer/dulwich/git/commits{/sha}","comments_url":"https://api.github.com/repos/jelmer/dulwich/comments{/number}","issue_comment_url":"https://api.github.com/repos/jelmer/dulwich/issues/comments{/number}","contents_url":"https://api.github.com/repos/jelmer/dulwich/contents/{+path}","compare_url":"https://api.github.com/repos/jelmer/dulwich/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jelmer/dulwich/merges","archive_url":"https://api.github.com/repos/jelmer/dulwich/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jelmer/dulwich/downloads","issues_url":"https://api.github.com/repos/jelmer/dulwich/issues{/number}","pulls_url":"https://api.github.com/repos/jelmer/dulwich/pulls{/number}","milestones_url":"https://api.github.com/repos/jelmer/dulwich/milestones{/number}","notifications_url":"https://api.github.com/repos/jelmer/dulwich/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jelmer/dulwich/labels{/name}","releases_url":"https://api.github.com/repos/jelmer/dulwich/releases{/id}","created_at":"2009-03-22T05:09:18Z","updated_at":"2015-10-28T08:16:46Z","pushed_at":"2015-11-01T16:09:34Z","git_url":"git://github.com/jelmer/dulwich.git","ssh_url":"git@github.com:jelmer/dulwich.git","clone_url":"https://github.com/jelmer/dulwich.git","svn_url":"https://github.com/jelmer/dulwich","homepage":"https://www.dulwich.io/","size":16781,"stargazers_count":825,"watchers_count":825,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":185,"mirror_url":null,"open_issues_count":26,"forks":185,"open_issues":26,"watchers":825,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jelmer/dulwich/pulls/388"},"html":{"href":"https://github.com/jelmer/dulwich/pull/388"},"issue":{"href":"https://api.github.com/repos/jelmer/dulwich/issues/388"},"comments":{"href":"https://api.github.com/repos/jelmer/dulwich/issues/388/comments"},"review_comments":{"href":"https://api.github.com/repos/jelmer/dulwich/pulls/388/comments"},"review_comment":{"href":"https://api.github.com/repos/jelmer/dulwich/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jelmer/dulwich/pulls/388/commits"},"statuses":{"href":"https://api.github.com/repos/jelmer/dulwich/statuses/2a355bcaedc132b95544cb345c39e8c1c89f52c7"}}}}