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

Does not work if filename has non-English characters

Open denivic opened this issue 1 year ago • 1 comments

The following code fails if the file has æ, å or ø in it. I can imagine it would fail with other non-English characters as well. Would it be possible to fix this?

import magic as m

print(m.from_file(r'C:\Users\------\Desktop\data\æøå.pdf'))

Error:

cannot open `C:\Users\------\Desktop\data\æøå.pdf' (No such file or directory)

denivic avatar Oct 02 '24 11:10 denivic