Message110172
http://svn.python.org/view/python/branches/py3k/Lib/sndhdr.py?r1=56957&r2=56987 seems to have broken sndhdr as it incorrectly detects files as voc (all that time ago and nobody has noticed...):
[jbit@miku]~$ xxd test.wav | head -n 1
0000000: 5249 4646 2478 e001 5741 5645 666d 7420 RIFF$x..WAVEfmt
[jbit@miku]~$ python3.1
>>> import sndhdr
>>> sndhdr.what("test.wav")
('voc', 0, 1, -1, 8)
I'm a little unsure why it got changed from indexing to startswith() at all, but changes like the following are just totally incorrect.
- if h[:20] != b'Creative Voice File\032':
+ if h.startswith(b'Creative Voice File\032'):
Attached is a patch against the py3k branch which fixes the issue as well as some other things obviously broken by the same changelist, although it might be a good idea to review the changelist again to make sure there's nothing else obviously broken :)
>>> sndhdr.what("test.wav")
('wav', 48000, 2, -1, 16) |
|
Date |
User |
Action |
Args |
2010-07-13 11:47:49 | jbit | set | recipients:
+ jbit |
2010-07-13 11:47:49 | jbit | set | messageid: <1279021669.64.0.945928628097.issue9243@psf.upfronthosting.co.za> |
2010-07-13 11:47:48 | jbit | link | issue9243 messages |
2010-07-13 11:47:47 | jbit | create | |
|