From cb1561481b2fb7a71da669cd69073ca69e5c5c9d Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Thu, 26 Jun 2014 15:03:27 +0200 Subject: [PATCH] Fixes error when exporting txt files Fixes #202 --- jrnl/exporters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jrnl/exporters.py b/jrnl/exporters.py index 85cb5554..bdab3987 100644 --- a/jrnl/exporters.py +++ b/jrnl/exporters.py @@ -81,7 +81,7 @@ def export(journal, format, output=None): "markdown": to_md } if format not in maps: - return u"[ERROR: can't export to {0}. Valid options are 'md', 'txt', and 'json']".format(format) + return u"[ERROR: can't export to '{0}'. Valid options are 'md', 'txt', and 'json']".format(format) if output and os.path.isdir(output): # multiple files return write_files(journal, output, format) else: @@ -108,7 +108,7 @@ def write_files(journal, path, format): elif format in ('md', 'markdown'): content = e.to_md() elif format in ('txt', 'text'): - content = u(e) + content = e.__unicode__() with codecs.open(full_path, "w", "utf-8") as f: f.write(content) return u"[Journal exported individual files in {0}]".format(path)