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
m = magic.Magic()
m.id_filename("/Users/jparris/02 - Hard Times Come Again No More.mp3")
'Audio file with ID3 version 2.3.0'
m.id_filename("/Users/jparris/foo.flac")
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/magic/identify.py", line 29, in wrapper
return func(self, _args, *_kwargs)
File "/Library/Python/2.7/site-packages/magic/compatability.py", line 30, in wrapper
return func(_encoder(args), *_kwargs)
File "/Library/Python/2.7/site-packages/magic/identify.py", line 112, in id_filename
return api.magic_file(self.cookie, filename)
File "/Library/Python/2.7/site-packages/magic/api.py", line 58, in errcheck_null
raise MagicError(errno, error)
magic.api.MagicError: [Errno 0] line 470: softmagic.c, 481: format , %u samples' does not match with %lu'
But if the MAGIC_MIME_TYPE flag is set everything works fine
m.close()
m = magic.Magic(flags=magic.MAGIC_MIME_TYPE)
m.id_filename("/Users/jparris/foo.flac")
'audio/x-flac'
Versions
libmagic-5.18 installed via brew
filemagic-1.6 installed via pip
The text was updated successfully, but these errors were encountered:
jparris
changed the title
Error attempting use id_filename with a flac file
Error attempting to use id_filename with a flac file
May 18, 2014
m = magic.Magic()
m.id_filename("/Users/jparris/02 - Hard Times Come Again No More.mp3")
'Audio file with ID3 version 2.3.0'
m.id_filename("/Users/jparris/foo.flac")
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/magic/identify.py", line 29, in wrapper
return func(self, _args, *_kwargs)
File "/Library/Python/2.7/site-packages/magic/compatability.py", line 30, in wrapper
return func(_encoder(args), *_kwargs)
File "/Library/Python/2.7/site-packages/magic/identify.py", line 112, in id_filename
return api.magic_file(self.cookie, filename)
File "/Library/Python/2.7/site-packages/magic/api.py", line 58, in errcheck_null
raise MagicError(errno, error)
magic.api.MagicError: [Errno 0] line 470: softmagic.c, 481: format
, %u samples' does not match with
%lu'But if the MAGIC_MIME_TYPE flag is set everything works fine
m.close()
m = magic.Magic(flags=magic.MAGIC_MIME_TYPE)
m.id_filename("/Users/jparris/foo.flac")
'audio/x-flac'
Versions
The text was updated successfully, but these errors were encountered: