From cecc3a0083e86fb81fcd7e5ba9117d5a175425e3 Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Wed, 29 Apr 2009 14:54:29 +0000 Subject: [PATCH] Merged revisions 72100-72101 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ........ r72100 | r.david.murray | 2009-04-29 09:17:37 -0400 (Wed, 29 Apr 2009) | 7 lines Fix issue 2245. aifc now skips any chunk type it doesn't actually process instead of throwing errors for anything not in an explicit skip list. This is per this spec: http://www.cnpbagwell.com/aiff-c.txt. Spec reference and test sound file provided by Santiago Peresón, fix based on patch by Hiroaki Kawai. ........ r72101 | r.david.murray | 2009-04-29 09:51:44 -0400 (Wed, 29 Apr 2009) | 2 lines Now that we've got a test_aifc, add a few tests. ........ --- Lib/aifc.py | 7 ----- Lib/test/Sine-1000Hz-300ms.aif | Bin 0 -> 61696 bytes Lib/test/test_aifc.py | 54 +++++++++++++++++++++++++++++++++ Lib/test/test_sundry.py | 1 - Misc/ACKS | 2 ++ Misc/NEWS | 2 ++ 6 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 Lib/test/Sine-1000Hz-300ms.aif create mode 100644 Lib/test/test_aifc.py diff --git a/Lib/aifc.py b/Lib/aifc.py index f663dd67d2e7..8e4f864495d4 100644 --- a/Lib/aifc.py +++ b/Lib/aifc.py @@ -144,9 +144,6 @@ class Error(Exception): _AIFC_version = 0xA2805140L # Version 1 of AIFF-C -_skiplist = 'COMT', 'INST', 'MIDI', 'AESD', \ - 'APPL', 'NAME', 'AUTH', '(c) ', 'ANNO' - def _read_long(file): try: return struct.unpack('>l', file.read(4))[0] @@ -314,10 +311,6 @@ class Aifc_read: self._version = _read_ulong(chunk) elif chunkname == 'MARK': self._readmark(chunk) - elif chunkname in _skiplist: - pass - else: - raise Error, 'unrecognized chunk type '+chunk.chunkname chunk.skip() if not self._comm_chunk_read or not self._ssnd_chunk: raise Error, 'COMM chunk and/or SSND chunk missing' diff --git a/Lib/test/Sine-1000Hz-300ms.aif b/Lib/test/Sine-1000Hz-300ms.aif new file mode 100644 index 0000000000000000000000000000000000000000..bf08f5ce859429eeeab213fd29a201b0d851b9c3 GIT binary patch literal 61696 zc-rmGAxlG17=Yn}Nf@ZOuwpXF*z$~5l&PQ_c*EGDzriq;OvB)BSaU4Qur@FVCbNjF zEC>e6z_4J{&*V=~c;0gEIrp58r`|j}P3hxv@3>yyZ=QaCr_HpI(r%VEvbDR*^i%!h zFI&f|aFi~I2|-p8Dn7jt9&va+naU%y|^^LhR>d73=FJigp7 z?ibUo>DHt_>5q@bN2BhjJKP!W+??N>#~S-MkN