diff options
-rw-r--r-- | Lib/sndhdr.py | 8 | ||||
-rw-r--r-- | Lib/test/sndhdrdata/README | 12 | ||||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.8svx | bin | 0 -> 110 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.aifc | bin | 0 -> 106 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.aiff | bin | 0 -> 108 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.au | bin | 0 -> 64 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.hcom | bin | 0 -> 256 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.sndt | bin | 0 -> 129 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.voc | bin | 0 -> 63 bytes | |||
-rw-r--r-- | Lib/test/sndhdrdata/sndhdr.wav | bin | 0 -> 64 bytes | |||
-rw-r--r-- | Misc/ACKS | 1 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
12 files changed, 19 insertions, 4 deletions
diff --git a/Lib/sndhdr.py b/Lib/sndhdr.py index a8e0a051666..9f5dcc90d43 100644 --- a/Lib/sndhdr.py +++ b/Lib/sndhdr.py @@ -57,12 +57,12 @@ tests = [] def test_aifc(h, f): import aifc - if h.startswith(b'FORM'): + if not h.startswith(b'FORM'): return None if h[8:12] == b'AIFC': fmt = 'aifc' elif h[8:12] == b'AIFF': - fmt = b'aiff' + fmt = 'aiff' else: return None f.seek(0) @@ -123,7 +123,7 @@ tests.append(test_hcom) def test_voc(h, f): - if h.startswith(b'Creative Voice File\032'): + if not h.startswith(b'Creative Voice File\032'): return None sbseek = get_short_le(h[20:22]) rate = 0 @@ -150,7 +150,7 @@ tests.append(test_wav) def test_8svx(h, f): - if h.startswith(b'FORM') or h[8:12] != b'8SVX': + if not h.startswith(b'FORM') or h[8:12] != b'8SVX': return None # Should decode it to get #channels -- assume always 1 return '8svx', 0, 1, 0, 8 diff --git a/Lib/test/sndhdrdata/README b/Lib/test/sndhdrdata/README new file mode 100644 index 00000000000..8a17c0041a4 --- /dev/null +++ b/Lib/test/sndhdrdata/README @@ -0,0 +1,12 @@ +Sound file samples used by Lib/test/test_sndhdr.py and generated using the +following commands: + + dd if=/dev/zero of=sndhdr.raw bs=20 count=1 + sox -s -2 -c 2 -r 44100 sndhdr.raw sndhdr.<format> + +Sound file samples used by Lib/test/test_sndhdr.py and generated using the +following commands: + + dd if=/dev/zero of=sndhdr.raw bs=20 count=1 + sox -s -2 -c 2 -r 44100 sndhdr.raw sndhdr.<format> + diff --git a/Lib/test/sndhdrdata/sndhdr.8svx b/Lib/test/sndhdrdata/sndhdr.8svx Binary files differnew file mode 100644 index 00000000000..8cd6cde5e09 --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.8svx diff --git a/Lib/test/sndhdrdata/sndhdr.aifc b/Lib/test/sndhdrdata/sndhdr.aifc Binary files differnew file mode 100644 index 00000000000..8aae4e730bd --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.aifc diff --git a/Lib/test/sndhdrdata/sndhdr.aiff b/Lib/test/sndhdrdata/sndhdr.aiff Binary files differnew file mode 100644 index 00000000000..8c279a762f1 --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.aiff diff --git a/Lib/test/sndhdrdata/sndhdr.au b/Lib/test/sndhdrdata/sndhdr.au Binary files differnew file mode 100644 index 00000000000..67c9e8fdd99 --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.au diff --git a/Lib/test/sndhdrdata/sndhdr.hcom b/Lib/test/sndhdrdata/sndhdr.hcom Binary files differnew file mode 100644 index 00000000000..debb02d9dd9 --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.hcom diff --git a/Lib/test/sndhdrdata/sndhdr.sndt b/Lib/test/sndhdrdata/sndhdr.sndt Binary files differnew file mode 100644 index 00000000000..e1ca9cb185d --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.sndt diff --git a/Lib/test/sndhdrdata/sndhdr.voc b/Lib/test/sndhdrdata/sndhdr.voc Binary files differnew file mode 100644 index 00000000000..53a91fd1eae --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.voc diff --git a/Lib/test/sndhdrdata/sndhdr.wav b/Lib/test/sndhdrdata/sndhdr.wav Binary files differnew file mode 100644 index 00000000000..0dca36739cd --- /dev/null +++ b/Lib/test/sndhdrdata/sndhdr.wav diff --git a/Misc/ACKS b/Misc/ACKS index 02f571a319b..93af0165d2f 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -433,6 +433,7 @@ Ben Laurie Simon Law Chris Lawrence Brian Leair +James Lee John J. Lee Inyeol Lee Thomas Lee diff --git a/Misc/NEWS b/Misc/NEWS index 7c264735c56..3717942737a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -78,6 +78,8 @@ C-API Library ------- +- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee. + - ``ast.literal_eval()`` now allows byte literals. - Issue #9137: Fix issue in MutableMapping.update, which incorrectly |