if filename is a file object, fitslib.extract_filename gets the file nam...

...e string.

can be useful when, e.g., input and/or output file names are opened for checks (e.g. argparse.FileType)