python-magic
python-magic copied to clipboard
application/octet-stream with text files on windows
On Windows 10 a plain text buffer is classified as application/octet-stream which is indicative of a binary file (I think). Ubuntu Linux is correctly identifying as "text/plain".
Python3.9, python-magic-bin as the driver for magiclib
How to reproduce
content = "Bunch of fake content" * 8192
magic = Magic(mime=True)
mimetype = magic.from_buffer(content[0:8192]) # Index to replicate my environment
I have the exact same issue. With Ubuntu it gives me the correct file type, Windows its always application/octet-stream.