Skip to content

Mimetype detected by libmagic is inaccurate #545

Open
@doronlh

Description

@doronlh

If I create file in Microsoft Word (Mac, version 16.17) and then check its mimetype using libmagic on the command line I get the following output on Mac

$ file --mime file_created_in_word.docx
application/vnd.openxmlformats-officedocument.wordprocessingml.document

However, files created by python-docx get a different mimetype

$ file --mime file_created_by_python-docx.docx
application/octet-stream

This affected me in some testing code that wanted to check that the document that was output was the correct type.
Can anyone give insight into this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions