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
import filetype
import gzip
>>> filetype.helpers.is_archive(gzip.compress(b'test'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/filetype/helpers.py", line 74, in is_archive
return match.archive(obj) is not None
AttributeError: 'function' object has no attribute 'archive'
Seems there is a naming conflict when using helpers directly with the filetype.match.match and filetype.match.archive
Going around the helpers works though:
import gzip
from filetype.match import archive
>>> bool(archive(gzip.compress(b'test')))
True
The text was updated successfully, but these errors were encountered:
from filetype import helpers
helpers.is_audio('/path/to/file.txt')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/opt/virtualenvs/venv/lib/python3.6/site-packages/filetype/helpers.py", line 90, in is_audio
return match.audio(obj) is not None
AttributeError: 'function' object has no attribute 'audio'
DanielSwain
added a commit
to DanielSwain/filetype.py
that referenced
this issue
Apr 28, 2020
FYI
Seems there is a naming conflict when using helpers directly with the filetype.match.match and filetype.match.archive
Going around the helpers works though:
The text was updated successfully, but these errors were encountered: