- 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')
modules have unittests AFAICT, and I'm not improving things here, but these
changes make a bunch of email package tests succeed, and command line testing
against real files seems to make things better.
Added an __main__ section to imghdr.py so that it can be run from the command
line similarly to sndhdr.py. Someone else can figure out a better -m way of
doing this.
In sndhdr.py do a couple of very minor cleanups, and use a with statement to
not wait for gc to close the file.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.
(Oh, and I don't know if the compiler package works.)
also modified check_all function to suppress all warnings since they aren't
relevant to what this test is doing (allows quiet checking of regsub, for
instance)