You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.
This is a corner case I found with the help of Sara Ogaz.
If I have two FITS files A and B opened with memmap=True (the default) and A open in update mode, if I do something like A[0].data = B[0].data, and then A.flush() this should replace the data for A's first HDU with the data from B's first HDU.
But in fact that doesn't happen. Somewhere along the line A loses track of the fact that its data was replaced with a completely different array. When it gets to writing the data it actually just calls .flush() on B's data. Since B is open read-only this actually silently does nothing, and doesn't modify A at all.
This is a corner case I found with the help of Sara Ogaz.
If I have two FITS files A and B opened with
memmap=True
(the default) and A open in update mode, if I do something likeA[0].data = B[0].data
, and thenA.flush()
this should replace the data for A's first HDU with the data from B's first HDU.But in fact that doesn't happen. Somewhere along the line A loses track of the fact that its data was replaced with a completely different array. When it gets to writing the data it actually just calls
.flush()
on B's data. Since B is open read-only this actually silently does nothing, and doesn't modify A at all.This is a simple test that reproduces the bug:
This is actually a pretty serious bug because not only does it fail; it fails silently. So it should be fixed ASAP.
The text was updated successfully, but these errors were encountered: