Package: file
Version: 1:5.46-5
Severity: normal

Dear Maintainer,

Using libmagic's buffer based MIME type detection via any of the python wrappers (file-magic or python-magic) fails to properly recognize a simple (non empty) ZIP file.

Here is a python snippet:
--
import magic

with open('test.zip', 'rb') as f:
  d = f.read()
print(magic.detect_from_content(d).mime_type) # fails: application octet-stream
  f.seek(0)
  print(magic.detect_from_fobj(f).mime_type) # works: application/zip
--

Building & linking the "files" project from the repo, both the masterc branch and the FILE5_45 tag do fix the issue.

This change apears to introduce the issue: https://github.com/file/file/commit/b310a0c2d3e4a1c12d579ad5c0266f1092a91340

This change fixes is:
https://github.com/file/file/commit/08ab5f644bf9822c64faf5efa4e393b58d7bcd0e


-- System Information:
Debian Release: 13.0
Kernel: 6.14.0-29-generic

Reply via email to