cpython: 7b040bc289e8 (original) (raw)
Mercurial > cpython
changeset 87304:7b040bc289e8 3.3
Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on big-endian platforms. Temporary forbidden test_unseekable_incompleted_write fornot compressed 16- and 32-bit wave file on big-endian platforms. [#19633]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Thu, 21 Nov 2013 11:02:30 +0200 |
parents | 74b76a726285 |
children | 7cf7f19445ba cfbd894f1df1 |
files | Lib/test/audiotests.py Lib/test/test_wave.py Lib/wave.py Misc/NEWS |
diffstat | 4 files changed, 21 insertions(+), 3 deletions(-)[+] [-] Lib/test/audiotests.py 6 Lib/test/test_wave.py 11 Lib/wave.py 4 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/test/audiotests.py +++ b/Lib/test/audiotests.py @@ -6,7 +6,8 @@ import pickle import sys def byteswap2(data):
- a = array.array('h')
- a.frombytes(data) a.byteswap() return a.tobytes() @@ -17,7 +18,8 @@ def byteswap3(data): return bytes(ba) def byteswap4(data):
--- a/Lib/test/test_wave.py +++ b/Lib/test/test_wave.py @@ -48,6 +48,12 @@ class WavePCM16Test(audiotests.AudioWrit if sys.byteorder != 'big': frames = audiotests.byteswap2(frames)
- if sys.byteorder == 'big':
@unittest.expectedFailure[](#l2.8)
def test_unseekable_incompleted_write(self):[](#l2.9)
super().test_unseekable_incompleted_write()[](#l2.10)
+ + class WavePCM24Test(audiotests.AudioWriteTests, audiotests.AudioTestsWithSourceFile, @@ -108,6 +114,11 @@ class WavePCM32Test(audiotests.AudioWrit if sys.byteorder != 'big': frames = audiotests.byteswap4(frames)
- if sys.byteorder == 'big':
@unittest.expectedFailure[](#l2.21)
def test_unseekable_incompleted_write(self):[](#l2.22)
super().test_unseekable_incompleted_write()[](#l2.23)
+ if name == 'main': unittest.main()
--- a/Lib/wave.py +++ b/Lib/wave.py @@ -424,7 +424,9 @@ class Wave_write: data = self._convert(data) if self._sampwidth in (2, 4) and sys.byteorder == 'big': import array
data = array.array(_array_fmts[self._sampwidth], data)[](#l3.7)
a = array.array(_array_fmts[self._sampwidth])[](#l3.8)
a.frombytes(data)[](#l3.9)
data = a[](#l3.10) assert data.itemsize == self._sampwidth[](#l3.11) data.byteswap()[](#l3.12) data.tofile(self._file)[](#l3.13)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,9 @@ Core and Builtins Library ------- +- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on