{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/40213086","id":40213086,"diff_hunk":"@@ -32,6 +33,16 @@ class GeoIPTest(unittest.TestCase):\n     addr = '128.249.1.1'\n     fqdn = 'tmc.edu'\n \n+    def _is_dns_available(self, domain):\n+        # Naive check to see if there is DNS available to use.\n+        # Used to conditionally skip fqdn geoip checks.\n+        # See #25407 for details.\n+        try:\n+            socket.gethostbyname(domain)\n+            return True\n+        except:","path":"tests/gis_tests/test_geoip.py","position":19,"original_position":19,"commit_id":"d404e4b3545742917fd8c661340acc55e581c0a9","original_commit_id":"d404e4b3545742917fd8c661340acc55e581c0a9","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"This seems fine for deprecated code, but could we please avoid a bare except?","created_at":"2015-09-23T14:55:47Z","updated_at":"2015-09-23T14:55:47Z","html_url":"https://github.com/django/django/pull/5343#discussion_r40213086","pull_request_url":"https://api.github.com/repos/django/django/pulls/5343","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/40213086"},"html":{"href":"https://github.com/django/django/pull/5343#discussion_r40213086"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/5343"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/5343","id":45778416,"html_url":"https://github.com/django/django/pull/5343","diff_url":"https://github.com/django/django/pull/5343.diff","patch_url":"https://github.com/django/django/pull/5343.patch","issue_url":"https://api.github.com/repos/django/django/issues/5343","number":5343,"state":"open","locked":false,"title":"Remove network dependency in GeoIP tests","user":{"login":"bak1an","id":242988,"avatar_url":"https://avatars.githubusercontent.com/u/242988?v=3","gravatar_id":"","url":"https://api.github.com/users/bak1an","html_url":"https://github.com/bak1an","followers_url":"https://api.github.com/users/bak1an/followers","following_url":"https://api.github.com/users/bak1an/following{/other_user}","gists_url":"https://api.github.com/users/bak1an/gists{/gist_id}","starred_url":"https://api.github.com/users/bak1an/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bak1an/subscriptions","organizations_url":"https://api.github.com/users/bak1an/orgs","repos_url":"https://api.github.com/users/bak1an/repos","events_url":"https://api.github.com/users/bak1an/events{/privacy}","received_events_url":"https://api.github.com/users/bak1an/received_events","type":"User","site_admin":false},"body":"https://code.djangoproject.com/ticket/25407\r\n\r\nThis PR includes 2 commits. \r\n\r\nThe first one is for mocking DNS resolution for `geoip2` tests. \r\nThe second one is optional and contains same issue workaround for `geoip` tests. See trac ticket for more details. The second commit can be either thrown away upon check in or squashed. ","created_at":"2015-09-23T13:27:15Z","updated_at":"2015-09-23T14:55:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6014a557bddfc178ad81d8693c576a2a36a1c79d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/5343/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/5343/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/5343/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/d404e4b3545742917fd8c661340acc55e581c0a9","head":{"label":"bak1an:ticket_25407_gis_tests","ref":"ticket_25407_gis_tests","sha":"d404e4b3545742917fd8c661340acc55e581c0a9","user":{"login":"bak1an","id":242988,"avatar_url":"https://avatars.githubusercontent.com/u/242988?v=3","gravatar_id":"","url":"https://api.github.com/users/bak1an","html_url":"https://github.com/bak1an","followers_url":"https://api.github.com/users/bak1an/followers","following_url":"https://api.github.com/users/bak1an/following{/other_user}","gists_url":"https://api.github.com/users/bak1an/gists{/gist_id}","starred_url":"https://api.github.com/users/bak1an/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bak1an/subscriptions","organizations_url":"https://api.github.com/users/bak1an/orgs","repos_url":"https://api.github.com/users/bak1an/repos","events_url":"https://api.github.com/users/bak1an/events{/privacy}","received_events_url":"https://api.github.com/users/bak1an/received_events","type":"User","site_admin":false},"repo":{"id":5245296,"name":"django","full_name":"bak1an/django","owner":{"login":"bak1an","id":242988,"avatar_url":"https://avatars.githubusercontent.com/u/242988?v=3","gravatar_id":"","url":"https://api.github.com/users/bak1an","html_url":"https://github.com/bak1an","followers_url":"https://api.github.com/users/bak1an/followers","following_url":"https://api.github.com/users/bak1an/following{/other_user}","gists_url":"https://api.github.com/users/bak1an/gists{/gist_id}","starred_url":"https://api.github.com/users/bak1an/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bak1an/subscriptions","organizations_url":"https://api.github.com/users/bak1an/orgs","repos_url":"https://api.github.com/users/bak1an/repos","events_url":"https://api.github.com/users/bak1an/events{/privacy}","received_events_url":"https://api.github.com/users/bak1an/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bak1an/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/bak1an/django","forks_url":"https://api.github.com/repos/bak1an/django/forks","keys_url":"https://api.github.com/repos/bak1an/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bak1an/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bak1an/django/teams","hooks_url":"https://api.github.com/repos/bak1an/django/hooks","issue_events_url":"https://api.github.com/repos/bak1an/django/issues/events{/number}","events_url":"https://api.github.com/repos/bak1an/django/events","assignees_url":"https://api.github.com/repos/bak1an/django/assignees{/user}","branches_url":"https://api.github.com/repos/bak1an/django/branches{/branch}","tags_url":"https://api.github.com/repos/bak1an/django/tags","blobs_url":"https://api.github.com/repos/bak1an/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bak1an/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bak1an/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/bak1an/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bak1an/django/statuses/{sha}","languages_url":"https://api.github.com/repos/bak1an/django/languages","stargazers_url":"https://api.github.com/repos/bak1an/django/stargazers","contributors_url":"https://api.github.com/repos/bak1an/django/contributors","subscribers_url":"https://api.github.com/repos/bak1an/django/subscribers","subscription_url":"https://api.github.com/repos/bak1an/django/subscription","commits_url":"https://api.github.com/repos/bak1an/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/bak1an/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/bak1an/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/bak1an/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/bak1an/django/contents/{+path}","compare_url":"https://api.github.com/repos/bak1an/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bak1an/django/merges","archive_url":"https://api.github.com/repos/bak1an/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bak1an/django/downloads","issues_url":"https://api.github.com/repos/bak1an/django/issues{/number}","pulls_url":"https://api.github.com/repos/bak1an/django/pulls{/number}","milestones_url":"https://api.github.com/repos/bak1an/django/milestones{/number}","notifications_url":"https://api.github.com/repos/bak1an/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bak1an/django/labels{/name}","releases_url":"https://api.github.com/repos/bak1an/django/releases{/id}","created_at":"2012-07-31T12:06:21Z","updated_at":"2015-02-25T10:52:30Z","pushed_at":"2015-09-23T13:20:40Z","git_url":"git://github.com/bak1an/django.git","ssh_url":"git@github.com:bak1an/django.git","clone_url":"https://github.com/bak1an/django.git","svn_url":"https://github.com/bak1an/django","homepage":"http://www.djangoproject.com/","size":119176,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"django:master","ref":"master","sha":"f06ce6053cae6a96ecce29ce2020789945757bf4","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-09-23T14:03:43Z","pushed_at":"2015-09-23T14:28:32Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":316064,"stargazers_count":16058,"watchers_count":16058,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6467,"mirror_url":null,"open_issues_count":62,"forks":6467,"open_issues":62,"watchers":16058,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/5343"},"html":{"href":"https://github.com/django/django/pull/5343"},"issue":{"href":"https://api.github.com/repos/django/django/issues/5343"},"comments":{"href":"https://api.github.com/repos/django/django/issues/5343/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/5343/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/5343/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/d404e4b3545742917fd8c661340acc55e581c0a9"}}}}