Added more universal file-like object size check (fh.fileno() throws AttributeError on StringIO objects). It sounds like there are some file-like objects that are unseekable, but I have been unsuccessful in tracking down which ones exactly. This fix should be good enough for most cases, and we can update it once we come across file-like objects that are not seekable.