spacetelescope/wss_tools

SaveQUIP crash with ValueError (rare bug?)

Closed this issue · 1 comments

pllim commented

I encountered it once while testing but unable to reproduce it. I modified some images in different ways and then tried to save them out. One of them crashed with an error that can be reproduced in Astropy like this:

In [1]: from astropy.io import fits

In [2]: prihdu = fits.PrimaryHDU()

In [3]: prihdu.header.add_history('\n')
...
.../astropy/io/fits/card.py in value(self, value)
    321                     'FITS header values must contain standard printable ASCII '
    322                     'characters; {!r} contains characters not representable in '
--> 323                     'ASCII or non-printable characters.'.format(value))
    324         elif isinstance(value, bytes):
    325             # Allow str, but only if they can be decoded to ASCII text; note

ValueError: FITS header values must contain standard printable ASCII characters; '\n' contains characters not representable in ASCII or non-printable characters.

So, somehow a \n character sneaked into the change history in Ginga and crashed the process of writing modified FITS back out. If this happens to you, please report your story here so I can track it somemore.

pllim commented

Haven't seen it in a while.