You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:\Program Files\Python38\lib\site-packages\magic\magic.py", line 135, in from_file
return m.from_file(filename)
File "C:\Program Files\Python38\lib\site-packages\magic\magic.py", line 89, in from_file
return maybe_decode(magic_file(self.cookie, filename))
File "C:\Program Files\Python38\lib\site-packages\magic\magic.py", line 214, in maybe_decode
return s.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 57: invalid continuation byte
I tried to edit "C:\Program Files\Python38\lib\site-packages\magic\magic.py", line 214 from return s.decode('utf-8') to return s.decode('utf-8', errors='ignore') or return s.decode('utf-8', errors='replace') but I still encounter the problem.
trying to read from a file whose filename is not ascii characters:
And this gives me error:
If I rename the file to ASCII name, say
file.txt
, the problem disappears.Also, if I use
.from_buffer()
, there's no issue:weird, not sure if this is related to this issue #205
The package is installed with
pip install python-magic-bin
on WIndows 11, Python3.11The text was updated successfully, but these errors were encountered: