{"action":"created","comment":{"url":"https://api.github.com/repos/trocafone/correios-lib/pulls/comments/71220561","id":71220561,"diff_hunk":"@@ -89,11 +120,23 @@ def call(self, method, request):\n         '''\n         service_method = getattr(self.client.service, method, None)\n \n-        try:\n-            return service_method(request)\n-        except ValueError:\n-            raise WebserviceError('The method you are trying to call does not '\n-                                  'exists.')\n+        req_type = 'Request' + method[0].upper() + method[1:]\n+        req_instance = request.__class__.__name__\n+\n+        if req_type != req_instance:\n+            raise WebserviceError(\n+                'Request must be an instance of {0}, given {1}'.format(\n+                    req_type,\n+                    req_instance\n+                 )\n+            )\n+\n+        import sys\n+        if sys.version_info <= (3, 0):\n+            reload(sys)\n+            sys.setdefaultencoding('utf-8')\n+\n+        return service_method(**request)","path":"correios_lib/base.py","position":86,"original_position":86,"commit_id":"dca3471d6adbc68d8dd71f9f4cc6655247ccfc8c","original_commit_id":"dca3471d6adbc68d8dd71f9f4cc6655247ccfc8c","user":{"login":"fextramiana","id":4460789,"avatar_url":"https://avatars.githubusercontent.com/u/4460789?v=3","gravatar_id":"","url":"https://api.github.com/users/fextramiana","html_url":"https://github.com/fextramiana","followers_url":"https://api.github.com/users/fextramiana/followers","following_url":"https://api.github.com/users/fextramiana/following{/other_user}","gists_url":"https://api.github.com/users/fextramiana/gists{/gist_id}","starred_url":"https://api.github.com/users/fextramiana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fextramiana/subscriptions","organizations_url":"https://api.github.com/users/fextramiana/orgs","repos_url":"https://api.github.com/users/fextramiana/repos","events_url":"https://api.github.com/users/fextramiana/events{/privacy}","received_events_url":"https://api.github.com/users/fextramiana/received_events","type":"User","site_admin":false},"body":"you are getting the service_method in a super safe way but then you don't check if it's **None** or not; this will rise something like `TypeError: 'NoneType' object is not callable`\r\n","created_at":"2016-07-18T20:15:17Z","updated_at":"2016-07-18T20:15:17Z","html_url":"https://github.com/trocafone/correios-lib/pull/2#discussion_r71220561","pull_request_url":"https://api.github.com/repos/trocafone/correios-lib/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/trocafone/correios-lib/pulls/comments/71220561"},"html":{"href":"https://github.com/trocafone/correios-lib/pull/2#discussion_r71220561"},"pull_request":{"href":"https://api.github.com/repos/trocafone/correios-lib/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/trocafone/correios-lib/pulls/2","id":77868959,"html_url":"https://github.com/trocafone/correios-lib/pull/2","diff_url":"https://github.com/trocafone/correios-lib/pull/2.diff","patch_url":"https://github.com/trocafone/correios-lib/pull/2.patch","issue_url":"https://api.github.com/repos/trocafone/correios-lib/issues/2","number":2,"state":"open","locked":false,"title":"Feature/acompanhar pedido","user":{"login":"flavioab","id":2287986,"avatar_url":"https://avatars.githubusercontent.com/u/2287986?v=3","gravatar_id":"","url":"https://api.github.com/users/flavioab","html_url":"https://github.com/flavioab","followers_url":"https://api.github.com/users/flavioab/followers","following_url":"https://api.github.com/users/flavioab/following{/other_user}","gists_url":"https://api.github.com/users/flavioab/gists{/gist_id}","starred_url":"https://api.github.com/users/flavioab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavioab/subscriptions","organizations_url":"https://api.github.com/users/flavioab/orgs","repos_url":"https://api.github.com/users/flavioab/repos","events_url":"https://api.github.com/users/flavioab/events{/privacy}","received_events_url":"https://api.github.com/users/flavioab/received_events","type":"User","site_admin":false},"body":"another method added and tested","created_at":"2016-07-18T19:58:03Z","updated_at":"2016-07-18T20:15:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6db783ce45205950214e5985993d3829c86bd3d3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/trocafone/correios-lib/pulls/2/commits","review_comments_url":"https://api.github.com/repos/trocafone/correios-lib/pulls/2/comments","review_comment_url":"https://api.github.com/repos/trocafone/correios-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trocafone/correios-lib/issues/2/comments","statuses_url":"https://api.github.com/repos/trocafone/correios-lib/statuses/dca3471d6adbc68d8dd71f9f4cc6655247ccfc8c","head":{"label":"trocafone:feature/acompanhar_pedido","ref":"feature/acompanhar_pedido","sha":"dca3471d6adbc68d8dd71f9f4cc6655247ccfc8c","user":{"login":"trocafone","id":10672896,"avatar_url":"https://avatars.githubusercontent.com/u/10672896?v=3","gravatar_id":"","url":"https://api.github.com/users/trocafone","html_url":"https://github.com/trocafone","followers_url":"https://api.github.com/users/trocafone/followers","following_url":"https://api.github.com/users/trocafone/following{/other_user}","gists_url":"https://api.github.com/users/trocafone/gists{/gist_id}","starred_url":"https://api.github.com/users/trocafone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trocafone/subscriptions","organizations_url":"https://api.github.com/users/trocafone/orgs","repos_url":"https://api.github.com/users/trocafone/repos","events_url":"https://api.github.com/users/trocafone/events{/privacy}","received_events_url":"https://api.github.com/users/trocafone/received_events","type":"Organization","site_admin":false},"repo":{"id":62813400,"name":"correios-lib","full_name":"trocafone/correios-lib","owner":{"login":"trocafone","id":10672896,"avatar_url":"https://avatars.githubusercontent.com/u/10672896?v=3","gravatar_id":"","url":"https://api.github.com/users/trocafone","html_url":"https://github.com/trocafone","followers_url":"https://api.github.com/users/trocafone/followers","following_url":"https://api.github.com/users/trocafone/following{/other_user}","gists_url":"https://api.github.com/users/trocafone/gists{/gist_id}","starred_url":"https://api.github.com/users/trocafone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trocafone/subscriptions","organizations_url":"https://api.github.com/users/trocafone/orgs","repos_url":"https://api.github.com/users/trocafone/repos","events_url":"https://api.github.com/users/trocafone/events{/privacy}","received_events_url":"https://api.github.com/users/trocafone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trocafone/correios-lib","description":"Correios Webservice Integration Library for Python","fork":false,"url":"https://api.github.com/repos/trocafone/correios-lib","forks_url":"https://api.github.com/repos/trocafone/correios-lib/forks","keys_url":"https://api.github.com/repos/trocafone/correios-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trocafone/correios-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trocafone/correios-lib/teams","hooks_url":"https://api.github.com/repos/trocafone/correios-lib/hooks","issue_events_url":"https://api.github.com/repos/trocafone/correios-lib/issues/events{/number}","events_url":"https://api.github.com/repos/trocafone/correios-lib/events","assignees_url":"https://api.github.com/repos/trocafone/correios-lib/assignees{/user}","branches_url":"https://api.github.com/repos/trocafone/correios-lib/branches{/branch}","tags_url":"https://api.github.com/repos/trocafone/correios-lib/tags","blobs_url":"https://api.github.com/repos/trocafone/correios-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trocafone/correios-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trocafone/correios-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/trocafone/correios-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trocafone/correios-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/trocafone/correios-lib/languages","stargazers_url":"https://api.github.com/repos/trocafone/correios-lib/stargazers","contributors_url":"https://api.github.com/repos/trocafone/correios-lib/contributors","subscribers_url":"https://api.github.com/repos/trocafone/correios-lib/subscribers","subscription_url":"https://api.github.com/repos/trocafone/correios-lib/subscription","commits_url":"https://api.github.com/repos/trocafone/correios-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/trocafone/correios-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/trocafone/correios-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/trocafone/correios-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/trocafone/correios-lib/contents/{+path}","compare_url":"https://api.github.com/repos/trocafone/correios-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trocafone/correios-lib/merges","archive_url":"https://api.github.com/repos/trocafone/correios-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trocafone/correios-lib/downloads","issues_url":"https://api.github.com/repos/trocafone/correios-lib/issues{/number}","pulls_url":"https://api.github.com/repos/trocafone/correios-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/trocafone/correios-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/trocafone/correios-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trocafone/correios-lib/labels{/name}","releases_url":"https://api.github.com/repos/trocafone/correios-lib/releases{/id}","deployments_url":"https://api.github.com/repos/trocafone/correios-lib/deployments","created_at":"2016-07-07T14:30:35Z","updated_at":"2016-07-12T15:55:26Z","pushed_at":"2016-07-18T20:02:26Z","git_url":"git://github.com/trocafone/correios-lib.git","ssh_url":"git@github.com:trocafone/correios-lib.git","clone_url":"https://github.com/trocafone/correios-lib.git","svn_url":"https://github.com/trocafone/correios-lib","homepage":null,"size":55,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"trocafone:master","ref":"master","sha":"7d41d14a13589b7dd4efc62bb8a9ec57c72defe5","user":{"login":"trocafone","id":10672896,"avatar_url":"https://avatars.githubusercontent.com/u/10672896?v=3","gravatar_id":"","url":"https://api.github.com/users/trocafone","html_url":"https://github.com/trocafone","followers_url":"https://api.github.com/users/trocafone/followers","following_url":"https://api.github.com/users/trocafone/following{/other_user}","gists_url":"https://api.github.com/users/trocafone/gists{/gist_id}","starred_url":"https://api.github.com/users/trocafone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trocafone/subscriptions","organizations_url":"https://api.github.com/users/trocafone/orgs","repos_url":"https://api.github.com/users/trocafone/repos","events_url":"https://api.github.com/users/trocafone/events{/privacy}","received_events_url":"https://api.github.com/users/trocafone/received_events","type":"Organization","site_admin":false},"repo":{"id":62813400,"name":"correios-lib","full_name":"trocafone/correios-lib","owner":{"login":"trocafone","id":10672896,"avatar_url":"https://avatars.githubusercontent.com/u/10672896?v=3","gravatar_id":"","url":"https://api.github.com/users/trocafone","html_url":"https://github.com/trocafone","followers_url":"https://api.github.com/users/trocafone/followers","following_url":"https://api.github.com/users/trocafone/following{/other_user}","gists_url":"https://api.github.com/users/trocafone/gists{/gist_id}","starred_url":"https://api.github.com/users/trocafone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trocafone/subscriptions","organizations_url":"https://api.github.com/users/trocafone/orgs","repos_url":"https://api.github.com/users/trocafone/repos","events_url":"https://api.github.com/users/trocafone/events{/privacy}","received_events_url":"https://api.github.com/users/trocafone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trocafone/correios-lib","description":"Correios Webservice Integration Library for Python","fork":false,"url":"https://api.github.com/repos/trocafone/correios-lib","forks_url":"https://api.github.com/repos/trocafone/correios-lib/forks","keys_url":"https://api.github.com/repos/trocafone/correios-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trocafone/correios-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trocafone/correios-lib/teams","hooks_url":"https://api.github.com/repos/trocafone/correios-lib/hooks","issue_events_url":"https://api.github.com/repos/trocafone/correios-lib/issues/events{/number}","events_url":"https://api.github.com/repos/trocafone/correios-lib/events","assignees_url":"https://api.github.com/repos/trocafone/correios-lib/assignees{/user}","branches_url":"https://api.github.com/repos/trocafone/correios-lib/branches{/branch}","tags_url":"https://api.github.com/repos/trocafone/correios-lib/tags","blobs_url":"https://api.github.com/repos/trocafone/correios-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trocafone/correios-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trocafone/correios-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/trocafone/correios-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trocafone/correios-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/trocafone/correios-lib/languages","stargazers_url":"https://api.github.com/repos/trocafone/correios-lib/stargazers","contributors_url":"https://api.github.com/repos/trocafone/correios-lib/contributors","subscribers_url":"https://api.github.com/repos/trocafone/correios-lib/subscribers","subscription_url":"https://api.github.com/repos/trocafone/correios-lib/subscription","commits_url":"https://api.github.com/repos/trocafone/correios-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/trocafone/correios-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/trocafone/correios-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/trocafone/correios-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/trocafone/correios-lib/contents/{+path}","compare_url":"https://api.github.com/repos/trocafone/correios-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trocafone/correios-lib/merges","archive_url":"https://api.github.com/repos/trocafone/correios-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trocafone/correios-lib/downloads","issues_url":"https://api.github.com/repos/trocafone/correios-lib/issues{/number}","pulls_url":"https://api.github.com/repos/trocafone/correios-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/trocafone/correios-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/trocafone/correios-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trocafone/correios-lib/labels{/name}","releases_url":"https://api.github.com/repos/trocafone/correios-lib/releases{/id}","deployments_url":"https://api.github.com/repos/trocafone/correios-lib/deployments","created_at":"2016-07-07T14:30:35Z","updated_at":"2016-07-12T15:55:26Z","pushed_at":"2016-07-18T20:02:26Z","git_url":"git://github.com/trocafone/correios-lib.git","ssh_url":"git@github.com:trocafone/correios-lib.git","clone_url":"https://github.com/trocafone/correios-lib.git","svn_url":"https://github.com/trocafone/correios-lib","homepage":null,"size":55,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trocafone/correios-lib/pulls/2"},"html":{"href":"https://github.com/trocafone/correios-lib/pull/2"},"issue":{"href":"https://api.github.com/repos/trocafone/correios-lib/issues/2"},"comments":{"href":"https://api.github.com/repos/trocafone/correios-lib/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/trocafone/correios-lib/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/trocafone/correios-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trocafone/correios-lib/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/trocafone/correios-lib/statuses/dca3471d6adbc68d8dd71f9f4cc6655247ccfc8c"}}}}
{"actor":{"display_login":"fextramiana"}}