[Python-modules-team] Bug#878623: python-acoustid: acoustid.fingerprint_file(p) fails with TypeError: data must be bytes, buffer, or memoryview
Greg Schmidt
g_w_schmidt at yahoo.com
Sun Oct 15 05:02:17 UTC 2017
Package: python-acoustid
Version: 1.1.2-2
Severity: normal
Dear Maintainer,
Encounted a type error when i called acoustid.fingerprint_file()
the target file was .ogg,
I was able to workaround the problem by making the file:
"/usr/lib/python2.7/dist-packages/chromaprint.py"
inaccessable. I saw in the code that it falls back to using the fpcalc program.
Ran it under pdb and see that the buffer is <type bytearray> but chromaprint
doesn't accept the bytearray type
-- pdb session
Traceback (most recent call last):
File "/usr/lib/python2.7/pdb.py", line 1314, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
self.run(statement)
File "/usr/lib/python2.7/bdb.py", line 400, in run
exec cmd in globals, locals
File "<string>", line 1, in <module>
File "fptst.py", line 1, in <module>
import acoustid
File "/usr/lib/python2.7/posixpath.py", line 239, in walk
walk(name, func, arg)
File "/usr/lib/python2.7/posixpath.py", line 231, in walk
func(arg, top, names)
File "fptst.py", line 28, in walkfunc
s,fp = acoustid.fingerprint_file(p)
File "/usr/lib/python2.7/dist-packages/acoustid.py", line 321, in fingerprint_file
return _fingerprint_file_audioread(path, maxlength)
File "/usr/lib/python2.7/dist-packages/acoustid.py", line 264, in _fingerprint_file_audioread
fp = fingerprint(f.samplerate, f.channels, iter(f), maxlength)
File "/usr/lib/python2.7/dist-packages/acoustid.py", line 206, in fingerprint
fper.feed(block)
File "/usr/lib/python2.7/dist-packages/chromaprint.py", line 119, in feed
raise TypeError('data must be bytes, buffer, or memoryview')
TypeError: data must be bytes, buffer, or memoryview
-- deleted
-> fper.feed(block)
(Pdb) s
--Call--
> /usr/lib/python2.7/dist-packages/chromaprint.py(112)feed()
-> def feed(self, data):
(Pdb)
> /usr/lib/python2.7/dist-packages/chromaprint.py(116)feed()
-> if isinstance(data, BUFFER_TYPES):
(Pdb)
> /usr/lib/python2.7/dist-packages/chromaprint.py(118)feed()
-> elif not isinstance(data, bytes):
(Pdb)
> /usr/lib/python2.7/dist-packages/chromaprint.py(119)feed()
-> raise TypeError('data must be bytes, buffer, or memoryview')
(Pdb)
TypeError: TypeErro...ryview',)
> /usr/lib/python2.7/dist-packages/chromaprint.py(119)feed()
-> raise TypeError('data must be bytes, buffer, or memoryview')
(Pdb) type(data)
<type 'bytearray'>
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 4.13.0-1-amd64 (SMP w/16 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages python-acoustid depends on:
ii libchromaprint1 1.4.2-1
ii python 2.7.13-2
ii python-audioread 2.1.5-1
ii python-requests 2.18.1-1
python-acoustid recommends no packages.
python-acoustid suggests no packages.
-- no debconf information
More information about the Python-modules-team
mailing list