return base64.b16decode(s.replace(' ', ''))
def byteswap2(data):
- a = array.array('h', data)
+ a = array.array('h')
+ a.fromstring(data)
a.byteswap()
return a.tostring()
return bytes(ba)
def byteswap4(data):
- a = array.array('i', data)
+ a = array.array('i')
+ a.fromstring(data)
a.byteswap()
return a.tostring()
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()
+
+
class WavePCM24Test(audiotests.AudioWriteTests,
audiotests.AudioTestsWithSourceFile,
if sys.byteorder != 'big':
frames = audiotests.byteswap4(frames)
+ if sys.byteorder == 'big':
+ @unittest.expectedFailure
+ def test_unseekable_incompleted_write(self):
+ super().test_unseekable_incompleted_write()
+
def test_main():
run_unittest(WavePCM8Test, WavePCM16Test, WavePCM24Test, WavePCM32Test)
data = self._convert(data)
if self._sampwidth in (2, 4) and sys.byteorder == 'big':
import array
- data = array.array(_array_fmts[self._sampwidth], data)
+ a = array.array(_array_fmts[self._sampwidth])
+ a.fromstring(data)
+ data = a
assert data.itemsize == self._sampwidth
data.byteswap()
data.tofile(self._file)
Library
-------
+- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on
+ big-endian platforms.
+
- Issue #19449: in csv's writerow, handle non-string keys when generating the
error message that certain keys are not in the 'fieldnames' list.