Closed
Description
issue: the filename
parameter of isOleFile can be either the path of the file to open on disk, or a bytes string containing the data of the file. If filename
is less than 1536 bytes, isOleFile assumes that it's a filename and not data. This is fine for OLE files, because 1536 bytes is the minimal size of an OLE file.
But when we want to check a non-OLE file, this fails for files smaller than 1536 bytes, for applications passing data in the filename parameter instead of an actual filename.
Solution: add a second parameter data
, set to None by default. If data contains a bytes string, then isOleFile should use it directly and ignore filename.
This should not break applications using only filename.