Assigning to data
of a BinTableHDU
risks corrupting the original array
#215
Labels
data
of a BinTableHDU
risks corrupting the original array
#215
If a record array with an unsigned dtype is assigned to the
data
attribute of aBinTableHDU
the data in the original array is modified when theBinTableHDU
is saved (as seen in the example below).Fails with:
AssertionError: 32769
This occurs in astropy 5.3 and a recently downloaded 6.0 nightly.
There are many places in stdatamodels where
hdu.data
is assigned. Given that the modification occurs when the file is saved (which may occur at some later point in the code) this seems likely to introduce insidious bugs.Updating the assignments to
hdu.data
to either copy the assigned array and/or to define the array at the time of creation of theBinTableHDU
(passing the array in via thedata
keyword ofBinTableHDU.__init__
does not appear to have the same issue) should be considered.The text was updated successfully, but these errors were encountered: