{"action":"created","comment":{"url":"https://api.github.com/repos/rollbar/pyrollbar/pulls/comments/26177820","id":26177820,"diff_hunk":"@@ -1007,6 +1014,34 @@ def _build_bottle_request_data(request):\n \n     return request_data\n \n+\n+def _build_wsgi_request_data(request):\n+    request_data = {\n+        'url': wsgiref.util.request_uri(request),\n+        'user_ip': _wsgi_extract_user_ip(request),\n+        'method': request.get('REQUEST_METHOD'),\n+    }\n+    if 'QUERY_STRING' in request:\n+        request_data['GET'] = urlparse.parse_qs(request['QUERY_STRING'], keep_blank_values=True)\n+        # Collapse single item arrays\n+        request_data['GET'] = dict((k, v[0] if len(v) == 1 else v) for k, v in request_data['GET'].items())\n+\n+    request_data['headers'] = _extract_wsgi_headers(request.items())\n+\n+    try:\n+        length = int(request.get('CONTENT_LENGTH', 0))\n+    except ValueError:\n+        length = 0\n+    input = request.get('wsgi.input')\n+    if length and input and input.seekable():","path":"rollbar/__init__.py","position":96,"original_position":96,"commit_id":"bafca0fbd583a7291c7328e09f6d28632eb93949","original_commit_id":"bafca0fbd583a7291c7328e09f6d28632eb93949","user":{"login":"coryvirok","id":769323,"avatar_url":"https://avatars.githubusercontent.com/u/769323?v=3","gravatar_id":"","url":"https://api.github.com/users/coryvirok","html_url":"https://github.com/coryvirok","followers_url":"https://api.github.com/users/coryvirok/followers","following_url":"https://api.github.com/users/coryvirok/following{/other_user}","gists_url":"https://api.github.com/users/coryvirok/gists{/gist_id}","starred_url":"https://api.github.com/users/coryvirok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryvirok/subscriptions","organizations_url":"https://api.github.com/users/coryvirok/orgs","repos_url":"https://api.github.com/users/coryvirok/repos","events_url":"https://api.github.com/users/coryvirok/events{/privacy}","received_events_url":"https://api.github.com/users/coryvirok/received_events","type":"User","site_admin":false},"body":"I'm getting the following Exception while POSTing to a simple wsgi server:\r\n\r\n`AttributeError: '_fileobject' object has no attribute 'seekable'`","created_at":"2015-03-10T23:43:26Z","updated_at":"2015-03-10T23:43:26Z","html_url":"https://github.com/rollbar/pyrollbar/pull/55#discussion_r26177820","pull_request_url":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/rollbar/pyrollbar/pulls/comments/26177820"},"html":{"href":"https://github.com/rollbar/pyrollbar/pull/55#discussion_r26177820"},"pull_request":{"href":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55","id":30683544,"html_url":"https://github.com/rollbar/pyrollbar/pull/55","diff_url":"https://github.com/rollbar/pyrollbar/pull/55.diff","patch_url":"https://github.com/rollbar/pyrollbar/pull/55.patch","issue_url":"https://api.github.com/repos/rollbar/pyrollbar/issues/55","number":55,"state":"open","locked":false,"title":"Support bare wsgi request","user":{"login":"asnyatkov","id":474756,"avatar_url":"https://avatars.githubusercontent.com/u/474756?v=3","gravatar_id":"","url":"https://api.github.com/users/asnyatkov","html_url":"https://github.com/asnyatkov","followers_url":"https://api.github.com/users/asnyatkov/followers","following_url":"https://api.github.com/users/asnyatkov/following{/other_user}","gists_url":"https://api.github.com/users/asnyatkov/gists{/gist_id}","starred_url":"https://api.github.com/users/asnyatkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asnyatkov/subscriptions","organizations_url":"https://api.github.com/users/asnyatkov/orgs","repos_url":"https://api.github.com/users/asnyatkov/repos","events_url":"https://api.github.com/users/asnyatkov/events{/privacy}","received_events_url":"https://api.github.com/users/asnyatkov/received_events","type":"User","site_admin":false},"body":"- Support bare wsgi environment in _build_request_data\r\n- Separated headers and user ip extraction methods used by Django request builder\r\n\r\nhttps://github.com/rollbar/pyrollbar/issues/52\r\n","created_at":"2015-03-06T22:01:37Z","updated_at":"2015-03-10T23:43:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d5b92b65de7392a0501aea42e5356d0d4be3b89","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55/commits","review_comments_url":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55/comments","review_comment_url":"https://api.github.com/repos/rollbar/pyrollbar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rollbar/pyrollbar/issues/55/comments","statuses_url":"https://api.github.com/repos/rollbar/pyrollbar/statuses/bafca0fbd583a7291c7328e09f6d28632eb93949","head":{"label":"asnyatkov:master","ref":"master","sha":"bafca0fbd583a7291c7328e09f6d28632eb93949","user":{"login":"asnyatkov","id":474756,"avatar_url":"https://avatars.githubusercontent.com/u/474756?v=3","gravatar_id":"","url":"https://api.github.com/users/asnyatkov","html_url":"https://github.com/asnyatkov","followers_url":"https://api.github.com/users/asnyatkov/followers","following_url":"https://api.github.com/users/asnyatkov/following{/other_user}","gists_url":"https://api.github.com/users/asnyatkov/gists{/gist_id}","starred_url":"https://api.github.com/users/asnyatkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asnyatkov/subscriptions","organizations_url":"https://api.github.com/users/asnyatkov/orgs","repos_url":"https://api.github.com/users/asnyatkov/repos","events_url":"https://api.github.com/users/asnyatkov/events{/privacy}","received_events_url":"https://api.github.com/users/asnyatkov/received_events","type":"User","site_admin":false},"repo":{"id":27796115,"name":"pyrollbar","full_name":"asnyatkov/pyrollbar","owner":{"login":"asnyatkov","id":474756,"avatar_url":"https://avatars.githubusercontent.com/u/474756?v=3","gravatar_id":"","url":"https://api.github.com/users/asnyatkov","html_url":"https://github.com/asnyatkov","followers_url":"https://api.github.com/users/asnyatkov/followers","following_url":"https://api.github.com/users/asnyatkov/following{/other_user}","gists_url":"https://api.github.com/users/asnyatkov/gists{/gist_id}","starred_url":"https://api.github.com/users/asnyatkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asnyatkov/subscriptions","organizations_url":"https://api.github.com/users/asnyatkov/orgs","repos_url":"https://api.github.com/users/asnyatkov/repos","events_url":"https://api.github.com/users/asnyatkov/events{/privacy}","received_events_url":"https://api.github.com/users/asnyatkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asnyatkov/pyrollbar","description":"Error tracking and logging from Python to Rollbar","fork":true,"url":"https://api.github.com/repos/asnyatkov/pyrollbar","forks_url":"https://api.github.com/repos/asnyatkov/pyrollbar/forks","keys_url":"https://api.github.com/repos/asnyatkov/pyrollbar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asnyatkov/pyrollbar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asnyatkov/pyrollbar/teams","hooks_url":"https://api.github.com/repos/asnyatkov/pyrollbar/hooks","issue_events_url":"https://api.github.com/repos/asnyatkov/pyrollbar/issues/events{/number}","events_url":"https://api.github.com/repos/asnyatkov/pyrollbar/events","assignees_url":"https://api.github.com/repos/asnyatkov/pyrollbar/assignees{/user}","branches_url":"https://api.github.com/repos/asnyatkov/pyrollbar/branches{/branch}","tags_url":"https://api.github.com/repos/asnyatkov/pyrollbar/tags","blobs_url":"https://api.github.com/repos/asnyatkov/pyrollbar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asnyatkov/pyrollbar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asnyatkov/pyrollbar/git/refs{/sha}","trees_url":"https://api.github.com/repos/asnyatkov/pyrollbar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asnyatkov/pyrollbar/statuses/{sha}","languages_url":"https://api.github.com/repos/asnyatkov/pyrollbar/languages","stargazers_url":"https://api.github.com/repos/asnyatkov/pyrollbar/stargazers","contributors_url":"https://api.github.com/repos/asnyatkov/pyrollbar/contributors","subscribers_url":"https://api.github.com/repos/asnyatkov/pyrollbar/subscribers","subscription_url":"https://api.github.com/repos/asnyatkov/pyrollbar/subscription","commits_url":"https://api.github.com/repos/asnyatkov/pyrollbar/commits{/sha}","git_commits_url":"https://api.github.com/repos/asnyatkov/pyrollbar/git/commits{/sha}","comments_url":"https://api.github.com/repos/asnyatkov/pyrollbar/comments{/number}","issue_comment_url":"https://api.github.com/repos/asnyatkov/pyrollbar/issues/comments{/number}","contents_url":"https://api.github.com/repos/asnyatkov/pyrollbar/contents/{+path}","compare_url":"https://api.github.com/repos/asnyatkov/pyrollbar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asnyatkov/pyrollbar/merges","archive_url":"https://api.github.com/repos/asnyatkov/pyrollbar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asnyatkov/pyrollbar/downloads","issues_url":"https://api.github.com/repos/asnyatkov/pyrollbar/issues{/number}","pulls_url":"https://api.github.com/repos/asnyatkov/pyrollbar/pulls{/number}","milestones_url":"https://api.github.com/repos/asnyatkov/pyrollbar/milestones{/number}","notifications_url":"https://api.github.com/repos/asnyatkov/pyrollbar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asnyatkov/pyrollbar/labels{/name}","releases_url":"https://api.github.com/repos/asnyatkov/pyrollbar/releases{/id}","created_at":"2014-12-10T01:18:45Z","updated_at":"2015-03-06T22:30:23Z","pushed_at":"2015-03-06T22:30:23Z","git_url":"git://github.com/asnyatkov/pyrollbar.git","ssh_url":"git@github.com:asnyatkov/pyrollbar.git","clone_url":"https://github.com/asnyatkov/pyrollbar.git","svn_url":"https://github.com/asnyatkov/pyrollbar","homepage":"https://rollbar.com/docs/notifier/pyrollbar/","size":791,"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":"rollbar:master","ref":"master","sha":"e5b20d088ba0e16f20c1bd42798d5819136305aa","user":{"login":"rollbar","id":3219584,"avatar_url":"https://avatars.githubusercontent.com/u/3219584?v=3","gravatar_id":"","url":"https://api.github.com/users/rollbar","html_url":"https://github.com/rollbar","followers_url":"https://api.github.com/users/rollbar/followers","following_url":"https://api.github.com/users/rollbar/following{/other_user}","gists_url":"https://api.github.com/users/rollbar/gists{/gist_id}","starred_url":"https://api.github.com/users/rollbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rollbar/subscriptions","organizations_url":"https://api.github.com/users/rollbar/orgs","repos_url":"https://api.github.com/users/rollbar/repos","events_url":"https://api.github.com/users/rollbar/events{/privacy}","received_events_url":"https://api.github.com/users/rollbar/received_events","type":"Organization","site_admin":false},"repo":{"id":5391990,"name":"pyrollbar","full_name":"rollbar/pyrollbar","owner":{"login":"rollbar","id":3219584,"avatar_url":"https://avatars.githubusercontent.com/u/3219584?v=3","gravatar_id":"","url":"https://api.github.com/users/rollbar","html_url":"https://github.com/rollbar","followers_url":"https://api.github.com/users/rollbar/followers","following_url":"https://api.github.com/users/rollbar/following{/other_user}","gists_url":"https://api.github.com/users/rollbar/gists{/gist_id}","starred_url":"https://api.github.com/users/rollbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rollbar/subscriptions","organizations_url":"https://api.github.com/users/rollbar/orgs","repos_url":"https://api.github.com/users/rollbar/repos","events_url":"https://api.github.com/users/rollbar/events{/privacy}","received_events_url":"https://api.github.com/users/rollbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rollbar/pyrollbar","description":"Error tracking and logging from Python to Rollbar","fork":false,"url":"https://api.github.com/repos/rollbar/pyrollbar","forks_url":"https://api.github.com/repos/rollbar/pyrollbar/forks","keys_url":"https://api.github.com/repos/rollbar/pyrollbar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rollbar/pyrollbar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rollbar/pyrollbar/teams","hooks_url":"https://api.github.com/repos/rollbar/pyrollbar/hooks","issue_events_url":"https://api.github.com/repos/rollbar/pyrollbar/issues/events{/number}","events_url":"https://api.github.com/repos/rollbar/pyrollbar/events","assignees_url":"https://api.github.com/repos/rollbar/pyrollbar/assignees{/user}","branches_url":"https://api.github.com/repos/rollbar/pyrollbar/branches{/branch}","tags_url":"https://api.github.com/repos/rollbar/pyrollbar/tags","blobs_url":"https://api.github.com/repos/rollbar/pyrollbar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rollbar/pyrollbar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rollbar/pyrollbar/git/refs{/sha}","trees_url":"https://api.github.com/repos/rollbar/pyrollbar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rollbar/pyrollbar/statuses/{sha}","languages_url":"https://api.github.com/repos/rollbar/pyrollbar/languages","stargazers_url":"https://api.github.com/repos/rollbar/pyrollbar/stargazers","contributors_url":"https://api.github.com/repos/rollbar/pyrollbar/contributors","subscribers_url":"https://api.github.com/repos/rollbar/pyrollbar/subscribers","subscription_url":"https://api.github.com/repos/rollbar/pyrollbar/subscription","commits_url":"https://api.github.com/repos/rollbar/pyrollbar/commits{/sha}","git_commits_url":"https://api.github.com/repos/rollbar/pyrollbar/git/commits{/sha}","comments_url":"https://api.github.com/repos/rollbar/pyrollbar/comments{/number}","issue_comment_url":"https://api.github.com/repos/rollbar/pyrollbar/issues/comments{/number}","contents_url":"https://api.github.com/repos/rollbar/pyrollbar/contents/{+path}","compare_url":"https://api.github.com/repos/rollbar/pyrollbar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rollbar/pyrollbar/merges","archive_url":"https://api.github.com/repos/rollbar/pyrollbar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rollbar/pyrollbar/downloads","issues_url":"https://api.github.com/repos/rollbar/pyrollbar/issues{/number}","pulls_url":"https://api.github.com/repos/rollbar/pyrollbar/pulls{/number}","milestones_url":"https://api.github.com/repos/rollbar/pyrollbar/milestones{/number}","notifications_url":"https://api.github.com/repos/rollbar/pyrollbar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rollbar/pyrollbar/labels{/name}","releases_url":"https://api.github.com/repos/rollbar/pyrollbar/releases{/id}","created_at":"2012-08-12T21:12:08Z","updated_at":"2015-03-03T04:26:33Z","pushed_at":"2015-03-03T04:26:32Z","git_url":"git://github.com/rollbar/pyrollbar.git","ssh_url":"git@github.com:rollbar/pyrollbar.git","clone_url":"https://github.com/rollbar/pyrollbar.git","svn_url":"https://github.com/rollbar/pyrollbar","homepage":"https://rollbar.com/docs/notifier/pyrollbar/","size":1919,"stargazers_count":31,"watchers_count":31,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":9,"forks":23,"open_issues":9,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55"},"html":{"href":"https://github.com/rollbar/pyrollbar/pull/55"},"issue":{"href":"https://api.github.com/repos/rollbar/pyrollbar/issues/55"},"comments":{"href":"https://api.github.com/repos/rollbar/pyrollbar/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/rollbar/pyrollbar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rollbar/pyrollbar/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/rollbar/pyrollbar/statuses/bafca0fbd583a7291c7328e09f6d28632eb93949"}}}}