#1111142 python3-magic on triexie not detecting correct file type

#1111142#5
Date:
2025-08-15 06:09:30 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

zip -r archive.zip randomdir
file archive.zip --mime # output: application/zip
python3
import magic
f = open('/tmp/archive.zip', 'rb').read()
magic.from_buffer(f, mime=True) # output: application/octet-stream

   * What was the outcome of this action?

obviously the detected file type is not correct. the file command
detects the correct mime type, but python3-magic fails. this is
reproducible for any zip file independent of file extension with
suspicion on happening with some other file types as well.
some other files, e.g. .jpg are recognized correctly, even when renamed
to false file extension name.

   * What outcome did you expect instead?

correct output of mime type as in file command.

#1111142#10
Date:
2025-08-15 07:13:33 UTC
From:
To:
neonknight wrote...

[
    file => application/zip
    python-magic => application/octet-stream
]

Okay, that interesting. This is a regression introduced somewhen in
the Debian 13 ("trixie") development. Will check how that could happen.

    Christoph