python-magic icon indicating copy to clipboard operation
python-magic copied to clipboard

zip/rar format's recognized as "application/octet-stream"

Open aa66609 opened this issue 7 years ago • 4 comments

i test zip,rar file got these result


magic.from_file('test.zip', mime=True) application/octet-stream

magic.from_file('test.rar', mime=True) application/octet-stream


but z01 is ok magic.from_file('test.z01', mime=True) application/zip

aa66609 avatar May 23 '18 17:05 aa66609

This is most likely the underlying libmagic libary.

ahupp avatar May 25 '18 00:05 ahupp

What does this report?

file --mime-type

ahupp avatar May 05 '20 22:05 ahupp

@ahupp maybe that discussion in https://github.com/destream-py/destream/pull/20 could have something to do with it. There are different versions of ZIP and they are differently interpreted on different linux/macos versions. Any ideas?

eumiro avatar Jan 12 '21 21:01 eumiro

@eumiro I commented there. Looks like maybe the magic db didn't set the mimetype for this new format. But might be fixed in a newer version.

ahupp avatar Jan 13 '21 18:01 ahupp

Old issue, and is a problem in libmagic.

ahupp avatar Aug 25 '23 18:08 ahupp