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 }}
Repository navigation
Pickling an astropy.io.fits.CompImageHDU fails #10512
Attempting to pickle and reload an io.fits.CompImageHDU object produces a TypeError about a missing argument.
This causes failures when using CompImageHDUs with multiprocessing.
Expected behavior
The code below used to successfully recover the hdu object, but now produces the error below.
The configuration I have that is working is:
Linux-5.3.0-51-generic-x86_64-with-debian-buster-sid
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0]
Numpy 1.16.4
astropy 3.2.1
Scipy 1.3.0
Matplotlib 3.1.1
Indeed, it seems to be caused by #9229. But on the other hand it seems that HDU objects are not guaranteed to be pickable. It was working before #9229 if the HDU was instantiated manually, but it doesn't work if it is read from a file, because a file object is not pickable.
Fixing only CompImageHeader should be easy, but making HDU objects always pickable would require a bit more work.
Activity
pllim commentedon Jun 23, 2020
Thanks for reporting the known version where this used to work. Hopefully that will narrow things down a bit.
pllim commentedon Jun 23, 2020
Hmm, I suspect it is caused by #9229 . cc @mhvk @saimn @MSeifert04
saimn commentedon Jun 26, 2020
Indeed, it seems to be caused by #9229. But on the other hand it seems that HDU objects are not guaranteed to be pickable. It was working before #9229 if the HDU was instantiated manually, but it doesn't work if it is read from a file, because a file object is not pickable.
Fixing only
CompImageHeadershould be easy, but making HDU objects always pickable would require a bit more work.