You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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. Iffilename
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.
The text was updated successfully, but these errors were encountered: