Skip to content

from_buffer() issue with file-5.47 #362

Description

@shosca

Using archlinux, with python-magic 0.4.27, there seems to be an issue with file-5.47-1 and python-magic when using from_buffer

In [1]: import magic

In [2]: magic.from_file("sample.mp4", mime=True)
Out[2]: 'video/mp4'

In [3]: magic.from_buffer(open("sample.mp4", "rb").read(2048), mime=True)
Out[3]: 'application/octet-stream'

In [4]: magic.from_file("sample.webm", mime=True)
Out[4]: 'video/webm'

In [5]: magic.from_buffer(open("sample.webm", "rb").read(2048), mime=True)
Out[5]: 'application/octet-stream'

after downgrading to file-5.46-5 everything works

In [1]: import magic

In [2]: magic.from_file("sample.mp4", mime=True)
Out[2]: 'video/mp4'

In [3]: magic.from_buffer(open("sample.mp4", "rb").read(2048), mime=True)
Out[3]: 'video/mp4'

In [4]: magic.from_file("sample.webm", mime=True)
Out[4]: 'video/webm'

In [5]: magic.from_buffer(open("sample.webm", "rb").read(2048), mime=True)
Out[5]: 'video/webm'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions