_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]
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'
--- /dev/null
+from test.test_support import findfile, run_unittest
+import unittest
+
+import aifc
+
+
+class AIFCTest(unittest.TestCase):
+
+ def setUp(self):
+ self.sndfilepath = findfile('Sine-1000Hz-300ms.aif')
+
+ def test_skipunknown(self):
+ #Issue 2245
+ #This file contains chunk types aifc doesn't recognize.
+ f = aifc.open(self.sndfilepath)
+ f.close()
+
+
+def test_main():
+ run_unittest(AIFCTest)
+
+
+if __name__ == "__main__":
+ unittest.main()
Library
-------
+- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
+
- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
anymore.