{"action":"created","comment":{"url":"https://api.github.com/repos/benoitc/gunicorn/pulls/comments/34081231","id":34081231,"diff_hunk":"@@ -66,7 +66,10 @@ def validate(self):\n             return\n         try:\n             with open(self.fname, \"r\") as f:\n-                wpid = int(f.read() or 0)\n+                try:\n+                    wpid = int(f.read())\n+                except ValueError:\n+                    wpid = 0","path":"gunicorn/pidfile.py","position":8,"original_position":8,"commit_id":"80e93b9c556edda5629334a751fff2d903bd9bd6","original_commit_id":"80e93b9c556edda5629334a751fff2d903bd9bd6","user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"body":"If the zero case fails anyway (we return right after) and `int('')` is a `ValueError` just return in the `except` clause and remove the subsequent `if`.","created_at":"2015-07-07T19:40:42Z","updated_at":"2015-07-07T19:40:42Z","html_url":"https://github.com/benoitc/gunicorn/pull/1042#discussion_r34081231","pull_request_url":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042","_links":{"self":{"href":"https://api.github.com/repos/benoitc/gunicorn/pulls/comments/34081231"},"html":{"href":"https://github.com/benoitc/gunicorn/pull/1042#discussion_r34081231"},"pull_request":{"href":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042"}}},"pull_request":{"url":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042","id":36908098,"html_url":"https://github.com/benoitc/gunicorn/pull/1042","diff_url":"https://github.com/benoitc/gunicorn/pull/1042.diff","patch_url":"https://github.com/benoitc/gunicorn/pull/1042.patch","issue_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1042","number":1042,"state":"open","locked":false,"title":"Updated gunicorn/pidfile.py","user":{"login":"brijeshb42","id":717550,"avatar_url":"https://avatars.githubusercontent.com/u/717550?v=3","gravatar_id":"","url":"https://api.github.com/users/brijeshb42","html_url":"https://github.com/brijeshb42","followers_url":"https://api.github.com/users/brijeshb42/followers","following_url":"https://api.github.com/users/brijeshb42/following{/other_user}","gists_url":"https://api.github.com/users/brijeshb42/gists{/gist_id}","starred_url":"https://api.github.com/users/brijeshb42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brijeshb42/subscriptions","organizations_url":"https://api.github.com/users/brijeshb42/orgs","repos_url":"https://api.github.com/users/brijeshb42/repos","events_url":"https://api.github.com/users/brijeshb42/events{/privacy}","received_events_url":"https://api.github.com/users/brijeshb42/received_events","type":"User","site_admin":false},"body":"Added a try block to convert the contents of the `pidfile.py` if it can be converted to integer or not. If not, then `wpid` is assigned 0 and the `validate` function returns as usual. If the pidfile has a valid int, the function continues to kill the process as before.","created_at":"2015-06-04T07:18:37Z","updated_at":"2015-07-07T19:40:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9656075923389ef456dcf8eb9ac74b871bac6ead","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042/commits","review_comments_url":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042/comments","review_comment_url":"https://api.github.com/repos/benoitc/gunicorn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1042/comments","statuses_url":"https://api.github.com/repos/benoitc/gunicorn/statuses/80e93b9c556edda5629334a751fff2d903bd9bd6","head":{"label":"brijeshb42:master","ref":"master","sha":"80e93b9c556edda5629334a751fff2d903bd9bd6","user":{"login":"brijeshb42","id":717550,"avatar_url":"https://avatars.githubusercontent.com/u/717550?v=3","gravatar_id":"","url":"https://api.github.com/users/brijeshb42","html_url":"https://github.com/brijeshb42","followers_url":"https://api.github.com/users/brijeshb42/followers","following_url":"https://api.github.com/users/brijeshb42/following{/other_user}","gists_url":"https://api.github.com/users/brijeshb42/gists{/gist_id}","starred_url":"https://api.github.com/users/brijeshb42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brijeshb42/subscriptions","organizations_url":"https://api.github.com/users/brijeshb42/orgs","repos_url":"https://api.github.com/users/brijeshb42/repos","events_url":"https://api.github.com/users/brijeshb42/events{/privacy}","received_events_url":"https://api.github.com/users/brijeshb42/received_events","type":"User","site_admin":false},"repo":{"id":36854286,"name":"gunicorn","full_name":"brijeshb42/gunicorn","owner":{"login":"brijeshb42","id":717550,"avatar_url":"https://avatars.githubusercontent.com/u/717550?v=3","gravatar_id":"","url":"https://api.github.com/users/brijeshb42","html_url":"https://github.com/brijeshb42","followers_url":"https://api.github.com/users/brijeshb42/followers","following_url":"https://api.github.com/users/brijeshb42/following{/other_user}","gists_url":"https://api.github.com/users/brijeshb42/gists{/gist_id}","starred_url":"https://api.github.com/users/brijeshb42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brijeshb42/subscriptions","organizations_url":"https://api.github.com/users/brijeshb42/orgs","repos_url":"https://api.github.com/users/brijeshb42/repos","events_url":"https://api.github.com/users/brijeshb42/events{/privacy}","received_events_url":"https://api.github.com/users/brijeshb42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brijeshb42/gunicorn","description":"gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.","fork":true,"url":"https://api.github.com/repos/brijeshb42/gunicorn","forks_url":"https://api.github.com/repos/brijeshb42/gunicorn/forks","keys_url":"https://api.github.com/repos/brijeshb42/gunicorn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brijeshb42/gunicorn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brijeshb42/gunicorn/teams","hooks_url":"https://api.github.com/repos/brijeshb42/gunicorn/hooks","issue_events_url":"https://api.github.com/repos/brijeshb42/gunicorn/issues/events{/number}","events_url":"https://api.github.com/repos/brijeshb42/gunicorn/events","assignees_url":"https://api.github.com/repos/brijeshb42/gunicorn/assignees{/user}","branches_url":"https://api.github.com/repos/brijeshb42/gunicorn/branches{/branch}","tags_url":"https://api.github.com/repos/brijeshb42/gunicorn/tags","blobs_url":"https://api.github.com/repos/brijeshb42/gunicorn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brijeshb42/gunicorn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brijeshb42/gunicorn/git/refs{/sha}","trees_url":"https://api.github.com/repos/brijeshb42/gunicorn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brijeshb42/gunicorn/statuses/{sha}","languages_url":"https://api.github.com/repos/brijeshb42/gunicorn/languages","stargazers_url":"https://api.github.com/repos/brijeshb42/gunicorn/stargazers","contributors_url":"https://api.github.com/repos/brijeshb42/gunicorn/contributors","subscribers_url":"https://api.github.com/repos/brijeshb42/gunicorn/subscribers","subscription_url":"https://api.github.com/repos/brijeshb42/gunicorn/subscription","commits_url":"https://api.github.com/repos/brijeshb42/gunicorn/commits{/sha}","git_commits_url":"https://api.github.com/repos/brijeshb42/gunicorn/git/commits{/sha}","comments_url":"https://api.github.com/repos/brijeshb42/gunicorn/comments{/number}","issue_comment_url":"https://api.github.com/repos/brijeshb42/gunicorn/issues/comments{/number}","contents_url":"https://api.github.com/repos/brijeshb42/gunicorn/contents/{+path}","compare_url":"https://api.github.com/repos/brijeshb42/gunicorn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brijeshb42/gunicorn/merges","archive_url":"https://api.github.com/repos/brijeshb42/gunicorn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brijeshb42/gunicorn/downloads","issues_url":"https://api.github.com/repos/brijeshb42/gunicorn/issues{/number}","pulls_url":"https://api.github.com/repos/brijeshb42/gunicorn/pulls{/number}","milestones_url":"https://api.github.com/repos/brijeshb42/gunicorn/milestones{/number}","notifications_url":"https://api.github.com/repos/brijeshb42/gunicorn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brijeshb42/gunicorn/labels{/name}","releases_url":"https://api.github.com/repos/brijeshb42/gunicorn/releases{/id}","created_at":"2015-06-04T07:11:11Z","updated_at":"2015-06-04T07:11:13Z","pushed_at":"2015-06-04T07:18:03Z","git_url":"git://github.com/brijeshb42/gunicorn.git","ssh_url":"git@github.com:brijeshb42/gunicorn.git","clone_url":"https://github.com/brijeshb42/gunicorn.git","svn_url":"https://github.com/brijeshb42/gunicorn","homepage":"http://www.gunicorn.org","size":4554,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"benoitc:master","ref":"master","sha":"5a8b9555da873d418b282012c325a5bed42aa086","user":{"login":"benoitc","id":14498,"avatar_url":"https://avatars.githubusercontent.com/u/14498?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitc","html_url":"https://github.com/benoitc","followers_url":"https://api.github.com/users/benoitc/followers","following_url":"https://api.github.com/users/benoitc/following{/other_user}","gists_url":"https://api.github.com/users/benoitc/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitc/subscriptions","organizations_url":"https://api.github.com/users/benoitc/orgs","repos_url":"https://api.github.com/users/benoitc/repos","events_url":"https://api.github.com/users/benoitc/events{/privacy}","received_events_url":"https://api.github.com/users/benoitc/received_events","type":"User","site_admin":false},"repo":{"id":390510,"name":"gunicorn","full_name":"benoitc/gunicorn","owner":{"login":"benoitc","id":14498,"avatar_url":"https://avatars.githubusercontent.com/u/14498?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitc","html_url":"https://github.com/benoitc","followers_url":"https://api.github.com/users/benoitc/followers","following_url":"https://api.github.com/users/benoitc/following{/other_user}","gists_url":"https://api.github.com/users/benoitc/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitc/subscriptions","organizations_url":"https://api.github.com/users/benoitc/orgs","repos_url":"https://api.github.com/users/benoitc/repos","events_url":"https://api.github.com/users/benoitc/events{/privacy}","received_events_url":"https://api.github.com/users/benoitc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benoitc/gunicorn","description":"gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.","fork":false,"url":"https://api.github.com/repos/benoitc/gunicorn","forks_url":"https://api.github.com/repos/benoitc/gunicorn/forks","keys_url":"https://api.github.com/repos/benoitc/gunicorn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benoitc/gunicorn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benoitc/gunicorn/teams","hooks_url":"https://api.github.com/repos/benoitc/gunicorn/hooks","issue_events_url":"https://api.github.com/repos/benoitc/gunicorn/issues/events{/number}","events_url":"https://api.github.com/repos/benoitc/gunicorn/events","assignees_url":"https://api.github.com/repos/benoitc/gunicorn/assignees{/user}","branches_url":"https://api.github.com/repos/benoitc/gunicorn/branches{/branch}","tags_url":"https://api.github.com/repos/benoitc/gunicorn/tags","blobs_url":"https://api.github.com/repos/benoitc/gunicorn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benoitc/gunicorn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benoitc/gunicorn/git/refs{/sha}","trees_url":"https://api.github.com/repos/benoitc/gunicorn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benoitc/gunicorn/statuses/{sha}","languages_url":"https://api.github.com/repos/benoitc/gunicorn/languages","stargazers_url":"https://api.github.com/repos/benoitc/gunicorn/stargazers","contributors_url":"https://api.github.com/repos/benoitc/gunicorn/contributors","subscribers_url":"https://api.github.com/repos/benoitc/gunicorn/subscribers","subscription_url":"https://api.github.com/repos/benoitc/gunicorn/subscription","commits_url":"https://api.github.com/repos/benoitc/gunicorn/commits{/sha}","git_commits_url":"https://api.github.com/repos/benoitc/gunicorn/git/commits{/sha}","comments_url":"https://api.github.com/repos/benoitc/gunicorn/comments{/number}","issue_comment_url":"https://api.github.com/repos/benoitc/gunicorn/issues/comments{/number}","contents_url":"https://api.github.com/repos/benoitc/gunicorn/contents/{+path}","compare_url":"https://api.github.com/repos/benoitc/gunicorn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benoitc/gunicorn/merges","archive_url":"https://api.github.com/repos/benoitc/gunicorn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benoitc/gunicorn/downloads","issues_url":"https://api.github.com/repos/benoitc/gunicorn/issues{/number}","pulls_url":"https://api.github.com/repos/benoitc/gunicorn/pulls{/number}","milestones_url":"https://api.github.com/repos/benoitc/gunicorn/milestones{/number}","notifications_url":"https://api.github.com/repos/benoitc/gunicorn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benoitc/gunicorn/labels{/name}","releases_url":"https://api.github.com/repos/benoitc/gunicorn/releases{/id}","created_at":"2009-11-30T18:18:08Z","updated_at":"2015-07-07T00:46:02Z","pushed_at":"2015-07-07T19:36:54Z","git_url":"git://github.com/benoitc/gunicorn.git","ssh_url":"git@github.com:benoitc/gunicorn.git","clone_url":"https://github.com/benoitc/gunicorn.git","svn_url":"https://github.com/benoitc/gunicorn","homepage":"http://www.gunicorn.org","size":10132,"stargazers_count":2430,"watchers_count":2430,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":496,"mirror_url":null,"open_issues_count":80,"forks":496,"open_issues":80,"watchers":2430,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042"},"html":{"href":"https://github.com/benoitc/gunicorn/pull/1042"},"issue":{"href":"https://api.github.com/repos/benoitc/gunicorn/issues/1042"},"comments":{"href":"https://api.github.com/repos/benoitc/gunicorn/issues/1042/comments"},"review_comments":{"href":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042/comments"},"review_comment":{"href":"https://api.github.com/repos/benoitc/gunicorn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/benoitc/gunicorn/pulls/1042/commits"},"statuses":{"href":"https://api.github.com/repos/benoitc/gunicorn/statuses/80e93b9c556edda5629334a751fff2d903bd9bd6"}}}}