{"action":"created","comment":{"url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments/49402077","id":49402077,"diff_hunk":"@@ -759,31 +759,46 @@ def unescape_lists(val):\n \n         tpairs = []\n \n-        for row in soup.findall('.//tr'):\n-            try:\n-                e_key, e_val = row.findall('./*')[:2]\n-            except ValueError:\n-                continue\n+        elems = soup.findall('.//tr')\n+        if elems:\n+            for row in elems:\n+                try:\n+                    e_key, e_val = row.findall('./*')[:2]\n+                except ValueError:\n+                    continue\n \n-            if e_key is not None and e_val is not None:\n-                # Turn the key into xml string, parse the other tags\n-                # making brs into newlines, parse the rest of the\n-                # tags, get the text back\n-                key = totext(fromstring(tostring(e_key), literal_newlines=True))\n+                if e_key is not None and e_val is not None:\n \n-                # replace multiple spaces (including nbsp) with a single space\n-                key = re.sub(r\"\\s+\", u\" \", key, flags=re.U).strip()\n+                    # Turn the key into xml string, parse the other tags\n+                    # making brs into newlines, parse the rest of the\n+                    # tags, get the text back\n+                    key = totext(fromstring(tostring(e_key), literal_newlines=True))\n \n-                val = escape_lists(tostring(e_val))\n-                # Extract text\n-                val = fromstring(val)\n-                val = totext(val)\n+                    # replace multiple spaces (including nbsp) with a single space\n+                    key = re.sub(r\"\\s+\", u\" \", key, flags=re.U).strip()\n \n-                # replace nbsp (unicode code 160) with space\n-                val = val.replace(unichr(160), u' ')\n+                    val = escape_lists(tostring(e_val))\n+                    # Extract text\n+                    val = fromstring(val)\n+                    val = totext(val)\n \n-                val = unescape_lists(val.strip())","path":"wikipediabase/infobox.py","position":45,"original_position":45,"commit_id":"2d1def7a02991defe470774b721fe79178013fe9","original_commit_id":"2d1def7a02991defe470774b721fe79178013fe9","user":{"login":"alvaromorales","id":2496170,"avatar_url":"https://avatars.githubusercontent.com/u/2496170?v=3","gravatar_id":"","url":"https://api.github.com/users/alvaromorales","html_url":"https://github.com/alvaromorales","followers_url":"https://api.github.com/users/alvaromorales/followers","following_url":"https://api.github.com/users/alvaromorales/following{/other_user}","gists_url":"https://api.github.com/users/alvaromorales/gists{/gist_id}","starred_url":"https://api.github.com/users/alvaromorales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvaromorales/subscriptions","organizations_url":"https://api.github.com/users/alvaromorales/orgs","repos_url":"https://api.github.com/users/alvaromorales/repos","events_url":"https://api.github.com/users/alvaromorales/events{/privacy}","received_events_url":"https://api.github.com/users/alvaromorales/received_events","type":"User","site_admin":false},"body":"why did you remove the calls to `escape_list` and `unescape_lists`?","created_at":"2016-01-12T00:47:22Z","updated_at":"2016-01-12T00:47:22Z","html_url":"https://github.com/infolab-csail/WikipediaBase/pull/134#discussion_r49402077","pull_request_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments/49402077"},"html":{"href":"https://github.com/infolab-csail/WikipediaBase/pull/134#discussion_r49402077"},"pull_request":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134","id":55680863,"html_url":"https://github.com/infolab-csail/WikipediaBase/pull/134","diff_url":"https://github.com/infolab-csail/WikipediaBase/pull/134.diff","patch_url":"https://github.com/infolab-csail/WikipediaBase/pull/134.patch","issue_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/134","number":134,"state":"open","locked":false,"title":"Add parsing capabilities for aicraft type infobox","user":{"login":"cordeliaavery","id":12588612,"avatar_url":"https://avatars.githubusercontent.com/u/12588612?v=3","gravatar_id":"","url":"https://api.github.com/users/cordeliaavery","html_url":"https://github.com/cordeliaavery","followers_url":"https://api.github.com/users/cordeliaavery/followers","following_url":"https://api.github.com/users/cordeliaavery/following{/other_user}","gists_url":"https://api.github.com/users/cordeliaavery/gists{/gist_id}","starred_url":"https://api.github.com/users/cordeliaavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cordeliaavery/subscriptions","organizations_url":"https://api.github.com/users/cordeliaavery/orgs","repos_url":"https://api.github.com/users/cordeliaavery/repos","events_url":"https://api.github.com/users/cordeliaavery/events{/privacy}","received_events_url":"https://api.github.com/users/cordeliaavery/received_events","type":"User","site_admin":false},"body":"Fixes #98 ","created_at":"2016-01-11T21:31:12Z","updated_at":"2016-01-12T00:47:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99a5039d47d2873b1db92433a3b8e38e0e51d8b8","assignee":{"login":"alvaromorales","id":2496170,"avatar_url":"https://avatars.githubusercontent.com/u/2496170?v=3","gravatar_id":"","url":"https://api.github.com/users/alvaromorales","html_url":"https://github.com/alvaromorales","followers_url":"https://api.github.com/users/alvaromorales/followers","following_url":"https://api.github.com/users/alvaromorales/following{/other_user}","gists_url":"https://api.github.com/users/alvaromorales/gists{/gist_id}","starred_url":"https://api.github.com/users/alvaromorales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvaromorales/subscriptions","organizations_url":"https://api.github.com/users/alvaromorales/orgs","repos_url":"https://api.github.com/users/alvaromorales/repos","events_url":"https://api.github.com/users/alvaromorales/events{/privacy}","received_events_url":"https://api.github.com/users/alvaromorales/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134/commits","review_comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134/comments","review_comment_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/134/comments","statuses_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/2d1def7a02991defe470774b721fe79178013fe9","head":{"label":"infolab-csail:issue_98","ref":"issue_98","sha":"2d1def7a02991defe470774b721fe79178013fe9","user":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"repo":{"id":15544139,"name":"WikipediaBase","full_name":"infolab-csail/WikipediaBase","owner":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infolab-csail/WikipediaBase","description":"Wikipedia interaction with start.mit.edu","fork":false,"url":"https://api.github.com/repos/infolab-csail/WikipediaBase","forks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/forks","keys_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/teams","hooks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/hooks","issue_events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/events{/number}","events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/events","assignees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/assignees{/user}","branches_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/branches{/branch}","tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/tags","blobs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/refs{/sha}","trees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/{sha}","languages_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/languages","stargazers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/stargazers","contributors_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contributors","subscribers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscribers","subscription_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscription","commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/commits{/sha}","git_commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/commits{/sha}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/comments{/number}","issue_comment_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/comments{/number}","contents_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contents/{+path}","compare_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/merges","archive_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/downloads","issues_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues{/number}","pulls_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls{/number}","milestones_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/milestones{/number}","notifications_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/labels{/name}","releases_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/releases{/id}","created_at":"2013-12-31T06:02:34Z","updated_at":"2015-08-11T08:24:18Z","pushed_at":"2016-01-11T22:54:38Z","git_url":"git://github.com/infolab-csail/WikipediaBase.git","ssh_url":"git@github.com:infolab-csail/WikipediaBase.git","clone_url":"https://github.com/infolab-csail/WikipediaBase.git","svn_url":"https://github.com/infolab-csail/WikipediaBase","homepage":null,"size":8619,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":43,"forks":2,"open_issues":43,"watchers":0,"default_branch":"master"}},"base":{"label":"infolab-csail:master","ref":"master","sha":"f689603347e8894dbb79bfba32621712131e9cfa","user":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"repo":{"id":15544139,"name":"WikipediaBase","full_name":"infolab-csail/WikipediaBase","owner":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infolab-csail/WikipediaBase","description":"Wikipedia interaction with start.mit.edu","fork":false,"url":"https://api.github.com/repos/infolab-csail/WikipediaBase","forks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/forks","keys_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/teams","hooks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/hooks","issue_events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/events{/number}","events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/events","assignees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/assignees{/user}","branches_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/branches{/branch}","tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/tags","blobs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/refs{/sha}","trees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/{sha}","languages_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/languages","stargazers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/stargazers","contributors_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contributors","subscribers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscribers","subscription_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscription","commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/commits{/sha}","git_commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/commits{/sha}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/comments{/number}","issue_comment_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/comments{/number}","contents_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contents/{+path}","compare_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/merges","archive_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/downloads","issues_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues{/number}","pulls_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls{/number}","milestones_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/milestones{/number}","notifications_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/labels{/name}","releases_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/releases{/id}","created_at":"2013-12-31T06:02:34Z","updated_at":"2015-08-11T08:24:18Z","pushed_at":"2016-01-11T22:54:38Z","git_url":"git://github.com/infolab-csail/WikipediaBase.git","ssh_url":"git@github.com:infolab-csail/WikipediaBase.git","clone_url":"https://github.com/infolab-csail/WikipediaBase.git","svn_url":"https://github.com/infolab-csail/WikipediaBase","homepage":null,"size":8619,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":43,"forks":2,"open_issues":43,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134"},"html":{"href":"https://github.com/infolab-csail/WikipediaBase/pull/134"},"issue":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/134"},"comments":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/2d1def7a02991defe470774b721fe79178013fe9"}}}}