astropy/astropy — pull request #2356 by embray (2014-04-23 17:18:47+00:00)
Title: io.fits.file can't open mongodb gridfs file

`astropy.io.fits.util.fileobj_closed` assumes a file like object has a `closed` property:

https://github.com/astropy/astropy/blob/master/astropy/io/fits/util.py#L301

but GridFS doesn't implement that:

https://github.com/mongodb/mongo-python-driver/blob/master/gridfs/grid_file.py#L369

The Python documentation states: _"It may not be available on all file-like objects."_

https://docs.python.org/2/library/stdtypes.html#file.closed