{"action":"created","comment":{"url":"https://api.github.com/repos/pazz/alot/pulls/comments/92516649","pull_request_review_id":13033716,"id":92516649,"diff_hunk":"@@ -733,7 +733,8 @@ def apply(self, ui):\n                           priority='error')\n                 return\n             try:\n-                self.envelope.parse_template(open(path).read())\n+                with open(path) as f:\n+                    self.envelope.parse_template(f.read())","path":"alot/commands/globals.py","position":6,"original_position":6,"commit_id":"8be904b96144e71458851d6e156dd4bae4398aa3","original_commit_id":"9ff7fac2274869c4575cba04887146a10b234222","user":{"login":"lucc","id":1104419,"avatar_url":"https://avatars.githubusercontent.com/u/1104419?v=3","gravatar_id":"","url":"https://api.github.com/users/lucc","html_url":"https://github.com/lucc","followers_url":"https://api.github.com/users/lucc/followers","following_url":"https://api.github.com/users/lucc/following{/other_user}","gists_url":"https://api.github.com/users/lucc/gists{/gist_id}","starred_url":"https://api.github.com/users/lucc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucc/subscriptions","organizations_url":"https://api.github.com/users/lucc/orgs","repos_url":"https://api.github.com/users/lucc/repos","events_url":"https://api.github.com/users/lucc/events{/privacy}","received_events_url":"https://api.github.com/users/lucc/received_events","type":"User","site_admin":false},"body":"Thanks, in the meanwhile I also read both commit messages.\r\n\r\nNow I am all for it!","created_at":"2016-12-14T23:46:11Z","updated_at":"2016-12-14T23:46:11Z","html_url":"https://github.com/pazz/alot/pull/922#discussion_r92516649","pull_request_url":"https://api.github.com/repos/pazz/alot/pulls/922","_links":{"self":{"href":"https://api.github.com/repos/pazz/alot/pulls/comments/92516649"},"html":{"href":"https://github.com/pazz/alot/pull/922#discussion_r92516649"},"pull_request":{"href":"https://api.github.com/repos/pazz/alot/pulls/922"}}},"pull_request":{"url":"https://api.github.com/repos/pazz/alot/pulls/922","id":98029210,"html_url":"https://github.com/pazz/alot/pull/922","diff_url":"https://github.com/pazz/alot/pull/922.diff","patch_url":"https://github.com/pazz/alot/pull/922.patch","issue_url":"https://api.github.com/repos/pazz/alot/issues/922","number":922,"state":"open","locked":false,"title":"Use open() as a context manager","user":{"login":"dcbaker","id":1779595,"avatar_url":"https://avatars.githubusercontent.com/u/1779595?v=3","gravatar_id":"","url":"https://api.github.com/users/dcbaker","html_url":"https://github.com/dcbaker","followers_url":"https://api.github.com/users/dcbaker/followers","following_url":"https://api.github.com/users/dcbaker/following{/other_user}","gists_url":"https://api.github.com/users/dcbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/dcbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcbaker/subscriptions","organizations_url":"https://api.github.com/users/dcbaker/orgs","repos_url":"https://api.github.com/users/dcbaker/repos","events_url":"https://api.github.com/users/dcbaker/events{/privacy}","received_events_url":"https://api.github.com/users/dcbaker/received_events","type":"User","site_admin":false},"body":"This little series replaces most uses of open() that are not as a context manager (using the `with` statement) with context manager uses. Using open as a context manager has a number of advantages, it makes visual inspection of correctness easier, it ensures that the file is closed and the fd is released (even if an exception is closed which would otherwise require a try/finally construct), and it uses one line less code than `f = open(...); f.write(...); f.close()`.","created_at":"2016-12-14T20:27:22Z","updated_at":"2016-12-14T23:46:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec5eb463ca9e54af38fc26b72d94fef42b8908ea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pazz/alot/pulls/922/commits","review_comments_url":"https://api.github.com/repos/pazz/alot/pulls/922/comments","review_comment_url":"https://api.github.com/repos/pazz/alot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pazz/alot/issues/922/comments","statuses_url":"https://api.github.com/repos/pazz/alot/statuses/8be904b96144e71458851d6e156dd4bae4398aa3","head":{"label":"dcbaker:pr/open-context-manager","ref":"pr/open-context-manager","sha":"8be904b96144e71458851d6e156dd4bae4398aa3","user":{"login":"dcbaker","id":1779595,"avatar_url":"https://avatars.githubusercontent.com/u/1779595?v=3","gravatar_id":"","url":"https://api.github.com/users/dcbaker","html_url":"https://github.com/dcbaker","followers_url":"https://api.github.com/users/dcbaker/followers","following_url":"https://api.github.com/users/dcbaker/following{/other_user}","gists_url":"https://api.github.com/users/dcbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/dcbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcbaker/subscriptions","organizations_url":"https://api.github.com/users/dcbaker/orgs","repos_url":"https://api.github.com/users/dcbaker/repos","events_url":"https://api.github.com/users/dcbaker/events{/privacy}","received_events_url":"https://api.github.com/users/dcbaker/received_events","type":"User","site_admin":false},"repo":{"id":63985175,"name":"alot","full_name":"dcbaker/alot","owner":{"login":"dcbaker","id":1779595,"avatar_url":"https://avatars.githubusercontent.com/u/1779595?v=3","gravatar_id":"","url":"https://api.github.com/users/dcbaker","html_url":"https://github.com/dcbaker","followers_url":"https://api.github.com/users/dcbaker/followers","following_url":"https://api.github.com/users/dcbaker/following{/other_user}","gists_url":"https://api.github.com/users/dcbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/dcbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcbaker/subscriptions","organizations_url":"https://api.github.com/users/dcbaker/orgs","repos_url":"https://api.github.com/users/dcbaker/repos","events_url":"https://api.github.com/users/dcbaker/events{/privacy}","received_events_url":"https://api.github.com/users/dcbaker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcbaker/alot","description":"commandline MUA using notmuch and urwid","fork":true,"url":"https://api.github.com/repos/dcbaker/alot","forks_url":"https://api.github.com/repos/dcbaker/alot/forks","keys_url":"https://api.github.com/repos/dcbaker/alot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcbaker/alot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcbaker/alot/teams","hooks_url":"https://api.github.com/repos/dcbaker/alot/hooks","issue_events_url":"https://api.github.com/repos/dcbaker/alot/issues/events{/number}","events_url":"https://api.github.com/repos/dcbaker/alot/events","assignees_url":"https://api.github.com/repos/dcbaker/alot/assignees{/user}","branches_url":"https://api.github.com/repos/dcbaker/alot/branches{/branch}","tags_url":"https://api.github.com/repos/dcbaker/alot/tags","blobs_url":"https://api.github.com/repos/dcbaker/alot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcbaker/alot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcbaker/alot/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcbaker/alot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcbaker/alot/statuses/{sha}","languages_url":"https://api.github.com/repos/dcbaker/alot/languages","stargazers_url":"https://api.github.com/repos/dcbaker/alot/stargazers","contributors_url":"https://api.github.com/repos/dcbaker/alot/contributors","subscribers_url":"https://api.github.com/repos/dcbaker/alot/subscribers","subscription_url":"https://api.github.com/repos/dcbaker/alot/subscription","commits_url":"https://api.github.com/repos/dcbaker/alot/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcbaker/alot/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcbaker/alot/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcbaker/alot/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcbaker/alot/contents/{+path}","compare_url":"https://api.github.com/repos/dcbaker/alot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcbaker/alot/merges","archive_url":"https://api.github.com/repos/dcbaker/alot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcbaker/alot/downloads","issues_url":"https://api.github.com/repos/dcbaker/alot/issues{/number}","pulls_url":"https://api.github.com/repos/dcbaker/alot/pulls{/number}","milestones_url":"https://api.github.com/repos/dcbaker/alot/milestones{/number}","notifications_url":"https://api.github.com/repos/dcbaker/alot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcbaker/alot/labels{/name}","releases_url":"https://api.github.com/repos/dcbaker/alot/releases{/id}","deployments_url":"https://api.github.com/repos/dcbaker/alot/deployments","created_at":"2016-07-22T21:44:35Z","updated_at":"2016-07-22T21:44:36Z","pushed_at":"2016-12-14T23:43:47Z","git_url":"git://github.com/dcbaker/alot.git","ssh_url":"git@github.com:dcbaker/alot.git","clone_url":"https://github.com/dcbaker/alot.git","svn_url":"https://github.com/dcbaker/alot","homepage":"","size":6773,"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":"pazz:master","ref":"master","sha":"fdb2d7103877185b6865e872cb06e7bdd237f9dc","user":{"login":"pazz","id":628455,"avatar_url":"https://avatars.githubusercontent.com/u/628455?v=3","gravatar_id":"","url":"https://api.github.com/users/pazz","html_url":"https://github.com/pazz","followers_url":"https://api.github.com/users/pazz/followers","following_url":"https://api.github.com/users/pazz/following{/other_user}","gists_url":"https://api.github.com/users/pazz/gists{/gist_id}","starred_url":"https://api.github.com/users/pazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pazz/subscriptions","organizations_url":"https://api.github.com/users/pazz/orgs","repos_url":"https://api.github.com/users/pazz/repos","events_url":"https://api.github.com/users/pazz/events{/privacy}","received_events_url":"https://api.github.com/users/pazz/received_events","type":"User","site_admin":false},"repo":{"id":2197977,"name":"alot","full_name":"pazz/alot","owner":{"login":"pazz","id":628455,"avatar_url":"https://avatars.githubusercontent.com/u/628455?v=3","gravatar_id":"","url":"https://api.github.com/users/pazz","html_url":"https://github.com/pazz","followers_url":"https://api.github.com/users/pazz/followers","following_url":"https://api.github.com/users/pazz/following{/other_user}","gists_url":"https://api.github.com/users/pazz/gists{/gist_id}","starred_url":"https://api.github.com/users/pazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pazz/subscriptions","organizations_url":"https://api.github.com/users/pazz/orgs","repos_url":"https://api.github.com/users/pazz/repos","events_url":"https://api.github.com/users/pazz/events{/privacy}","received_events_url":"https://api.github.com/users/pazz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pazz/alot","description":"commandline MUA using notmuch and urwid","fork":false,"url":"https://api.github.com/repos/pazz/alot","forks_url":"https://api.github.com/repos/pazz/alot/forks","keys_url":"https://api.github.com/repos/pazz/alot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pazz/alot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pazz/alot/teams","hooks_url":"https://api.github.com/repos/pazz/alot/hooks","issue_events_url":"https://api.github.com/repos/pazz/alot/issues/events{/number}","events_url":"https://api.github.com/repos/pazz/alot/events","assignees_url":"https://api.github.com/repos/pazz/alot/assignees{/user}","branches_url":"https://api.github.com/repos/pazz/alot/branches{/branch}","tags_url":"https://api.github.com/repos/pazz/alot/tags","blobs_url":"https://api.github.com/repos/pazz/alot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pazz/alot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pazz/alot/git/refs{/sha}","trees_url":"https://api.github.com/repos/pazz/alot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pazz/alot/statuses/{sha}","languages_url":"https://api.github.com/repos/pazz/alot/languages","stargazers_url":"https://api.github.com/repos/pazz/alot/stargazers","contributors_url":"https://api.github.com/repos/pazz/alot/contributors","subscribers_url":"https://api.github.com/repos/pazz/alot/subscribers","subscription_url":"https://api.github.com/repos/pazz/alot/subscription","commits_url":"https://api.github.com/repos/pazz/alot/commits{/sha}","git_commits_url":"https://api.github.com/repos/pazz/alot/git/commits{/sha}","comments_url":"https://api.github.com/repos/pazz/alot/comments{/number}","issue_comment_url":"https://api.github.com/repos/pazz/alot/issues/comments{/number}","contents_url":"https://api.github.com/repos/pazz/alot/contents/{+path}","compare_url":"https://api.github.com/repos/pazz/alot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pazz/alot/merges","archive_url":"https://api.github.com/repos/pazz/alot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pazz/alot/downloads","issues_url":"https://api.github.com/repos/pazz/alot/issues{/number}","pulls_url":"https://api.github.com/repos/pazz/alot/pulls{/number}","milestones_url":"https://api.github.com/repos/pazz/alot/milestones{/number}","notifications_url":"https://api.github.com/repos/pazz/alot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pazz/alot/labels{/name}","releases_url":"https://api.github.com/repos/pazz/alot/releases{/id}","deployments_url":"https://api.github.com/repos/pazz/alot/deployments","created_at":"2011-08-12T16:22:37Z","updated_at":"2016-12-14T15:17:27Z","pushed_at":"2016-12-14T23:43:47Z","git_url":"git://github.com/pazz/alot.git","ssh_url":"git@github.com:pazz/alot.git","clone_url":"https://github.com/pazz/alot.git","svn_url":"https://github.com/pazz/alot","homepage":"","size":6769,"stargazers_count":299,"watchers_count":299,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"open_issues_count":185,"forks":85,"open_issues":185,"watchers":299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pazz/alot/pulls/922"},"html":{"href":"https://github.com/pazz/alot/pull/922"},"issue":{"href":"https://api.github.com/repos/pazz/alot/issues/922"},"comments":{"href":"https://api.github.com/repos/pazz/alot/issues/922/comments"},"review_comments":{"href":"https://api.github.com/repos/pazz/alot/pulls/922/comments"},"review_comment":{"href":"https://api.github.com/repos/pazz/alot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pazz/alot/pulls/922/commits"},"statuses":{"href":"https://api.github.com/repos/pazz/alot/statuses/8be904b96144e71458851d6e156dd4bae4398aa3"}}}}
{"actor":{"display_login":"lucc"}}