{"action":"created","comment":{"url":"https://api.github.com/repos/python-security/pyt/pulls/comments/181201726","pull_request_review_id":111767636,"id":181201726,"diff_hunk":"@@ -300,9 +308,19 @@ def main(command_line_args=sys.argv[1:]):\n         )\n     )\n     if args.json:\n-        json.report(vulnerabilities, sys.stdout)\n+        if args.baseline:","path":"pyt/__main__.py","position":41,"original_position":41,"commit_id":"e8bbf3f53f9c3965b96a3dd5be18a3b72e701a35","original_commit_id":"217eb0f6603fae611a6035f48ec33b64049c0749","user":{"login":"omergunal","id":19760132,"avatar_url":"https://avatars3.githubusercontent.com/u/19760132?v=4","gravatar_id":"","url":"https://api.github.com/users/omergunal","html_url":"https://github.com/omergunal","followers_url":"https://api.github.com/users/omergunal/followers","following_url":"https://api.github.com/users/omergunal/following{/other_user}","gists_url":"https://api.github.com/users/omergunal/gists{/gist_id}","starred_url":"https://api.github.com/users/omergunal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omergunal/subscriptions","organizations_url":"https://api.github.com/users/omergunal/orgs","repos_url":"https://api.github.com/users/omergunal/repos","events_url":"https://api.github.com/users/omergunal/events{/privacy}","received_events_url":"https://api.github.com/users/omergunal/received_events","type":"User","site_admin":false},"body":"Can the baseline file be normal text?  Like that:\r\n```\r\n2 vulnerabilities found:\r\nVulnerability 1:\r\nFile: /home/gunal/kelime_kok_ayirici/app.py\r\n > User input at line 98, trigger word \"form[\":\r\n\t _ID = request.form['_id']\r\nReassigned in:\r\n\tFile: /home/gunal/kelime_kok_ayirici/app.py\r\n\t > Line 64: save_1__ID = _ID\r\n\tFile: /home/gunal/kelime_kok_ayirici/app.py\r\n\t > Line 104: temp_1__ID = _ID\r\n\tFile: /home/gunal/kelime_kok_ayirici/db.py\r\n\t > Line 64: _ID = temp_1__ID\r\n\tFile: /home/gunal/kelime_kok_ayirici/app.py\r\n\t > Line 64: _ID = _ID\r\nFile: /home/gunal/kelime_kok_ayirici/db.py\r\n > reaches line 80, trigger word \"execute(\":\r\n\t~call_4 = ret_cursor.execute(sql, (int(_IsTrue), str(_UserSuggestion), datetime.datetime.now(), int(_ID)))\r\n\r\nVulnerability 2:\r\nFile: /home/gunal/kelime_kok_ayirici/app.py\r\n > User input at line 99, trigger word \"form[\":\r\n\t _IsTrue = request.form['_isTrue']\r\nReassigned in:\r\n\tFile: /home/gunal/kelime_kok_ayirici/app.py\r\n\t > Line 64: save_1__IsTrue = _IsTrue\r\n\tFile: /home/gunal/kelime_kok_ayirici/app.py\r\n\t > Line 104: temp_1__IsTrue = _IsTrue\r\n\tFile: /home/gunal/kelime_kok_ayirici/db.py\r\n\t > Line 64: _IsTrue = temp_1__IsTrue\r\n\tFile: /home/gunal/kelime_kok_ayirici/app.py\r\n\t > Line 64: _IsTrue = _IsTrue\r\nFile: /home/gunal/kelime_kok_ayirici/db.py\r\n > reaches line 80, trigger word \"execute(\":\r\n\t~call_4 = ret_cursor.execute(sql, (int(_IsTrue), str(_UserSuggestion), datetime.datetime.now(), int(_ID)))\r\n```\r\nif it can be we should parse it differently","created_at":"2018-04-12T19:51:15Z","updated_at":"2018-04-12T19:51:15Z","html_url":"https://github.com/python-security/pyt/pull/106#discussion_r181201726","pull_request_url":"https://api.github.com/repos/python-security/pyt/pulls/106","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/python-security/pyt/pulls/comments/181201726"},"html":{"href":"https://github.com/python-security/pyt/pull/106#discussion_r181201726"},"pull_request":{"href":"https://api.github.com/repos/python-security/pyt/pulls/106"}},"in_reply_to_id":180955221},"pull_request":{"url":"https://api.github.com/repos/python-security/pyt/pulls/106","id":180412669,"html_url":"https://github.com/python-security/pyt/pull/106","diff_url":"https://github.com/python-security/pyt/pull/106.diff","patch_url":"https://github.com/python-security/pyt/pull/106.patch","issue_url":"https://api.github.com/repos/python-security/pyt/issues/106","number":106,"state":"open","locked":false,"title":"Baseline support ","user":{"login":"omergunal","id":19760132,"avatar_url":"https://avatars3.githubusercontent.com/u/19760132?v=4","gravatar_id":"","url":"https://api.github.com/users/omergunal","html_url":"https://github.com/omergunal","followers_url":"https://api.github.com/users/omergunal/followers","following_url":"https://api.github.com/users/omergunal/following{/other_user}","gists_url":"https://api.github.com/users/omergunal/gists{/gist_id}","starred_url":"https://api.github.com/users/omergunal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omergunal/subscriptions","organizations_url":"https://api.github.com/users/omergunal/orgs","repos_url":"https://api.github.com/users/omergunal/repos","events_url":"https://api.github.com/users/omergunal/events{/privacy}","received_events_url":"https://api.github.com/users/omergunal/received_events","type":"User","site_admin":false},"body":"[Issue 101](https://github.com/python-security/pyt/issues/101)\r\nI coded \"baseline support\" script but i couldnt implement it. i am taking this error: \"ValueError: I/O operation on closed file.\"\r\n\r\n#python3 -m  pyt -f app.py  --baseline test.json\r\n**Output**: \r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.5/runpy.py\", line 184, in _run_module_as_main\r\n    \"__main__\", mod_spec)\r\n  File \"/usr/lib/python3.5/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/home/gunal/pyt/pyt/__main__.py\", line 370, in <module>\r\n    main()\r\n  File \"/home/gunal/pyt/pyt/__main__.py\", line 316, in main\r\n    compare(json.report(vulnerabilities, sys.stdout),baseline)\r\n  File \"/home/gunal/pyt/pyt/formatters/json.py\", line 31, in report\r\n    with fileobj:\r\nValueError: I/O operation on closed file.\r\n\r\n","created_at":"2018-04-09T20:06:33Z","updated_at":"2018-04-12T19:51:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a80588573d2e6728f9539559aa824522dfe6c657","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/python-security/pyt/pulls/106/commits","review_comments_url":"https://api.github.com/repos/python-security/pyt/pulls/106/comments","review_comment_url":"https://api.github.com/repos/python-security/pyt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-security/pyt/issues/106/comments","statuses_url":"https://api.github.com/repos/python-security/pyt/statuses/e8bbf3f53f9c3965b96a3dd5be18a3b72e701a35","head":{"label":"omergunal:master","ref":"master","sha":"e8bbf3f53f9c3965b96a3dd5be18a3b72e701a35","user":{"login":"omergunal","id":19760132,"avatar_url":"https://avatars3.githubusercontent.com/u/19760132?v=4","gravatar_id":"","url":"https://api.github.com/users/omergunal","html_url":"https://github.com/omergunal","followers_url":"https://api.github.com/users/omergunal/followers","following_url":"https://api.github.com/users/omergunal/following{/other_user}","gists_url":"https://api.github.com/users/omergunal/gists{/gist_id}","starred_url":"https://api.github.com/users/omergunal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omergunal/subscriptions","organizations_url":"https://api.github.com/users/omergunal/orgs","repos_url":"https://api.github.com/users/omergunal/repos","events_url":"https://api.github.com/users/omergunal/events{/privacy}","received_events_url":"https://api.github.com/users/omergunal/received_events","type":"User","site_admin":false},"repo":{"id":128826540,"name":"pyt","full_name":"omergunal/pyt","owner":{"login":"omergunal","id":19760132,"avatar_url":"https://avatars3.githubusercontent.com/u/19760132?v=4","gravatar_id":"","url":"https://api.github.com/users/omergunal","html_url":"https://github.com/omergunal","followers_url":"https://api.github.com/users/omergunal/followers","following_url":"https://api.github.com/users/omergunal/following{/other_user}","gists_url":"https://api.github.com/users/omergunal/gists{/gist_id}","starred_url":"https://api.github.com/users/omergunal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omergunal/subscriptions","organizations_url":"https://api.github.com/users/omergunal/orgs","repos_url":"https://api.github.com/users/omergunal/repos","events_url":"https://api.github.com/users/omergunal/events{/privacy}","received_events_url":"https://api.github.com/users/omergunal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/omergunal/pyt","description":"A Static Analysis Tool for Detecting Security Vulnerabilities in Python Web Applications","fork":true,"url":"https://api.github.com/repos/omergunal/pyt","forks_url":"https://api.github.com/repos/omergunal/pyt/forks","keys_url":"https://api.github.com/repos/omergunal/pyt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omergunal/pyt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omergunal/pyt/teams","hooks_url":"https://api.github.com/repos/omergunal/pyt/hooks","issue_events_url":"https://api.github.com/repos/omergunal/pyt/issues/events{/number}","events_url":"https://api.github.com/repos/omergunal/pyt/events","assignees_url":"https://api.github.com/repos/omergunal/pyt/assignees{/user}","branches_url":"https://api.github.com/repos/omergunal/pyt/branches{/branch}","tags_url":"https://api.github.com/repos/omergunal/pyt/tags","blobs_url":"https://api.github.com/repos/omergunal/pyt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omergunal/pyt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omergunal/pyt/git/refs{/sha}","trees_url":"https://api.github.com/repos/omergunal/pyt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omergunal/pyt/statuses/{sha}","languages_url":"https://api.github.com/repos/omergunal/pyt/languages","stargazers_url":"https://api.github.com/repos/omergunal/pyt/stargazers","contributors_url":"https://api.github.com/repos/omergunal/pyt/contributors","subscribers_url":"https://api.github.com/repos/omergunal/pyt/subscribers","subscription_url":"https://api.github.com/repos/omergunal/pyt/subscription","commits_url":"https://api.github.com/repos/omergunal/pyt/commits{/sha}","git_commits_url":"https://api.github.com/repos/omergunal/pyt/git/commits{/sha}","comments_url":"https://api.github.com/repos/omergunal/pyt/comments{/number}","issue_comment_url":"https://api.github.com/repos/omergunal/pyt/issues/comments{/number}","contents_url":"https://api.github.com/repos/omergunal/pyt/contents/{+path}","compare_url":"https://api.github.com/repos/omergunal/pyt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omergunal/pyt/merges","archive_url":"https://api.github.com/repos/omergunal/pyt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omergunal/pyt/downloads","issues_url":"https://api.github.com/repos/omergunal/pyt/issues{/number}","pulls_url":"https://api.github.com/repos/omergunal/pyt/pulls{/number}","milestones_url":"https://api.github.com/repos/omergunal/pyt/milestones{/number}","notifications_url":"https://api.github.com/repos/omergunal/pyt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omergunal/pyt/labels{/name}","releases_url":"https://api.github.com/repos/omergunal/pyt/releases{/id}","deployments_url":"https://api.github.com/repos/omergunal/pyt/deployments","created_at":"2018-04-09T19:58:12Z","updated_at":"2018-04-12T19:21:11Z","pushed_at":"2018-04-12T19:21:10Z","git_url":"git://github.com/omergunal/pyt.git","ssh_url":"git@github.com:omergunal/pyt.git","clone_url":"https://github.com/omergunal/pyt.git","svn_url":"https://github.com/omergunal/pyt","homepage":"","size":2876,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"python-security:master","ref":"master","sha":"92d928aa560c11b0a5e8ec7e519c7920b882c901","user":{"login":"python-security","id":23080898,"avatar_url":"https://avatars0.githubusercontent.com/u/23080898?v=4","gravatar_id":"","url":"https://api.github.com/users/python-security","html_url":"https://github.com/python-security","followers_url":"https://api.github.com/users/python-security/followers","following_url":"https://api.github.com/users/python-security/following{/other_user}","gists_url":"https://api.github.com/users/python-security/gists{/gist_id}","starred_url":"https://api.github.com/users/python-security/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-security/subscriptions","organizations_url":"https://api.github.com/users/python-security/orgs","repos_url":"https://api.github.com/users/python-security/repos","events_url":"https://api.github.com/users/python-security/events{/privacy}","received_events_url":"https://api.github.com/users/python-security/received_events","type":"Organization","site_admin":false},"repo":{"id":72017740,"name":"pyt","full_name":"python-security/pyt","owner":{"login":"python-security","id":23080898,"avatar_url":"https://avatars0.githubusercontent.com/u/23080898?v=4","gravatar_id":"","url":"https://api.github.com/users/python-security","html_url":"https://github.com/python-security","followers_url":"https://api.github.com/users/python-security/followers","following_url":"https://api.github.com/users/python-security/following{/other_user}","gists_url":"https://api.github.com/users/python-security/gists{/gist_id}","starred_url":"https://api.github.com/users/python-security/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-security/subscriptions","organizations_url":"https://api.github.com/users/python-security/orgs","repos_url":"https://api.github.com/users/python-security/repos","events_url":"https://api.github.com/users/python-security/events{/privacy}","received_events_url":"https://api.github.com/users/python-security/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-security/pyt","description":"A Static Analysis Tool for Detecting Security Vulnerabilities in Python Web Applications","fork":false,"url":"https://api.github.com/repos/python-security/pyt","forks_url":"https://api.github.com/repos/python-security/pyt/forks","keys_url":"https://api.github.com/repos/python-security/pyt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-security/pyt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-security/pyt/teams","hooks_url":"https://api.github.com/repos/python-security/pyt/hooks","issue_events_url":"https://api.github.com/repos/python-security/pyt/issues/events{/number}","events_url":"https://api.github.com/repos/python-security/pyt/events","assignees_url":"https://api.github.com/repos/python-security/pyt/assignees{/user}","branches_url":"https://api.github.com/repos/python-security/pyt/branches{/branch}","tags_url":"https://api.github.com/repos/python-security/pyt/tags","blobs_url":"https://api.github.com/repos/python-security/pyt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-security/pyt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-security/pyt/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-security/pyt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-security/pyt/statuses/{sha}","languages_url":"https://api.github.com/repos/python-security/pyt/languages","stargazers_url":"https://api.github.com/repos/python-security/pyt/stargazers","contributors_url":"https://api.github.com/repos/python-security/pyt/contributors","subscribers_url":"https://api.github.com/repos/python-security/pyt/subscribers","subscription_url":"https://api.github.com/repos/python-security/pyt/subscription","commits_url":"https://api.github.com/repos/python-security/pyt/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-security/pyt/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-security/pyt/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-security/pyt/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-security/pyt/contents/{+path}","compare_url":"https://api.github.com/repos/python-security/pyt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-security/pyt/merges","archive_url":"https://api.github.com/repos/python-security/pyt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-security/pyt/downloads","issues_url":"https://api.github.com/repos/python-security/pyt/issues{/number}","pulls_url":"https://api.github.com/repos/python-security/pyt/pulls{/number}","milestones_url":"https://api.github.com/repos/python-security/pyt/milestones{/number}","notifications_url":"https://api.github.com/repos/python-security/pyt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-security/pyt/labels{/name}","releases_url":"https://api.github.com/repos/python-security/pyt/releases{/id}","deployments_url":"https://api.github.com/repos/python-security/pyt/deployments","created_at":"2016-10-26T15:34:48Z","updated_at":"2018-04-12T17:45:52Z","pushed_at":"2018-04-12T19:21:10Z","git_url":"git://github.com/python-security/pyt.git","ssh_url":"git@github.com:python-security/pyt.git","clone_url":"https://github.com/python-security/pyt.git","svn_url":"https://github.com/python-security/pyt","homepage":"","size":2849,"stargazers_count":865,"watchers_count":865,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":112,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":112,"open_issues":28,"watchers":865,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-security/pyt/pulls/106"},"html":{"href":"https://github.com/python-security/pyt/pull/106"},"issue":{"href":"https://api.github.com/repos/python-security/pyt/issues/106"},"comments":{"href":"https://api.github.com/repos/python-security/pyt/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/python-security/pyt/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/python-security/pyt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-security/pyt/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/python-security/pyt/statuses/e8bbf3f53f9c3965b96a3dd5be18a3b72e701a35"}},"author_association":"NONE"}}
{"actor":{"display_login":"omergunal"}}