ahupp / python-magic

A python wrapper for libmagic
Other
2.59k stars 280 forks source link

magic.from_filename misidentifies python file as text/x-objective-c #316

Closed Freffles closed 3 months ago

Freffles commented 3 months ago

On windows with python. Checking two files. One called import.py and the other called utilities.py. Checking with filetype = magic.from_file(filename, mime=True) the first file returns text/x-objective-c whereas the second file returns text/x-python.

I have tried a number of things with the first file, including creating a new file but to no avail. Online checkers correctly identify both as text/x-python.

ahupp commented 3 months ago

This is an issue in the underlying libmagic, which this library wraps. I'd suggest trying to update that, though I'm not sure off the top of my head what the best source is these days.