From 4f92844fc0fa3fcf0813c27f45f9b90c1ca64f13 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Sat, 16 May 2015 19:00:41 -0700 Subject: [PATCH] Fixed issue with python3 opening a unicode file. --- rtv/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtv/helpers.py b/rtv/helpers.py index 85f94e3..493aa9f 100644 --- a/rtv/helpers.py +++ b/rtv/helpers.py @@ -58,7 +58,7 @@ def open_editor(data=''): read and and lines starting with '#' will be stripped. """ - with NamedTemporaryFile(prefix='rtv-', suffix='.txt', mode='w') as fp: + with NamedTemporaryFile(prefix='rtv-', suffix='.txt', mode='wb') as fp: fp.write(clean(data)) fp.flush() editor = os.getenv('RTV_EDITOR') or os.getenv('EDITOR') or 'nano'