{"action":"created","comment":{"url":"https://api.github.com/repos/davisp/ghp-import/pulls/comments/60632160","id":60632160,"diff_hunk":"@@ -74,7 +74,8 @@ def try_rebase(remote, branch):\n     (rev, ignore) = p.communicate()\n     if p.wait() != 0:\n         return True\n-    cmd = ['git', 'update-ref', 'refs/heads/%s' % branch, rev.strip()]\n+    rev = rev.strip().decode('ascii')","path":"ghp_import.py","position":5,"original_position":5,"commit_id":"f8667aa5e01179c8ec06d32d76625be87c9814c0","original_commit_id":"f8667aa5e01179c8ec06d32d76625be87c9814c0","user":{"login":"waylan","id":78846,"avatar_url":"https://avatars.githubusercontent.com/u/78846?v=3","gravatar_id":"","url":"https://api.github.com/users/waylan","html_url":"https://github.com/waylan","followers_url":"https://api.github.com/users/waylan/followers","following_url":"https://api.github.com/users/waylan/following{/other_user}","gists_url":"https://api.github.com/users/waylan/gists{/gist_id}","starred_url":"https://api.github.com/users/waylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waylan/subscriptions","organizations_url":"https://api.github.com/users/waylan/orgs","repos_url":"https://api.github.com/users/waylan/repos","events_url":"https://api.github.com/users/waylan/events{/privacy}","received_events_url":"https://api.github.com/users/waylan/received_events","type":"User","site_admin":false},"body":"Any reason why you didn't just call `dec(rev.strip())` with the `dec` function defined earlier? That works for me. L77 should just be:\r\n\r\n```python\r\ncmd = ['git', 'update-ref', 'refs/heads/%s' % branch, dec(rev.strip())]\r\n```","created_at":"2016-04-21T18:29:55Z","updated_at":"2016-04-21T18:29:55Z","html_url":"https://github.com/davisp/ghp-import/pull/52#discussion_r60632160","pull_request_url":"https://api.github.com/repos/davisp/ghp-import/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/davisp/ghp-import/pulls/comments/60632160"},"html":{"href":"https://github.com/davisp/ghp-import/pull/52#discussion_r60632160"},"pull_request":{"href":"https://api.github.com/repos/davisp/ghp-import/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/davisp/ghp-import/pulls/52","id":62006381,"html_url":"https://github.com/davisp/ghp-import/pull/52","diff_url":"https://github.com/davisp/ghp-import/pull/52.diff","patch_url":"https://github.com/davisp/ghp-import/pull/52.patch","issue_url":"https://api.github.com/repos/davisp/ghp-import/issues/52","number":52,"state":"open","locked":false,"title":"BF: convert revision to str for call","user":{"login":"matthew-brett","id":67612,"avatar_url":"https://avatars.githubusercontent.com/u/67612?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-brett","html_url":"https://github.com/matthew-brett","followers_url":"https://api.github.com/users/matthew-brett/followers","following_url":"https://api.github.com/users/matthew-brett/following{/other_user}","gists_url":"https://api.github.com/users/matthew-brett/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-brett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-brett/subscriptions","organizations_url":"https://api.github.com/users/matthew-brett/orgs","repos_url":"https://api.github.com/users/matthew-brett/repos","events_url":"https://api.github.com/users/matthew-brett/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-brett/received_events","type":"User","site_admin":false},"body":"Avoid error converting str / bytes in subprocess.call\n\nWithout this change, on Windows and Python 3.5, I get this from `ghp-import\n_build/html`:\n\n(py35) C:\\repos\\la-eeg-uci [master]> ghp-import.exe .\\_build\\html\nTraceback (most recent call last):\n    File \"C:\\tmp\\py35\\Scripts\\ghp-import-script.py\", line 9, in <module>\n        load_entry_point('ghp-import==0.4.2', 'console_scripts', 'ghp-import')()\n    File \"c:\\repos\\ghp-import\\ghp_import.py\", line 194, in main\n        if not try_rebase(opts.remote, opts.branch):\n    File \"c:\\repos\\ghp-import\\ghp_import.py\", line 78, in try_rebase\n        if sp.call(cmd) != 0:\n    File \"C:\\Python35\\lib\\subprocess.py\", line 560, in call\n        with Popen(*popenargs, **kwargs) as p:\n    File \"C:\\Python35\\lib\\subprocess.py\", line 950, in __init__\n        restore_signals, start_new_session)\n    File \"C:\\Python35\\lib\\subprocess.py\", line 1194, in _execute_child\n        args = list2cmdline(args)\n    File \"C:\\Python35\\lib\\subprocess.py\", line 754, in list2cmdline\n        needquote = (\" \" in arg) or (\"\\t\" in arg) or not arg\nTypeError: a bytes-like object is required, not 'str'","created_at":"2016-03-08T00:40:04Z","updated_at":"2016-04-21T18:29:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfd5f115f7fa8896b44b4978b9b09f318352b4f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/davisp/ghp-import/pulls/52/commits","review_comments_url":"https://api.github.com/repos/davisp/ghp-import/pulls/52/comments","review_comment_url":"https://api.github.com/repos/davisp/ghp-import/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davisp/ghp-import/issues/52/comments","statuses_url":"https://api.github.com/repos/davisp/ghp-import/statuses/f8667aa5e01179c8ec06d32d76625be87c9814c0","head":{"label":"matthew-brett:win-py3-fix","ref":"win-py3-fix","sha":"f8667aa5e01179c8ec06d32d76625be87c9814c0","user":{"login":"matthew-brett","id":67612,"avatar_url":"https://avatars.githubusercontent.com/u/67612?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-brett","html_url":"https://github.com/matthew-brett","followers_url":"https://api.github.com/users/matthew-brett/followers","following_url":"https://api.github.com/users/matthew-brett/following{/other_user}","gists_url":"https://api.github.com/users/matthew-brett/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-brett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-brett/subscriptions","organizations_url":"https://api.github.com/users/matthew-brett/orgs","repos_url":"https://api.github.com/users/matthew-brett/repos","events_url":"https://api.github.com/users/matthew-brett/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-brett/received_events","type":"User","site_admin":false},"repo":{"id":53368736,"name":"ghp-import","full_name":"matthew-brett/ghp-import","owner":{"login":"matthew-brett","id":67612,"avatar_url":"https://avatars.githubusercontent.com/u/67612?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-brett","html_url":"https://github.com/matthew-brett","followers_url":"https://api.github.com/users/matthew-brett/followers","following_url":"https://api.github.com/users/matthew-brett/following{/other_user}","gists_url":"https://api.github.com/users/matthew-brett/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-brett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-brett/subscriptions","organizations_url":"https://api.github.com/users/matthew-brett/orgs","repos_url":"https://api.github.com/users/matthew-brett/repos","events_url":"https://api.github.com/users/matthew-brett/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-brett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthew-brett/ghp-import","description":"Easily import docs to your gh-pages branch.","fork":true,"url":"https://api.github.com/repos/matthew-brett/ghp-import","forks_url":"https://api.github.com/repos/matthew-brett/ghp-import/forks","keys_url":"https://api.github.com/repos/matthew-brett/ghp-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthew-brett/ghp-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthew-brett/ghp-import/teams","hooks_url":"https://api.github.com/repos/matthew-brett/ghp-import/hooks","issue_events_url":"https://api.github.com/repos/matthew-brett/ghp-import/issues/events{/number}","events_url":"https://api.github.com/repos/matthew-brett/ghp-import/events","assignees_url":"https://api.github.com/repos/matthew-brett/ghp-import/assignees{/user}","branches_url":"https://api.github.com/repos/matthew-brett/ghp-import/branches{/branch}","tags_url":"https://api.github.com/repos/matthew-brett/ghp-import/tags","blobs_url":"https://api.github.com/repos/matthew-brett/ghp-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthew-brett/ghp-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthew-brett/ghp-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthew-brett/ghp-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthew-brett/ghp-import/statuses/{sha}","languages_url":"https://api.github.com/repos/matthew-brett/ghp-import/languages","stargazers_url":"https://api.github.com/repos/matthew-brett/ghp-import/stargazers","contributors_url":"https://api.github.com/repos/matthew-brett/ghp-import/contributors","subscribers_url":"https://api.github.com/repos/matthew-brett/ghp-import/subscribers","subscription_url":"https://api.github.com/repos/matthew-brett/ghp-import/subscription","commits_url":"https://api.github.com/repos/matthew-brett/ghp-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthew-brett/ghp-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthew-brett/ghp-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthew-brett/ghp-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthew-brett/ghp-import/contents/{+path}","compare_url":"https://api.github.com/repos/matthew-brett/ghp-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthew-brett/ghp-import/merges","archive_url":"https://api.github.com/repos/matthew-brett/ghp-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthew-brett/ghp-import/downloads","issues_url":"https://api.github.com/repos/matthew-brett/ghp-import/issues{/number}","pulls_url":"https://api.github.com/repos/matthew-brett/ghp-import/pulls{/number}","milestones_url":"https://api.github.com/repos/matthew-brett/ghp-import/milestones{/number}","notifications_url":"https://api.github.com/repos/matthew-brett/ghp-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthew-brett/ghp-import/labels{/name}","releases_url":"https://api.github.com/repos/matthew-brett/ghp-import/releases{/id}","deployments_url":"https://api.github.com/repos/matthew-brett/ghp-import/deployments","created_at":"2016-03-08T00:13:53Z","updated_at":"2016-03-08T00:13:54Z","pushed_at":"2016-03-08T00:35:20Z","git_url":"git://github.com/matthew-brett/ghp-import.git","ssh_url":"git@github.com:matthew-brett/ghp-import.git","clone_url":"https://github.com/matthew-brett/ghp-import.git","svn_url":"https://github.com/matthew-brett/ghp-import","homepage":"http://github.com/davisp/ghp-import","size":67,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"davisp:master","ref":"master","sha":"ef30cbf83a9f3b4dfc42d97237816c7761226cf4","user":{"login":"davisp","id":19929,"avatar_url":"https://avatars.githubusercontent.com/u/19929?v=3","gravatar_id":"","url":"https://api.github.com/users/davisp","html_url":"https://github.com/davisp","followers_url":"https://api.github.com/users/davisp/followers","following_url":"https://api.github.com/users/davisp/following{/other_user}","gists_url":"https://api.github.com/users/davisp/gists{/gist_id}","starred_url":"https://api.github.com/users/davisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisp/subscriptions","organizations_url":"https://api.github.com/users/davisp/orgs","repos_url":"https://api.github.com/users/davisp/repos","events_url":"https://api.github.com/users/davisp/events{/privacy}","received_events_url":"https://api.github.com/users/davisp/received_events","type":"User","site_admin":false},"repo":{"id":526434,"name":"ghp-import","full_name":"davisp/ghp-import","owner":{"login":"davisp","id":19929,"avatar_url":"https://avatars.githubusercontent.com/u/19929?v=3","gravatar_id":"","url":"https://api.github.com/users/davisp","html_url":"https://github.com/davisp","followers_url":"https://api.github.com/users/davisp/followers","following_url":"https://api.github.com/users/davisp/following{/other_user}","gists_url":"https://api.github.com/users/davisp/gists{/gist_id}","starred_url":"https://api.github.com/users/davisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisp/subscriptions","organizations_url":"https://api.github.com/users/davisp/orgs","repos_url":"https://api.github.com/users/davisp/repos","events_url":"https://api.github.com/users/davisp/events{/privacy}","received_events_url":"https://api.github.com/users/davisp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davisp/ghp-import","description":"Easily import docs to your gh-pages branch.","fork":false,"url":"https://api.github.com/repos/davisp/ghp-import","forks_url":"https://api.github.com/repos/davisp/ghp-import/forks","keys_url":"https://api.github.com/repos/davisp/ghp-import/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davisp/ghp-import/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davisp/ghp-import/teams","hooks_url":"https://api.github.com/repos/davisp/ghp-import/hooks","issue_events_url":"https://api.github.com/repos/davisp/ghp-import/issues/events{/number}","events_url":"https://api.github.com/repos/davisp/ghp-import/events","assignees_url":"https://api.github.com/repos/davisp/ghp-import/assignees{/user}","branches_url":"https://api.github.com/repos/davisp/ghp-import/branches{/branch}","tags_url":"https://api.github.com/repos/davisp/ghp-import/tags","blobs_url":"https://api.github.com/repos/davisp/ghp-import/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davisp/ghp-import/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davisp/ghp-import/git/refs{/sha}","trees_url":"https://api.github.com/repos/davisp/ghp-import/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davisp/ghp-import/statuses/{sha}","languages_url":"https://api.github.com/repos/davisp/ghp-import/languages","stargazers_url":"https://api.github.com/repos/davisp/ghp-import/stargazers","contributors_url":"https://api.github.com/repos/davisp/ghp-import/contributors","subscribers_url":"https://api.github.com/repos/davisp/ghp-import/subscribers","subscription_url":"https://api.github.com/repos/davisp/ghp-import/subscription","commits_url":"https://api.github.com/repos/davisp/ghp-import/commits{/sha}","git_commits_url":"https://api.github.com/repos/davisp/ghp-import/git/commits{/sha}","comments_url":"https://api.github.com/repos/davisp/ghp-import/comments{/number}","issue_comment_url":"https://api.github.com/repos/davisp/ghp-import/issues/comments{/number}","contents_url":"https://api.github.com/repos/davisp/ghp-import/contents/{+path}","compare_url":"https://api.github.com/repos/davisp/ghp-import/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davisp/ghp-import/merges","archive_url":"https://api.github.com/repos/davisp/ghp-import/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davisp/ghp-import/downloads","issues_url":"https://api.github.com/repos/davisp/ghp-import/issues{/number}","pulls_url":"https://api.github.com/repos/davisp/ghp-import/pulls{/number}","milestones_url":"https://api.github.com/repos/davisp/ghp-import/milestones{/number}","notifications_url":"https://api.github.com/repos/davisp/ghp-import/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davisp/ghp-import/labels{/name}","releases_url":"https://api.github.com/repos/davisp/ghp-import/releases{/id}","deployments_url":"https://api.github.com/repos/davisp/ghp-import/deployments","created_at":"2010-02-19T19:00:22Z","updated_at":"2016-04-19T10:15:10Z","pushed_at":"2016-03-08T00:40:04Z","git_url":"git://github.com/davisp/ghp-import.git","ssh_url":"git@github.com:davisp/ghp-import.git","clone_url":"https://github.com/davisp/ghp-import.git","svn_url":"https://github.com/davisp/ghp-import","homepage":"http://github.com/davisp/ghp-import","size":89,"stargazers_count":288,"watchers_count":288,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":55,"mirror_url":null,"open_issues_count":22,"forks":55,"open_issues":22,"watchers":288,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davisp/ghp-import/pulls/52"},"html":{"href":"https://github.com/davisp/ghp-import/pull/52"},"issue":{"href":"https://api.github.com/repos/davisp/ghp-import/issues/52"},"comments":{"href":"https://api.github.com/repos/davisp/ghp-import/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/davisp/ghp-import/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/davisp/ghp-import/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davisp/ghp-import/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/davisp/ghp-import/statuses/f8667aa5e01179c8ec06d32d76625be87c9814c0"}}}}