{"action":"created","comment":{"url":"https://api.github.com/repos/dmwm/WMCore/pulls/comments/29911076","id":29911076,"diff_hunk":"@@ -78,6 +79,10 @@ def set_opts(self, curl, url, params, headers,\n         curl.setopt(pycurl.FOLLOWLOCATION, self.followlocation)\n         curl.setopt(pycurl.MAXREDIRS, self.maxredirs)\n \n+        if params:\n+            if  isinstance(params, dict):\n+                params = json.dumps(params)\n+\n         if  verb == 'GET':\n             encoded_data = urllib.urlencode(params, doseq=doseq)","path":"src/python/WMCore/Services/pycurl_manager.py","position":9,"original_position":17,"commit_id":"3905ae71481e2749efe79edb89ffa99f714736a4","original_commit_id":"8b73dd43e825fd564fe09161ddfae6c6a714d351","user":{"login":"vkuznet","id":125138,"avatar_url":"https://avatars.githubusercontent.com/u/125138?v=3","gravatar_id":"","url":"https://api.github.com/users/vkuznet","html_url":"https://github.com/vkuznet","followers_url":"https://api.github.com/users/vkuznet/followers","following_url":"https://api.github.com/users/vkuznet/following{/other_user}","gists_url":"https://api.github.com/users/vkuznet/gists{/gist_id}","starred_url":"https://api.github.com/users/vkuznet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkuznet/subscriptions","organizations_url":"https://api.github.com/users/vkuznet/orgs","repos_url":"https://api.github.com/users/vkuznet/repos","events_url":"https://api.github.com/users/vkuznet/events{/privacy}","received_events_url":"https://api.github.com/users/vkuznet/received_events","type":"User","site_admin":false},"body":"You're right, it's stressful day and my brain non working properly. I fixed the\ncode in PR.\n\nOn  0, ticoann <notifications@github.com> wrote:\n> > @@ -78,6 +79,10 @@ def set_opts(self, curl, url, params, headers,\n> >          curl.setopt(pycurl.FOLLOWLOCATION, self.followlocation)\n> >          curl.setopt(pycurl.MAXREDIRS, self.maxredirs)\n> >  \n> > +        if params:\n> > +            if  isinstance(params, dict):\n> > +                params = json.dumps(params)\n> > +\n> >          if  verb == 'GET':\n> >              encoded_data = urllib.urlencode(params, doseq=doseq)\n> \n> Hi Valenitn, what I am saying is if the dictionary is passed for GET call then it is changed to json string urlencode will give the error.\n> May be json dumps should be apply only non GET call?\n> https://github.com/vkuznet/WMCore/blob/pycurl-fix/src/python/WMCore/Services/pycurl_manager.py#L91\n> https://github.com/vkuznet/WMCore/blob/pycurl-fix/src/python/WMCore/Services/pycurl_manager.py#L95\n> \n> ``` python\n> >>> urllib.urlencode({'a':1, 'b':2})\n> 'a=1&b=2'\n> >>> urllib.urlencode(json.dumps({'a':1}))\n> Traceback (most recent call last):\n>   File \"<stdin>\", line 1, in <module>\n>   File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py\", line 1312, in urlencode\n>     raise TypeError\n> TypeError: not a valid non-string sequence or mapping object\n> ```\n> \n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/dmwm/WMCore/pull/5868/files#r29908958\n","created_at":"2015-05-08T01:16:52Z","updated_at":"2015-05-08T01:16:52Z","html_url":"https://github.com/dmwm/WMCore/pull/5868#discussion_r29911076","pull_request_url":"https://api.github.com/repos/dmwm/WMCore/pulls/5868","_links":{"self":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/comments/29911076"},"html":{"href":"https://github.com/dmwm/WMCore/pull/5868#discussion_r29911076"},"pull_request":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/5868"}}},"pull_request":{"url":"https://api.github.com/repos/dmwm/WMCore/pulls/5868","id":34961862,"html_url":"https://github.com/dmwm/WMCore/pull/5868","diff_url":"https://github.com/dmwm/WMCore/pull/5868.diff","patch_url":"https://github.com/dmwm/WMCore/pull/5868.patch","issue_url":"https://api.github.com/repos/dmwm/WMCore/issues/5868","number":5868,"state":"open","locked":false,"title":"Fixx issue with pycurl","user":{"login":"vkuznet","id":125138,"avatar_url":"https://avatars.githubusercontent.com/u/125138?v=3","gravatar_id":"","url":"https://api.github.com/users/vkuznet","html_url":"https://github.com/vkuznet","followers_url":"https://api.github.com/users/vkuznet/followers","following_url":"https://api.github.com/users/vkuznet/following{/other_user}","gists_url":"https://api.github.com/users/vkuznet/gists{/gist_id}","starred_url":"https://api.github.com/users/vkuznet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkuznet/subscriptions","organizations_url":"https://api.github.com/users/vkuznet/orgs","repos_url":"https://api.github.com/users/vkuznet/repos","events_url":"https://api.github.com/users/vkuznet/events{/privacy}","received_events_url":"https://api.github.com/users/vkuznet/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-07T21:47:10Z","updated_at":"2015-05-08T01:16:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af160c7f82063916beb9a38ef8cdc07a6abed1b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dmwm/WMCore/pulls/5868/commits","review_comments_url":"https://api.github.com/repos/dmwm/WMCore/pulls/5868/comments","review_comment_url":"https://api.github.com/repos/dmwm/WMCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmwm/WMCore/issues/5868/comments","statuses_url":"https://api.github.com/repos/dmwm/WMCore/statuses/3905ae71481e2749efe79edb89ffa99f714736a4","head":{"label":"vkuznet:pycurl-fix","ref":"pycurl-fix","sha":"3905ae71481e2749efe79edb89ffa99f714736a4","user":{"login":"vkuznet","id":125138,"avatar_url":"https://avatars.githubusercontent.com/u/125138?v=3","gravatar_id":"","url":"https://api.github.com/users/vkuznet","html_url":"https://github.com/vkuznet","followers_url":"https://api.github.com/users/vkuznet/followers","following_url":"https://api.github.com/users/vkuznet/following{/other_user}","gists_url":"https://api.github.com/users/vkuznet/gists{/gist_id}","starred_url":"https://api.github.com/users/vkuznet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkuznet/subscriptions","organizations_url":"https://api.github.com/users/vkuznet/orgs","repos_url":"https://api.github.com/users/vkuznet/repos","events_url":"https://api.github.com/users/vkuznet/events{/privacy}","received_events_url":"https://api.github.com/users/vkuznet/received_events","type":"User","site_admin":false},"repo":{"id":19494576,"name":"WMCore","full_name":"vkuznet/WMCore","owner":{"login":"vkuznet","id":125138,"avatar_url":"https://avatars.githubusercontent.com/u/125138?v=3","gravatar_id":"","url":"https://api.github.com/users/vkuznet","html_url":"https://github.com/vkuznet","followers_url":"https://api.github.com/users/vkuznet/followers","following_url":"https://api.github.com/users/vkuznet/following{/other_user}","gists_url":"https://api.github.com/users/vkuznet/gists{/gist_id}","starred_url":"https://api.github.com/users/vkuznet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkuznet/subscriptions","organizations_url":"https://api.github.com/users/vkuznet/orgs","repos_url":"https://api.github.com/users/vkuznet/repos","events_url":"https://api.github.com/users/vkuznet/events{/privacy}","received_events_url":"https://api.github.com/users/vkuznet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vkuznet/WMCore","description":"WMCore","fork":true,"url":"https://api.github.com/repos/vkuznet/WMCore","forks_url":"https://api.github.com/repos/vkuznet/WMCore/forks","keys_url":"https://api.github.com/repos/vkuznet/WMCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vkuznet/WMCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vkuznet/WMCore/teams","hooks_url":"https://api.github.com/repos/vkuznet/WMCore/hooks","issue_events_url":"https://api.github.com/repos/vkuznet/WMCore/issues/events{/number}","events_url":"https://api.github.com/repos/vkuznet/WMCore/events","assignees_url":"https://api.github.com/repos/vkuznet/WMCore/assignees{/user}","branches_url":"https://api.github.com/repos/vkuznet/WMCore/branches{/branch}","tags_url":"https://api.github.com/repos/vkuznet/WMCore/tags","blobs_url":"https://api.github.com/repos/vkuznet/WMCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vkuznet/WMCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vkuznet/WMCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/vkuznet/WMCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vkuznet/WMCore/statuses/{sha}","languages_url":"https://api.github.com/repos/vkuznet/WMCore/languages","stargazers_url":"https://api.github.com/repos/vkuznet/WMCore/stargazers","contributors_url":"https://api.github.com/repos/vkuznet/WMCore/contributors","subscribers_url":"https://api.github.com/repos/vkuznet/WMCore/subscribers","subscription_url":"https://api.github.com/repos/vkuznet/WMCore/subscription","commits_url":"https://api.github.com/repos/vkuznet/WMCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/vkuznet/WMCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/vkuznet/WMCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/vkuznet/WMCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/vkuznet/WMCore/contents/{+path}","compare_url":"https://api.github.com/repos/vkuznet/WMCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vkuznet/WMCore/merges","archive_url":"https://api.github.com/repos/vkuznet/WMCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vkuznet/WMCore/downloads","issues_url":"https://api.github.com/repos/vkuznet/WMCore/issues{/number}","pulls_url":"https://api.github.com/repos/vkuznet/WMCore/pulls{/number}","milestones_url":"https://api.github.com/repos/vkuznet/WMCore/milestones{/number}","notifications_url":"https://api.github.com/repos/vkuznet/WMCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vkuznet/WMCore/labels{/name}","releases_url":"https://api.github.com/repos/vkuznet/WMCore/releases{/id}","created_at":"2014-05-06T13:08:55Z","updated_at":"2015-04-27T15:04:28Z","pushed_at":"2015-05-08T01:16:00Z","git_url":"git://github.com/vkuznet/WMCore.git","ssh_url":"git@github.com:vkuznet/WMCore.git","clone_url":"https://github.com/vkuznet/WMCore.git","svn_url":"https://github.com/vkuznet/WMCore","homepage":"https://svnweb.cern.ch/trac/CMSDMWM/","size":22133,"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":"dmwm:master","ref":"master","sha":"24c34606e7173bcb1a39a545a0e5d39caba56be5","user":{"login":"dmwm","id":988897,"avatar_url":"https://avatars.githubusercontent.com/u/988897?v=3","gravatar_id":"","url":"https://api.github.com/users/dmwm","html_url":"https://github.com/dmwm","followers_url":"https://api.github.com/users/dmwm/followers","following_url":"https://api.github.com/users/dmwm/following{/other_user}","gists_url":"https://api.github.com/users/dmwm/gists{/gist_id}","starred_url":"https://api.github.com/users/dmwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmwm/subscriptions","organizations_url":"https://api.github.com/users/dmwm/orgs","repos_url":"https://api.github.com/users/dmwm/repos","events_url":"https://api.github.com/users/dmwm/events{/privacy}","received_events_url":"https://api.github.com/users/dmwm/received_events","type":"Organization","site_admin":false},"repo":{"id":2370458,"name":"WMCore","full_name":"dmwm/WMCore","owner":{"login":"dmwm","id":988897,"avatar_url":"https://avatars.githubusercontent.com/u/988897?v=3","gravatar_id":"","url":"https://api.github.com/users/dmwm","html_url":"https://github.com/dmwm","followers_url":"https://api.github.com/users/dmwm/followers","following_url":"https://api.github.com/users/dmwm/following{/other_user}","gists_url":"https://api.github.com/users/dmwm/gists{/gist_id}","starred_url":"https://api.github.com/users/dmwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmwm/subscriptions","organizations_url":"https://api.github.com/users/dmwm/orgs","repos_url":"https://api.github.com/users/dmwm/repos","events_url":"https://api.github.com/users/dmwm/events{/privacy}","received_events_url":"https://api.github.com/users/dmwm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dmwm/WMCore","description":"WMCore","fork":false,"url":"https://api.github.com/repos/dmwm/WMCore","forks_url":"https://api.github.com/repos/dmwm/WMCore/forks","keys_url":"https://api.github.com/repos/dmwm/WMCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmwm/WMCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmwm/WMCore/teams","hooks_url":"https://api.github.com/repos/dmwm/WMCore/hooks","issue_events_url":"https://api.github.com/repos/dmwm/WMCore/issues/events{/number}","events_url":"https://api.github.com/repos/dmwm/WMCore/events","assignees_url":"https://api.github.com/repos/dmwm/WMCore/assignees{/user}","branches_url":"https://api.github.com/repos/dmwm/WMCore/branches{/branch}","tags_url":"https://api.github.com/repos/dmwm/WMCore/tags","blobs_url":"https://api.github.com/repos/dmwm/WMCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmwm/WMCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmwm/WMCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmwm/WMCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmwm/WMCore/statuses/{sha}","languages_url":"https://api.github.com/repos/dmwm/WMCore/languages","stargazers_url":"https://api.github.com/repos/dmwm/WMCore/stargazers","contributors_url":"https://api.github.com/repos/dmwm/WMCore/contributors","subscribers_url":"https://api.github.com/repos/dmwm/WMCore/subscribers","subscription_url":"https://api.github.com/repos/dmwm/WMCore/subscription","commits_url":"https://api.github.com/repos/dmwm/WMCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmwm/WMCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmwm/WMCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmwm/WMCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmwm/WMCore/contents/{+path}","compare_url":"https://api.github.com/repos/dmwm/WMCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmwm/WMCore/merges","archive_url":"https://api.github.com/repos/dmwm/WMCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmwm/WMCore/downloads","issues_url":"https://api.github.com/repos/dmwm/WMCore/issues{/number}","pulls_url":"https://api.github.com/repos/dmwm/WMCore/pulls{/number}","milestones_url":"https://api.github.com/repos/dmwm/WMCore/milestones{/number}","notifications_url":"https://api.github.com/repos/dmwm/WMCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmwm/WMCore/labels{/name}","releases_url":"https://api.github.com/repos/dmwm/WMCore/releases{/id}","created_at":"2011-09-12T10:37:21Z","updated_at":"2015-05-07T22:49:36Z","pushed_at":"2015-05-08T01:16:00Z","git_url":"git://github.com/dmwm/WMCore.git","ssh_url":"git@github.com:dmwm/WMCore.git","clone_url":"https://github.com/dmwm/WMCore.git","svn_url":"https://github.com/dmwm/WMCore","homepage":"https://svnweb.cern.ch/trac/CMSDMWM/","size":61977,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":294,"forks":41,"open_issues":294,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/5868"},"html":{"href":"https://github.com/dmwm/WMCore/pull/5868"},"issue":{"href":"https://api.github.com/repos/dmwm/WMCore/issues/5868"},"comments":{"href":"https://api.github.com/repos/dmwm/WMCore/issues/5868/comments"},"review_comments":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/5868/comments"},"review_comment":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmwm/WMCore/pulls/5868/commits"},"statuses":{"href":"https://api.github.com/repos/dmwm/WMCore/statuses/3905ae71481e2749efe79edb89ffa99f714736a4"}}}}