From 452bab4acf57c8dd156b794fe0d1672e1ab29b43 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 16 Nov 2013 14:01:31 +0200 Subject: Issue #16685: Added support for writing any bytes-like objects in the aifc, sunau, and wave modules. --- Lib/aifc.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/aifc.py') diff --git a/Lib/aifc.py b/Lib/aifc.py index 18f236da7a..c1c8ea7055 100644 --- a/Lib/aifc.py +++ b/Lib/aifc.py @@ -692,6 +692,8 @@ class Aifc_write: return self._nframeswritten def writeframesraw(self, data): + if not isinstance(data, (bytes, bytearray)): + data = memoryview(data).cast('B') self._ensure_header_written(len(data)) nframes = len(data) // (self._sampwidth * self._nchannels) if self._convert: -- cgit v1.2.1