Fixed issue with python3 opening a unicode file.

This commit is contained in:
Michael Lazar
2015-05-16 19:00:41 -07:00
parent c232e1f64a
commit 4f92844fc0

View File

@@ -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'