{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/65595003","id":65595003,"diff_hunk":"@@ -604,3 +605,28 @@ def test_write_quoted_empty_field(fast_writer):\n     out = StringIO()\n     ascii.write(t, out, fast_writer=fast_writer, delimiter=',')\n     assert out.getvalue().splitlines() == ['col0,col1', 'Hello,', ',']\n+\n+@pytest.mark.parametrize(\"format\", ['ascii', 'csv', 'html', 'latex',\n+                                    'ascii.fixed_width', 'html'])\n+@pytest.mark.parametrize(\"fast_writer\", [True, False])\n+def test_write_overwrite_ascii(format, fast_writer):\n+    \"\"\"Test overwrite argument for various ASCII writers\"\"\"\n+    with tempfile.NamedTemporaryFile(mode='w', prefix='table', suffix='.dat',\n+                                     delete=True) as fp:\n+        filename = fp.name\n+        t = table.Table([['Hello', ''], ['', '']], dtype=['S10', 'S10'])\n+        with pytest.raises(IOError) as err:\n+            t.write(filename, overwrite=False, format=format)\n+        assert str(err.value).endswith('already exists')\n+\n+        with catch_warnings(AstropyDeprecationWarning) as warning:\n+            t.write(filename, format=format)\n+        assert len(warning) == 1\n+        assert str(warning[0].message) == (\n+            \"Automatically overwriting ASCII files is deprecated. \"\n+            \"Use the argument 'overwrite=True' in the future.\")\n+\n+        # If the output is a file object, overwrite is ignored\n+        t.write(fp.file, format=format)\n+        t.write(fp.file, overwrite=False, format=format)\n+        t.write(fp.file, overwrite=True, format=format)","path":"astropy/io/ascii/tests/test_write.py","position":43,"original_position":43,"commit_id":"cfbcf226b277076a97af6c033c30f9016d12a267","original_commit_id":"cfbcf226b277076a97af6c033c30f9016d12a267","user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"body":"Test of writing to a string filename with `overwrite=True`?","created_at":"2016-06-02T18:39:32Z","updated_at":"2016-06-02T18:39:32Z","html_url":"https://github.com/astropy/astropy/pull/5007#discussion_r65595003","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/5007","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/65595003"},"html":{"href":"https://github.com/astropy/astropy/pull/5007#discussion_r65595003"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5007"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/5007","id":72281721,"html_url":"https://github.com/astropy/astropy/pull/5007","diff_url":"https://github.com/astropy/astropy/pull/5007.diff","patch_url":"https://github.com/astropy/astropy/pull/5007.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/5007","number":5007,"state":"open","locked":false,"title":"Add ``overwrite`` parameter to ascii writers","user":{"login":"evertrol","id":735460,"avatar_url":"https://avatars.githubusercontent.com/u/735460?v=3","gravatar_id":"","url":"https://api.github.com/users/evertrol","html_url":"https://github.com/evertrol","followers_url":"https://api.github.com/users/evertrol/followers","following_url":"https://api.github.com/users/evertrol/following{/other_user}","gists_url":"https://api.github.com/users/evertrol/gists{/gist_id}","starred_url":"https://api.github.com/users/evertrol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evertrol/subscriptions","organizations_url":"https://api.github.com/users/evertrol/orgs","repos_url":"https://api.github.com/users/evertrol/repos","events_url":"https://api.github.com/users/evertrol/events{/privacy}","received_events_url":"https://api.github.com/users/evertrol/received_events","type":"User","site_admin":false},"body":"Possible solution to #1233.\r\n\r\nFor transition purposes, an AstropyDeprecationWarning is issued if the\r\nparameter is not specified and a file is silently overwritten (as was\r\ndone before).","created_at":"2016-06-02T02:42:26Z","updated_at":"2016-06-02T18:39:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbaaca09888e45dc14939b865c51256eaf8fc27a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/5007/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/5007/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/5007/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/cfbcf226b277076a97af6c033c30f9016d12a267","head":{"label":"evertrol:ascii-table-overwrite","ref":"ascii-table-overwrite","sha":"cfbcf226b277076a97af6c033c30f9016d12a267","user":{"login":"evertrol","id":735460,"avatar_url":"https://avatars.githubusercontent.com/u/735460?v=3","gravatar_id":"","url":"https://api.github.com/users/evertrol","html_url":"https://github.com/evertrol","followers_url":"https://api.github.com/users/evertrol/followers","following_url":"https://api.github.com/users/evertrol/following{/other_user}","gists_url":"https://api.github.com/users/evertrol/gists{/gist_id}","starred_url":"https://api.github.com/users/evertrol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evertrol/subscriptions","organizations_url":"https://api.github.com/users/evertrol/orgs","repos_url":"https://api.github.com/users/evertrol/repos","events_url":"https://api.github.com/users/evertrol/events{/privacy}","received_events_url":"https://api.github.com/users/evertrol/received_events","type":"User","site_admin":false},"repo":{"id":39122362,"name":"astropy","full_name":"evertrol/astropy","owner":{"login":"evertrol","id":735460,"avatar_url":"https://avatars.githubusercontent.com/u/735460?v=3","gravatar_id":"","url":"https://api.github.com/users/evertrol","html_url":"https://github.com/evertrol","followers_url":"https://api.github.com/users/evertrol/followers","following_url":"https://api.github.com/users/evertrol/following{/other_user}","gists_url":"https://api.github.com/users/evertrol/gists{/gist_id}","starred_url":"https://api.github.com/users/evertrol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evertrol/subscriptions","organizations_url":"https://api.github.com/users/evertrol/orgs","repos_url":"https://api.github.com/users/evertrol/repos","events_url":"https://api.github.com/users/evertrol/events{/privacy}","received_events_url":"https://api.github.com/users/evertrol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evertrol/astropy","description":"Repository for the Astropy core package","fork":true,"url":"https://api.github.com/repos/evertrol/astropy","forks_url":"https://api.github.com/repos/evertrol/astropy/forks","keys_url":"https://api.github.com/repos/evertrol/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evertrol/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evertrol/astropy/teams","hooks_url":"https://api.github.com/repos/evertrol/astropy/hooks","issue_events_url":"https://api.github.com/repos/evertrol/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/evertrol/astropy/events","assignees_url":"https://api.github.com/repos/evertrol/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/evertrol/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/evertrol/astropy/tags","blobs_url":"https://api.github.com/repos/evertrol/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evertrol/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evertrol/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/evertrol/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evertrol/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/evertrol/astropy/languages","stargazers_url":"https://api.github.com/repos/evertrol/astropy/stargazers","contributors_url":"https://api.github.com/repos/evertrol/astropy/contributors","subscribers_url":"https://api.github.com/repos/evertrol/astropy/subscribers","subscription_url":"https://api.github.com/repos/evertrol/astropy/subscription","commits_url":"https://api.github.com/repos/evertrol/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/evertrol/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/evertrol/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/evertrol/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/evertrol/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/evertrol/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evertrol/astropy/merges","archive_url":"https://api.github.com/repos/evertrol/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evertrol/astropy/downloads","issues_url":"https://api.github.com/repos/evertrol/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/evertrol/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/evertrol/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/evertrol/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evertrol/astropy/labels{/name}","releases_url":"https://api.github.com/repos/evertrol/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/evertrol/astropy/deployments","created_at":"2015-07-15T07:17:54Z","updated_at":"2015-07-15T07:17:58Z","pushed_at":"2016-06-02T02:43:02Z","git_url":"git://github.com/evertrol/astropy.git","ssh_url":"git@github.com:evertrol/astropy.git","clone_url":"https://github.com/evertrol/astropy.git","svn_url":"https://github.com/evertrol/astropy","homepage":"www.astropy.org","size":46615,"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":"astropy:master","ref":"master","sha":"0728abca28ab2604a799b6b53c7d2a39735238e6","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"name":"astropy","full_name":"astropy/astropy","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/astropy/astropy/deployments","created_at":"2011-07-21T01:33:49Z","updated_at":"2016-06-02T16:00:12Z","pushed_at":"2016-06-02T18:26:35Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":66461,"stargazers_count":863,"watchers_count":863,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":550,"mirror_url":null,"open_issues_count":720,"forks":550,"open_issues":720,"watchers":863,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5007"},"html":{"href":"https://github.com/astropy/astropy/pull/5007"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/5007"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/5007/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5007/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/5007/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/cfbcf226b277076a97af6c033c30f9016d12a267"}}}}
{"actor":{"display_login":"taldcroft"}}