{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/bleach/pulls/comments/48611145","id":48611145,"diff_hunk":"@@ -0,0 +1,132 @@\n+import sys\n+is_py_2 = sys.version_info[0] == 2\n+\n+\n+def read_suffix_list(content):\n+    '''\n+    Read and parse suffix list.\n+    '''\n+    # remove comment & blank line\n+    suffix_list = [line.lower().strip()\n+                   for line in contents\n+                   if not line.startswith('//') and line.strip()]\n+\n+    # find idna decodable suffixs\n+    idna_encoded_suffix_list = []\n+    for suffix in suffix_list:\n+        try:\n+            encoded = suffix.encode('idna').decode('ascii')\n+            if suffix != encoded:\n+                idna_encoded_suffix_list.append(encoded)\n+        except Exception:\n+            pass\n+\n+    idna_encoded_suffix_list.sort()\n+    # extend idna encoded suffix_list\n+    suffix_list.extend(idna_encoded_suffix_list)\n+\n+    suffix_list.sort()\n+\n+    return suffix_list\n+\n+\n+def write_suffix_py(o, suffix_list):\n+    '''\n+    Write suffix list as python source.\n+    '''\n+    o.write(\"# -*- coding: utf-8 -*-\\n\"","path":"suffix_update.py","position":37,"original_position":37,"commit_id":"61183b4a7f4da141de0dadf27b2c746706bbf0f3","original_commit_id":"61183b4a7f4da141de0dadf27b2c746706bbf0f3","user":{"login":"willkg","id":820826,"avatar_url":"https://avatars.githubusercontent.com/u/820826?v=3","gravatar_id":"","url":"https://api.github.com/users/willkg","html_url":"https://github.com/willkg","followers_url":"https://api.github.com/users/willkg/followers","following_url":"https://api.github.com/users/willkg/following{/other_user}","gists_url":"https://api.github.com/users/willkg/gists{/gist_id}","starred_url":"https://api.github.com/users/willkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willkg/subscriptions","organizations_url":"https://api.github.com/users/willkg/orgs","repos_url":"https://api.github.com/users/willkg/repos","events_url":"https://api.github.com/users/willkg/events{/privacy}","received_events_url":"https://api.github.com/users/willkg/received_events","type":"User","site_admin":false},"body":"I'm not a big fan of one-letter variables like `o`. Can you rename this variable to something more helpful?","created_at":"2015-12-30T15:49:59Z","updated_at":"2015-12-30T15:49:59Z","html_url":"https://github.com/mozilla/bleach/pull/159#discussion_r48611145","pull_request_url":"https://api.github.com/repos/mozilla/bleach/pulls/159","_links":{"self":{"href":"https://api.github.com/repos/mozilla/bleach/pulls/comments/48611145"},"html":{"href":"https://github.com/mozilla/bleach/pull/159#discussion_r48611145"},"pull_request":{"href":"https://api.github.com/repos/mozilla/bleach/pulls/159"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/bleach/pulls/159","id":41671808,"html_url":"https://github.com/mozilla/bleach/pull/159","diff_url":"https://github.com/mozilla/bleach/pull/159.diff","patch_url":"https://github.com/mozilla/bleach/pull/159.patch","issue_url":"https://api.github.com/repos/mozilla/bleach/issues/159","number":159,"state":"open","locked":false,"title":"Add TLDs from IANA TLD list","user":{"login":"Perlmint","id":1064275,"avatar_url":"https://avatars.githubusercontent.com/u/1064275?v=3","gravatar_id":"","url":"https://api.github.com/users/Perlmint","html_url":"https://github.com/Perlmint","followers_url":"https://api.github.com/users/Perlmint/followers","following_url":"https://api.github.com/users/Perlmint/following{/other_user}","gists_url":"https://api.github.com/users/Perlmint/gists{/gist_id}","starred_url":"https://api.github.com/users/Perlmint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perlmint/subscriptions","organizations_url":"https://api.github.com/users/Perlmint/orgs","repos_url":"https://api.github.com/users/Perlmint/repos","events_url":"https://api.github.com/users/Perlmint/events{/privacy}","received_events_url":"https://api.github.com/users/Perlmint/received_events","type":"User","site_admin":false},"body":"[All valid TLD list](http://data.iana.org/TLD/tlds-alpha-by-domain.txt) provided by ICANN(IANA)  \r\nList was generated by this script : https://gist.github.com/Perlmint/b125232975e8c6ba5243","created_at":"2015-08-05T12:12:24Z","updated_at":"2015-12-30T15:49:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c87bde9528622ce6e682dfa320db4200aceba114","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/bleach/pulls/159/commits","review_comments_url":"https://api.github.com/repos/mozilla/bleach/pulls/159/comments","review_comment_url":"https://api.github.com/repos/mozilla/bleach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/bleach/issues/159/comments","statuses_url":"https://api.github.com/repos/mozilla/bleach/statuses/61183b4a7f4da141de0dadf27b2c746706bbf0f3","head":{"label":"Perlmint:feature/update_tld","ref":"feature/update_tld","sha":"61183b4a7f4da141de0dadf27b2c746706bbf0f3","user":{"login":"Perlmint","id":1064275,"avatar_url":"https://avatars.githubusercontent.com/u/1064275?v=3","gravatar_id":"","url":"https://api.github.com/users/Perlmint","html_url":"https://github.com/Perlmint","followers_url":"https://api.github.com/users/Perlmint/followers","following_url":"https://api.github.com/users/Perlmint/following{/other_user}","gists_url":"https://api.github.com/users/Perlmint/gists{/gist_id}","starred_url":"https://api.github.com/users/Perlmint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perlmint/subscriptions","organizations_url":"https://api.github.com/users/Perlmint/orgs","repos_url":"https://api.github.com/users/Perlmint/repos","events_url":"https://api.github.com/users/Perlmint/events{/privacy}","received_events_url":"https://api.github.com/users/Perlmint/received_events","type":"User","site_admin":false},"repo":{"id":40185165,"name":"bleach","full_name":"Perlmint/bleach","owner":{"login":"Perlmint","id":1064275,"avatar_url":"https://avatars.githubusercontent.com/u/1064275?v=3","gravatar_id":"","url":"https://api.github.com/users/Perlmint","html_url":"https://github.com/Perlmint","followers_url":"https://api.github.com/users/Perlmint/followers","following_url":"https://api.github.com/users/Perlmint/following{/other_user}","gists_url":"https://api.github.com/users/Perlmint/gists{/gist_id}","starred_url":"https://api.github.com/users/Perlmint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perlmint/subscriptions","organizations_url":"https://api.github.com/users/Perlmint/orgs","repos_url":"https://api.github.com/users/Perlmint/repos","events_url":"https://api.github.com/users/Perlmint/events{/privacy}","received_events_url":"https://api.github.com/users/Perlmint/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Perlmint/bleach","description":"An easy, HTML5, whitelisting HTML sanitizer.","fork":true,"url":"https://api.github.com/repos/Perlmint/bleach","forks_url":"https://api.github.com/repos/Perlmint/bleach/forks","keys_url":"https://api.github.com/repos/Perlmint/bleach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Perlmint/bleach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Perlmint/bleach/teams","hooks_url":"https://api.github.com/repos/Perlmint/bleach/hooks","issue_events_url":"https://api.github.com/repos/Perlmint/bleach/issues/events{/number}","events_url":"https://api.github.com/repos/Perlmint/bleach/events","assignees_url":"https://api.github.com/repos/Perlmint/bleach/assignees{/user}","branches_url":"https://api.github.com/repos/Perlmint/bleach/branches{/branch}","tags_url":"https://api.github.com/repos/Perlmint/bleach/tags","blobs_url":"https://api.github.com/repos/Perlmint/bleach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Perlmint/bleach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Perlmint/bleach/git/refs{/sha}","trees_url":"https://api.github.com/repos/Perlmint/bleach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Perlmint/bleach/statuses/{sha}","languages_url":"https://api.github.com/repos/Perlmint/bleach/languages","stargazers_url":"https://api.github.com/repos/Perlmint/bleach/stargazers","contributors_url":"https://api.github.com/repos/Perlmint/bleach/contributors","subscribers_url":"https://api.github.com/repos/Perlmint/bleach/subscribers","subscription_url":"https://api.github.com/repos/Perlmint/bleach/subscription","commits_url":"https://api.github.com/repos/Perlmint/bleach/commits{/sha}","git_commits_url":"https://api.github.com/repos/Perlmint/bleach/git/commits{/sha}","comments_url":"https://api.github.com/repos/Perlmint/bleach/comments{/number}","issue_comment_url":"https://api.github.com/repos/Perlmint/bleach/issues/comments{/number}","contents_url":"https://api.github.com/repos/Perlmint/bleach/contents/{+path}","compare_url":"https://api.github.com/repos/Perlmint/bleach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Perlmint/bleach/merges","archive_url":"https://api.github.com/repos/Perlmint/bleach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Perlmint/bleach/downloads","issues_url":"https://api.github.com/repos/Perlmint/bleach/issues{/number}","pulls_url":"https://api.github.com/repos/Perlmint/bleach/pulls{/number}","milestones_url":"https://api.github.com/repos/Perlmint/bleach/milestones{/number}","notifications_url":"https://api.github.com/repos/Perlmint/bleach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Perlmint/bleach/labels{/name}","releases_url":"https://api.github.com/repos/Perlmint/bleach/releases{/id}","created_at":"2015-08-04T13:03:59Z","updated_at":"2015-08-04T13:04:00Z","pushed_at":"2015-12-20T10:13:38Z","git_url":"git://github.com/Perlmint/bleach.git","ssh_url":"git@github.com:Perlmint/bleach.git","clone_url":"https://github.com/Perlmint/bleach.git","svn_url":"https://github.com/Perlmint/bleach","homepage":"","size":415,"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":"mozilla:master","ref":"master","sha":"3b5e5b1180484ac0cc22b7948c093a0eafbd8045","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":525316,"name":"bleach","full_name":"mozilla/bleach","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/bleach","description":"An easy, HTML5, whitelisting HTML sanitizer.","fork":false,"url":"https://api.github.com/repos/mozilla/bleach","forks_url":"https://api.github.com/repos/mozilla/bleach/forks","keys_url":"https://api.github.com/repos/mozilla/bleach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/bleach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/bleach/teams","hooks_url":"https://api.github.com/repos/mozilla/bleach/hooks","issue_events_url":"https://api.github.com/repos/mozilla/bleach/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/bleach/events","assignees_url":"https://api.github.com/repos/mozilla/bleach/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/bleach/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/bleach/tags","blobs_url":"https://api.github.com/repos/mozilla/bleach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/bleach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/bleach/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/bleach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/bleach/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/bleach/languages","stargazers_url":"https://api.github.com/repos/mozilla/bleach/stargazers","contributors_url":"https://api.github.com/repos/mozilla/bleach/contributors","subscribers_url":"https://api.github.com/repos/mozilla/bleach/subscribers","subscription_url":"https://api.github.com/repos/mozilla/bleach/subscription","commits_url":"https://api.github.com/repos/mozilla/bleach/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/bleach/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/bleach/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/bleach/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/bleach/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/bleach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/bleach/merges","archive_url":"https://api.github.com/repos/mozilla/bleach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/bleach/downloads","issues_url":"https://api.github.com/repos/mozilla/bleach/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/bleach/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/bleach/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/bleach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/bleach/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/bleach/releases{/id}","created_at":"2010-02-19T01:12:41Z","updated_at":"2015-12-28T16:20:47Z","pushed_at":"2015-12-30T15:35:19Z","git_url":"git://github.com/mozilla/bleach.git","ssh_url":"git@github.com:mozilla/bleach.git","clone_url":"https://github.com/mozilla/bleach.git","svn_url":"https://github.com/mozilla/bleach","homepage":"","size":552,"stargazers_count":937,"watchers_count":937,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":98,"mirror_url":null,"open_issues_count":36,"forks":98,"open_issues":36,"watchers":937,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/bleach/pulls/159"},"html":{"href":"https://github.com/mozilla/bleach/pull/159"},"issue":{"href":"https://api.github.com/repos/mozilla/bleach/issues/159"},"comments":{"href":"https://api.github.com/repos/mozilla/bleach/issues/159/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/bleach/pulls/159/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/bleach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/bleach/pulls/159/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/bleach/statuses/61183b4a7f4da141de0dadf27b2c746706bbf0f3"}}}}