-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing a FITS file should not warn when clobber is set to True #1963
Comments
I agree, I always find it strange that the warning is emitted when clobber is explicitly set. |
👍 |
1 similar comment
👍 |
Note: This is a duplicate of spacetelescope/PyFITS#43 so when it's fixed there the fix will be backported to Astropy. When the issue first came up I asked around about it a bit and the general consensus seems to be in favor of this change (I wouldn't ask at all except that this behavior has been in PyFITS going back many years!) |
I should add: The original motivation for this is reasonable: PyFITS is very often used in applications, and in this case the user of that application or other third-party library may not be aware that the developer of that application wrote |
👍 |
Any news on that? The patch in itself is quite simple (just remove a call to warn)... Would a PR help? |
A PR would always help. I agree with this issue but it's pretty low priority for me. |
Fixed by #2786. |
Currently, a user warning ("Overwriting existing file ...") is raised in
astropy.io.fits.file
, and inastropy.io.fits.hdu.table
when writing a FITS file would overwrite an existing file. But such an overwrite can happen only if the user explicitly passedclobber=True
to the writing function; moreover the warning is too late anyways as the file is going to be overwritten (... except if the user can Ctrl-C very quickly).I know warnings can be silenced but I don't think this situation actually warrants a warning.
The text was updated successfully, but these errors were encountered: