for compatibility with file-like objects

Small change to enable use with a Django FieldFile. Should also enable use with a StringIO (in-memory file object)