{"action":"opened","number":3316,"pull_request":{"url":"https://api.github.com/repos/translate/translate/pulls/3316","id":43444655,"html_url":"https://github.com/translate/translate/pull/3316","diff_url":"https://github.com/translate/translate/pull/3316.diff","patch_url":"https://github.com/translate/translate/pull/3316.patch","issue_url":"https://api.github.com/repos/translate/translate/issues/3316","number":3316,"state":"open","locked":false,"title":"__str__ to serialize()","user":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"body":"Before going further in this patch, I'd like to get your opinion on it. On Python 3, str(obj) cannot return bytes, so we have to do something at least. The \"minimal\" way could have been to replace __str__ by __bytes__, and then calling bytes(store). However, I think it would be clearer if we added a specific API (like serialize(), but could be another term) to serialize a store to a file. This is also easier if we have to pass arguments at some point, because adding arguments to Python magic methods is not very clean. Note that I still kept the serialization behavior of str(store) for Python 2, to not break compatibility if external tools count on it. The test suite still passes after the first commit. Not sure if this is worthy or not.\r\n\r\nI'm waiting on your input before going further.","created_at":"2015-08-26T19:57:49Z","updated_at":"2015-08-26T19:57:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4227649aea0c63e5bcfcb625070f7d35080990d0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/translate/translate/pulls/3316/commits","review_comments_url":"https://api.github.com/repos/translate/translate/pulls/3316/comments","review_comment_url":"https://api.github.com/repos/translate/translate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/translate/translate/issues/3316/comments","statuses_url":"https://api.github.com/repos/translate/translate/statuses/0d1d041375cf4d41e411eefd663fde22ef233041","head":{"label":"claudep:str_to_serialize","ref":"str_to_serialize","sha":"0d1d041375cf4d41e411eefd663fde22ef233041","user":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"repo":{"id":40787088,"name":"translate","full_name":"claudep/translate","owner":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/claudep/translate","description":"Useful localization tools with Python API for building localization & translation systems","fork":true,"url":"https://api.github.com/repos/claudep/translate","forks_url":"https://api.github.com/repos/claudep/translate/forks","keys_url":"https://api.github.com/repos/claudep/translate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/claudep/translate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/claudep/translate/teams","hooks_url":"https://api.github.com/repos/claudep/translate/hooks","issue_events_url":"https://api.github.com/repos/claudep/translate/issues/events{/number}","events_url":"https://api.github.com/repos/claudep/translate/events","assignees_url":"https://api.github.com/repos/claudep/translate/assignees{/user}","branches_url":"https://api.github.com/repos/claudep/translate/branches{/branch}","tags_url":"https://api.github.com/repos/claudep/translate/tags","blobs_url":"https://api.github.com/repos/claudep/translate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/claudep/translate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/claudep/translate/git/refs{/sha}","trees_url":"https://api.github.com/repos/claudep/translate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/claudep/translate/statuses/{sha}","languages_url":"https://api.github.com/repos/claudep/translate/languages","stargazers_url":"https://api.github.com/repos/claudep/translate/stargazers","contributors_url":"https://api.github.com/repos/claudep/translate/contributors","subscribers_url":"https://api.github.com/repos/claudep/translate/subscribers","subscription_url":"https://api.github.com/repos/claudep/translate/subscription","commits_url":"https://api.github.com/repos/claudep/translate/commits{/sha}","git_commits_url":"https://api.github.com/repos/claudep/translate/git/commits{/sha}","comments_url":"https://api.github.com/repos/claudep/translate/comments{/number}","issue_comment_url":"https://api.github.com/repos/claudep/translate/issues/comments{/number}","contents_url":"https://api.github.com/repos/claudep/translate/contents/{+path}","compare_url":"https://api.github.com/repos/claudep/translate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/claudep/translate/merges","archive_url":"https://api.github.com/repos/claudep/translate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/claudep/translate/downloads","issues_url":"https://api.github.com/repos/claudep/translate/issues{/number}","pulls_url":"https://api.github.com/repos/claudep/translate/pulls{/number}","milestones_url":"https://api.github.com/repos/claudep/translate/milestones{/number}","notifications_url":"https://api.github.com/repos/claudep/translate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/claudep/translate/labels{/name}","releases_url":"https://api.github.com/repos/claudep/translate/releases{/id}","created_at":"2015-08-15T21:48:10Z","updated_at":"2015-08-15T21:48:12Z","pushed_at":"2015-08-26T19:51:05Z","git_url":"git://github.com/claudep/translate.git","ssh_url":"git@github.com:claudep/translate.git","clone_url":"https://github.com/claudep/translate.git","svn_url":"https://github.com/claudep/translate","homepage":"http://toolkit.translatehouse.org","size":29357,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"translate:master","ref":"master","sha":"8949b96cd82f06ac1f468d752a7522ccb23527f6","user":{"login":"translate","id":1538178,"avatar_url":"https://avatars.githubusercontent.com/u/1538178?v=3","gravatar_id":"","url":"https://api.github.com/users/translate","html_url":"https://github.com/translate","followers_url":"https://api.github.com/users/translate/followers","following_url":"https://api.github.com/users/translate/following{/other_user}","gists_url":"https://api.github.com/users/translate/gists{/gist_id}","starred_url":"https://api.github.com/users/translate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/translate/subscriptions","organizations_url":"https://api.github.com/users/translate/orgs","repos_url":"https://api.github.com/users/translate/repos","events_url":"https://api.github.com/users/translate/events{/privacy}","received_events_url":"https://api.github.com/users/translate/received_events","type":"Organization","site_admin":false},"repo":{"id":3769696,"name":"translate","full_name":"translate/translate","owner":{"login":"translate","id":1538178,"avatar_url":"https://avatars.githubusercontent.com/u/1538178?v=3","gravatar_id":"","url":"https://api.github.com/users/translate","html_url":"https://github.com/translate","followers_url":"https://api.github.com/users/translate/followers","following_url":"https://api.github.com/users/translate/following{/other_user}","gists_url":"https://api.github.com/users/translate/gists{/gist_id}","starred_url":"https://api.github.com/users/translate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/translate/subscriptions","organizations_url":"https://api.github.com/users/translate/orgs","repos_url":"https://api.github.com/users/translate/repos","events_url":"https://api.github.com/users/translate/events{/privacy}","received_events_url":"https://api.github.com/users/translate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/translate/translate","description":"Useful localization tools with Python API for building localization & translation systems","fork":false,"url":"https://api.github.com/repos/translate/translate","forks_url":"https://api.github.com/repos/translate/translate/forks","keys_url":"https://api.github.com/repos/translate/translate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/translate/translate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/translate/translate/teams","hooks_url":"https://api.github.com/repos/translate/translate/hooks","issue_events_url":"https://api.github.com/repos/translate/translate/issues/events{/number}","events_url":"https://api.github.com/repos/translate/translate/events","assignees_url":"https://api.github.com/repos/translate/translate/assignees{/user}","branches_url":"https://api.github.com/repos/translate/translate/branches{/branch}","tags_url":"https://api.github.com/repos/translate/translate/tags","blobs_url":"https://api.github.com/repos/translate/translate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/translate/translate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/translate/translate/git/refs{/sha}","trees_url":"https://api.github.com/repos/translate/translate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/translate/translate/statuses/{sha}","languages_url":"https://api.github.com/repos/translate/translate/languages","stargazers_url":"https://api.github.com/repos/translate/translate/stargazers","contributors_url":"https://api.github.com/repos/translate/translate/contributors","subscribers_url":"https://api.github.com/repos/translate/translate/subscribers","subscription_url":"https://api.github.com/repos/translate/translate/subscription","commits_url":"https://api.github.com/repos/translate/translate/commits{/sha}","git_commits_url":"https://api.github.com/repos/translate/translate/git/commits{/sha}","comments_url":"https://api.github.com/repos/translate/translate/comments{/number}","issue_comment_url":"https://api.github.com/repos/translate/translate/issues/comments{/number}","contents_url":"https://api.github.com/repos/translate/translate/contents/{+path}","compare_url":"https://api.github.com/repos/translate/translate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/translate/translate/merges","archive_url":"https://api.github.com/repos/translate/translate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/translate/translate/downloads","issues_url":"https://api.github.com/repos/translate/translate/issues{/number}","pulls_url":"https://api.github.com/repos/translate/translate/pulls{/number}","milestones_url":"https://api.github.com/repos/translate/translate/milestones{/number}","notifications_url":"https://api.github.com/repos/translate/translate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/translate/translate/labels{/name}","releases_url":"https://api.github.com/repos/translate/translate/releases{/id}","created_at":"2012-03-19T23:05:29Z","updated_at":"2015-08-25T15:03:37Z","pushed_at":"2015-08-26T19:57:49Z","git_url":"git://github.com/translate/translate.git","ssh_url":"git@github.com:translate/translate.git","clone_url":"https://github.com/translate/translate.git","svn_url":"https://github.com/translate/translate","homepage":"http://toolkit.translatehouse.org","size":32588,"stargazers_count":171,"watchers_count":171,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":92,"mirror_url":null,"open_issues_count":314,"forks":92,"open_issues":314,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/translate/translate/pulls/3316"},"html":{"href":"https://github.com/translate/translate/pull/3316"},"issue":{"href":"https://api.github.com/repos/translate/translate/issues/3316"},"comments":{"href":"https://api.github.com/repos/translate/translate/issues/3316/comments"},"review_comments":{"href":"https://api.github.com/repos/translate/translate/pulls/3316/comments"},"review_comment":{"href":"https://api.github.com/repos/translate/translate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/translate/translate/pulls/3316/commits"},"statuses":{"href":"https://api.github.com/repos/translate/translate/statuses/0d1d041375cf4d41e411eefd663fde22ef233041"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":80,"deletions":64,"changed_files":32}}