]> granicus.if.org Git - python/commitdiff
Issue #19623: Fixed writing to unseekable files in the aifc module.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 14 Dec 2013 18:42:22 +0000 (20:42 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 14 Dec 2013 18:42:22 +0000 (20:42 +0200)
1  2 
Lib/aifc.py
Lib/test/test_aifc.py
Lib/test/test_sunau.py
Lib/test/test_wave.py
Misc/NEWS

diff --cc Lib/aifc.py
Simple merge
Simple merge
index af9ffec622de33c0603d7822b447443187d9e685,1655317c07e37d3278a3dac06b39b76e60f694b2..0f4134e9822e737587fabc919f9efa9e8d68659d
@@@ -48,38 -46,7 +47,32 @@@ class SunauPCM16Test(SunauTest, unittes
        """)
  
  
- class SunauPCM24Test(audiotests.AudioWriteTests,
-         audiotests.AudioTestsWithSourceFile,
-         unittest.TestCase):
-     module = sunau
++class SunauPCM24Test(SunauTest, unittest.TestCase):
 +    sndfilename = 'pluck-pcm24.au'
 +    sndfilenframes = 3307
 +    nchannels = 2
 +    sampwidth = 3
 +    framerate = 11025
 +    nframes = 48
 +    comptype = 'NONE'
 +    compname = 'not compressed'
 +    frames = bytes.fromhex("""\
 +      022D65FFEB9D 4B5A0F00FA54 3113C304EE2B 80DCD6084303 \
 +      CBDEC006B261 48A99803F2F8 BFE82401B07D 036BFBFE7B5D \
 +      B85756FA3EC9 B4B055F3502B 299830EBCB62 1A5CA7E6D99A \
 +      EDFA3EE491BD C625EBE27884 0E05A9E0B6CF EF2929E02922 \
 +      5758D8E27067 FB3557E83E16 1377BFEF8402 D82C5BF7272A \
 +      978F16FB7745 F5F865FC1013 086635FB9C4E DF30FCFB40EE \
 +      117FE0FA3438 3EE6B8FB5AC3 BC77A3FCB2F4 66D6DAFF5F32 \
 +      CF13B9041275 431D69097A8C C1BB600EC74E 5120B912A2BA \
 +      EEDF641754C0 8207001664B7 7FFFFF14453F 8000001294E6 \
 +      499C1B0EB3B2 52B73E0DBCA0 EFB2B20F5FD8 CE3CDB0FBE12 \
 +      E4B49C0CEA2D 6344A80A5A7C 08C8FE0A1FFE 2BB9860B0A0E \
 +      51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \
 +      """)
 +
 +
- class SunauPCM32Test(audiotests.AudioWriteTests,
-         audiotests.AudioTestsWithSourceFile,
-         unittest.TestCase):
-     module = sunau
+ class SunauPCM32Test(SunauTest, unittest.TestCase):
      sndfilename = 'pluck-pcm32.au'
      sndfilenframes = 3307
      nchannels = 2
index 549ca89615166685d140a3db82ec83c01ebe8838,f64201f9fc648377fe928291223bb05d5899b630..3eff773bca37f47e7044ea27a3e07784130cd668
@@@ -6,10 -5,15 +6,12 @@@ import sy
  import wave
  
  
- class WavePCM8Test(audiotests.AudioWriteTests,
-         audiotests.AudioTestsWithSourceFile,
-         unittest.TestCase):
+ class WaveTest(audiotests.AudioWriteTests,
+                audiotests.AudioTestsWithSourceFile):
      module = wave
 -    test_unseekable_write = None
 -    test_unseekable_overflowed_write = None
 -    test_unseekable_incompleted_write = None
+ class WavePCM8Test(WaveTest, unittest.TestCase):
      sndfilename = 'pluck-pcm8.wav'
      sndfilenframes = 3307
      nchannels = 2
@@@ -47,13 -48,16 +46,10 @@@ class WavePCM16Test(WaveTest, unittest.
        E4B50CEB 63440A5A 08CA0A1F 2BBA0B0B 51460E47 8BCB113C B6F50EEA 44150A59 \
        """)
      if sys.byteorder != 'big':
 -        frames = audiotests.byteswap2(frames)
 -
 -    if sys.byteorder == 'big':
 -        @unittest.expectedFailure
 -        def test_unseekable_incompleted_write(self):
 -            super().test_unseekable_incompleted_write()
 -
 +        frames = byteswap(frames, 2)
  
  
- class WavePCM24Test(audiotests.AudioWriteTests,
-         audiotests.AudioTestsWithSourceFile,
-         unittest.TestCase):
-     module = wave
+ class WavePCM24Test(WaveTest, unittest.TestCase):
      sndfilename = 'pluck-pcm24.wav'
      sndfilenframes = 3307
      nchannels = 2
        51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48 \
        """)
      if sys.byteorder != 'big':
 -        frames = audiotests.byteswap3(frames)
 +        frames = byteswap(frames, 3)
  
  
- class WavePCM32Test(audiotests.AudioWriteTests,
-         audiotests.AudioTestsWithSourceFile,
-         unittest.TestCase):
-     module = wave
+ class WavePCM32Test(WaveTest, unittest.TestCase):
      sndfilename = 'pluck-pcm32.wav'
      sndfilenframes = 3307
      nchannels = 2
diff --cc Misc/NEWS
index 95f77527884f07e16db1e61b058370bb85cbe42f,462d649d74498f09a9abf98909c6e293628290c9..e1a5c5469a7f79b545ddb8f1025018a24fac5f26
+++ b/Misc/NEWS
@@@ -44,9 -32,8 +44,11 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #19623: Fixed writing to unseekable files in the aifc module.
 +- Issue #19946: multiprocessing.spawn now raises ImportError when the module to
 +  be used as the main module cannot be imported.
 +
  - Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX.
    Fixed integer overflow in the eventmask parameter.