{"action":"closed","number":25,"pull_request":{"url":"https://api.github.com/repos/martinkou/bson/pulls/25","id":20011703,"html_url":"https://github.com/martinkou/bson/pull/25","diff_url":"https://github.com/martinkou/bson/pull/25.diff","patch_url":"https://github.com/martinkou/bson/pull/25.patch","issue_url":"https://api.github.com/repos/martinkou/bson/issues/25","number":25,"state":"closed","locked":false,"title":"encode_cstring fix for longs and int","user":{"login":"nadirhamid","id":7277417,"avatar_url":"https://avatars.githubusercontent.com/u/7277417?v=3","gravatar_id":"","url":"https://api.github.com/users/nadirhamid","html_url":"https://github.com/nadirhamid","followers_url":"https://api.github.com/users/nadirhamid/followers","following_url":"https://api.github.com/users/nadirhamid/following{/other_user}","gists_url":"https://api.github.com/users/nadirhamid/gists{/gist_id}","starred_url":"https://api.github.com/users/nadirhamid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadirhamid/subscriptions","organizations_url":"https://api.github.com/users/nadirhamid/orgs","repos_url":"https://api.github.com/users/nadirhamid/repos","events_url":"https://api.github.com/users/nadirhamid/events{/privacy}","received_events_url":"https://api.github.com/users/nadirhamid/received_events","type":"User","site_admin":false},"body":"Hey Martin,\r\n\r\nAs I was using your bson parser in a project, I noticed it didn't handle\r\nlong type keys to well. I was given a \"can't add str and long objects\" error.\r\nMy data structure being:\r\n\r\n{320L: {'title': 'testing, 'lat': 20.0, 'lng': 50.0, 'id': 320L}, \r\n 300L: {'title': 'testing', 'lat': 20.0, 'lng': 50.0, 'id': 300L}}\r\n\r\n\r\nThis led me to look into encode_cstring\r\nand make the following check for long or int types.\r\n\r\nLine 108 in encode_cstring/1:\r\n\r\nif isinstance(value, long) or isinstance(value, int):\r\n\tvalue = str(value)\r\n\r\nI have attached it in my forked version of bsonpy which I have made a pull\r\nrequest on over github.\r\n\r\nI hope I could help in anyway.\r\n\r\nThanks,\r\nNadir","created_at":"2014-08-19T21:45:48Z","updated_at":"2015-07-21T06:38:56Z","closed_at":"2015-07-21T06:38:56Z","merged_at":null,"merge_commit_sha":"f53549511f48e94bc2061ea7dbb504bfcb8fc45a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/martinkou/bson/pulls/25/commits","review_comments_url":"https://api.github.com/repos/martinkou/bson/pulls/25/comments","review_comment_url":"https://api.github.com/repos/martinkou/bson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/martinkou/bson/issues/25/comments","statuses_url":"https://api.github.com/repos/martinkou/bson/statuses/9544fa3feccec98bb04917c2f900f6fddd1d4b09","head":{"label":"nadirhamid:master","ref":"master","sha":"9544fa3feccec98bb04917c2f900f6fddd1d4b09","user":{"login":"nadirhamid","id":7277417,"avatar_url":"https://avatars.githubusercontent.com/u/7277417?v=3","gravatar_id":"","url":"https://api.github.com/users/nadirhamid","html_url":"https://github.com/nadirhamid","followers_url":"https://api.github.com/users/nadirhamid/followers","following_url":"https://api.github.com/users/nadirhamid/following{/other_user}","gists_url":"https://api.github.com/users/nadirhamid/gists{/gist_id}","starred_url":"https://api.github.com/users/nadirhamid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadirhamid/subscriptions","organizations_url":"https://api.github.com/users/nadirhamid/orgs","repos_url":"https://api.github.com/users/nadirhamid/repos","events_url":"https://api.github.com/users/nadirhamid/events{/privacy}","received_events_url":"https://api.github.com/users/nadirhamid/received_events","type":"User","site_admin":false},"repo":{"id":23126626,"name":"bson","full_name":"nadirhamid/bson","owner":{"login":"nadirhamid","id":7277417,"avatar_url":"https://avatars.githubusercontent.com/u/7277417?v=3","gravatar_id":"","url":"https://api.github.com/users/nadirhamid","html_url":"https://github.com/nadirhamid","followers_url":"https://api.github.com/users/nadirhamid/followers","following_url":"https://api.github.com/users/nadirhamid/following{/other_user}","gists_url":"https://api.github.com/users/nadirhamid/gists{/gist_id}","starred_url":"https://api.github.com/users/nadirhamid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadirhamid/subscriptions","organizations_url":"https://api.github.com/users/nadirhamid/orgs","repos_url":"https://api.github.com/users/nadirhamid/repos","events_url":"https://api.github.com/users/nadirhamid/events{/privacy}","received_events_url":"https://api.github.com/users/nadirhamid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nadirhamid/bson","description":"Independent BSON codec for Python that doesn't depend on MongoDB.","fork":true,"url":"https://api.github.com/repos/nadirhamid/bson","forks_url":"https://api.github.com/repos/nadirhamid/bson/forks","keys_url":"https://api.github.com/repos/nadirhamid/bson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nadirhamid/bson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nadirhamid/bson/teams","hooks_url":"https://api.github.com/repos/nadirhamid/bson/hooks","issue_events_url":"https://api.github.com/repos/nadirhamid/bson/issues/events{/number}","events_url":"https://api.github.com/repos/nadirhamid/bson/events","assignees_url":"https://api.github.com/repos/nadirhamid/bson/assignees{/user}","branches_url":"https://api.github.com/repos/nadirhamid/bson/branches{/branch}","tags_url":"https://api.github.com/repos/nadirhamid/bson/tags","blobs_url":"https://api.github.com/repos/nadirhamid/bson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nadirhamid/bson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nadirhamid/bson/git/refs{/sha}","trees_url":"https://api.github.com/repos/nadirhamid/bson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nadirhamid/bson/statuses/{sha}","languages_url":"https://api.github.com/repos/nadirhamid/bson/languages","stargazers_url":"https://api.github.com/repos/nadirhamid/bson/stargazers","contributors_url":"https://api.github.com/repos/nadirhamid/bson/contributors","subscribers_url":"https://api.github.com/repos/nadirhamid/bson/subscribers","subscription_url":"https://api.github.com/repos/nadirhamid/bson/subscription","commits_url":"https://api.github.com/repos/nadirhamid/bson/commits{/sha}","git_commits_url":"https://api.github.com/repos/nadirhamid/bson/git/commits{/sha}","comments_url":"https://api.github.com/repos/nadirhamid/bson/comments{/number}","issue_comment_url":"https://api.github.com/repos/nadirhamid/bson/issues/comments{/number}","contents_url":"https://api.github.com/repos/nadirhamid/bson/contents/{+path}","compare_url":"https://api.github.com/repos/nadirhamid/bson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nadirhamid/bson/merges","archive_url":"https://api.github.com/repos/nadirhamid/bson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nadirhamid/bson/downloads","issues_url":"https://api.github.com/repos/nadirhamid/bson/issues{/number}","pulls_url":"https://api.github.com/repos/nadirhamid/bson/pulls{/number}","milestones_url":"https://api.github.com/repos/nadirhamid/bson/milestones{/number}","notifications_url":"https://api.github.com/repos/nadirhamid/bson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nadirhamid/bson/labels{/name}","releases_url":"https://api.github.com/repos/nadirhamid/bson/releases{/id}","created_at":"2014-08-19T21:35:58Z","updated_at":"2014-08-19T21:44:54Z","pushed_at":"2014-08-19T21:44:54Z","git_url":"git://github.com/nadirhamid/bson.git","ssh_url":"git@github.com:nadirhamid/bson.git","clone_url":"https://github.com/nadirhamid/bson.git","svn_url":"https://github.com/nadirhamid/bson","homepage":"","size":135,"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":"martinkou:master","ref":"master","sha":"ca99968bc40ce7e6c523569109900d81eecfad7f","user":{"login":"martinkou","id":304402,"avatar_url":"https://avatars.githubusercontent.com/u/304402?v=3","gravatar_id":"","url":"https://api.github.com/users/martinkou","html_url":"https://github.com/martinkou","followers_url":"https://api.github.com/users/martinkou/followers","following_url":"https://api.github.com/users/martinkou/following{/other_user}","gists_url":"https://api.github.com/users/martinkou/gists{/gist_id}","starred_url":"https://api.github.com/users/martinkou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinkou/subscriptions","organizations_url":"https://api.github.com/users/martinkou/orgs","repos_url":"https://api.github.com/users/martinkou/repos","events_url":"https://api.github.com/users/martinkou/events{/privacy}","received_events_url":"https://api.github.com/users/martinkou/received_events","type":"User","site_admin":false},"repo":{"id":761788,"name":"bson","full_name":"martinkou/bson","owner":{"login":"martinkou","id":304402,"avatar_url":"https://avatars.githubusercontent.com/u/304402?v=3","gravatar_id":"","url":"https://api.github.com/users/martinkou","html_url":"https://github.com/martinkou","followers_url":"https://api.github.com/users/martinkou/followers","following_url":"https://api.github.com/users/martinkou/following{/other_user}","gists_url":"https://api.github.com/users/martinkou/gists{/gist_id}","starred_url":"https://api.github.com/users/martinkou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinkou/subscriptions","organizations_url":"https://api.github.com/users/martinkou/orgs","repos_url":"https://api.github.com/users/martinkou/repos","events_url":"https://api.github.com/users/martinkou/events{/privacy}","received_events_url":"https://api.github.com/users/martinkou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martinkou/bson","description":"Independent BSON codec for Python that doesn't depend on MongoDB.","fork":false,"url":"https://api.github.com/repos/martinkou/bson","forks_url":"https://api.github.com/repos/martinkou/bson/forks","keys_url":"https://api.github.com/repos/martinkou/bson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinkou/bson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinkou/bson/teams","hooks_url":"https://api.github.com/repos/martinkou/bson/hooks","issue_events_url":"https://api.github.com/repos/martinkou/bson/issues/events{/number}","events_url":"https://api.github.com/repos/martinkou/bson/events","assignees_url":"https://api.github.com/repos/martinkou/bson/assignees{/user}","branches_url":"https://api.github.com/repos/martinkou/bson/branches{/branch}","tags_url":"https://api.github.com/repos/martinkou/bson/tags","blobs_url":"https://api.github.com/repos/martinkou/bson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinkou/bson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinkou/bson/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinkou/bson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinkou/bson/statuses/{sha}","languages_url":"https://api.github.com/repos/martinkou/bson/languages","stargazers_url":"https://api.github.com/repos/martinkou/bson/stargazers","contributors_url":"https://api.github.com/repos/martinkou/bson/contributors","subscribers_url":"https://api.github.com/repos/martinkou/bson/subscribers","subscription_url":"https://api.github.com/repos/martinkou/bson/subscription","commits_url":"https://api.github.com/repos/martinkou/bson/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinkou/bson/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinkou/bson/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinkou/bson/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinkou/bson/contents/{+path}","compare_url":"https://api.github.com/repos/martinkou/bson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinkou/bson/merges","archive_url":"https://api.github.com/repos/martinkou/bson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinkou/bson/downloads","issues_url":"https://api.github.com/repos/martinkou/bson/issues{/number}","pulls_url":"https://api.github.com/repos/martinkou/bson/pulls{/number}","milestones_url":"https://api.github.com/repos/martinkou/bson/milestones{/number}","notifications_url":"https://api.github.com/repos/martinkou/bson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinkou/bson/labels{/name}","releases_url":"https://api.github.com/repos/martinkou/bson/releases{/id}","created_at":"2010-07-07T13:25:37Z","updated_at":"2015-07-21T06:13:55Z","pushed_at":"2015-07-21T06:34:16Z","git_url":"git://github.com/martinkou/bson.git","ssh_url":"git@github.com:martinkou/bson.git","clone_url":"https://github.com/martinkou/bson.git","svn_url":"https://github.com/martinkou/bson","homepage":"","size":335,"stargazers_count":80,"watchers_count":80,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":10,"forks":20,"open_issues":10,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/martinkou/bson/pulls/25"},"html":{"href":"https://github.com/martinkou/bson/pull/25"},"issue":{"href":"https://api.github.com/repos/martinkou/bson/issues/25"},"comments":{"href":"https://api.github.com/repos/martinkou/bson/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/martinkou/bson/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/martinkou/bson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/martinkou/bson/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/martinkou/bson/statuses/9544fa3feccec98bb04917c2f900f6fddd1d4b09"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":2,"deletions":0,"changed_files":1}}