From 92ebaee7673f442a0b978e1ffdce09af8f2f2350 Mon Sep 17 00:00:00 2001 From: Jared Contrascere Date: Fri, 4 Sep 2015 01:10:35 -0400 Subject: [PATCH] Fix raised 'TypeError: must be str, not bytearray' when saving audio file in Python 3.4.3. --- captcha/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/captcha/audio.py b/captcha/audio.py index 1fc660f..31a300e 100644 --- a/captcha/audio.py +++ b/captcha/audio.py @@ -278,5 +278,5 @@ class AudioCaptcha(object): :param output: output destionation. """ data = self.generate(chars) - with open(output, 'w') as f: + with open(output, 'wb') as f: return f.write(data)