Checked in. But next time please do use SF to submit patches (and feel free to assign them to me and mail the list about it).
On 8/12/07, Victor Stinner <[EMAIL PROTECTED]> wrote: > On Sunday 12 August 2007 16:50:05 Barry Warsaw wrote: > > In r56957 I committed changes to sndhdr.py and imghdr.py so that they > > compare what they read out of the files against proper byte > > literals. > > So nobody read my patches? :-( See my emails "[Python-3000] Fix imghdr module > for bytes" and "[Python-3000] Fix sndhdr module for bytes" from last > saturday. But well, my patches look similar. > > Barry's patch is incomplete: test_voc() is wrong. > > I attached a new patch: > - fix "h[sbseek] == b'\1'" and "ratecode = ord(h[sbseek+4])" in test_voc() > - avoid division by zero > - use startswith method: replace h[:2] == b'BM' by h.startswith(b'BM') > - use aifc.open() instead of old aifc.openfp() > - use ord(b'P') instead of ord('P') This latter one is questionable. If you really want to compare to bytes, perhaps write h[:1] == b'P' instead of b[0] == ord(b'P')? -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com