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

magic.from_file(file) generate "File Not Found" exception when file is a linux (symbolic) link

Open Madpentiste opened this issue 1 year ago • 1 comments

On a Linux/Ubuntu platform, if file is a symbolic link, magic.from_file(file) will throw a FileNotFoundError, instead of detecting that file is a link (inode/symlink).

So far, the only workaround I found is to embed the code containing the magic.from_file(file) line into a try/except block, and catch the exception.

Madpentiste avatar Oct 31 '24 19:10 Madpentiste