Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error attempting to use id_filename with a flac file #13

Open
jparris opened this issue May 18, 2014 · 0 comments
Open

Error attempting to use id_filename with a flac file #13

jparris opened this issue May 18, 2014 · 0 comments

Comments

@jparris
Copy link

jparris commented 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

  • libmagic-5.18 installed via brew
  • filemagic-1.6 installed via pip
@jparris 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant