From ea3f5fc2833ec760bf3c9e1307e999a9a3042408 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 30 Dec 2012 21:53:09 +0100 Subject: Bugfix in export.py for export_txt(). --- source/export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/export.py b/source/export.py index 10f4cd80..c29c9f22 100644 --- a/source/export.py +++ b/source/export.py @@ -112,14 +112,14 @@ def export_txt(mongo_db): for feed in feeds: # creates folder for each stream folder = conf.path + "/var/export/txt/" + \ - utils.normalize_filename(feed["feed_title"].strip().replace(':', '').lower().encode('utf-8')) + utils.normalize_filename(feed["feed_title"].strip().replace(':', '').lower()) try: os.makedirs(folder) except OSError: # directories already exists (not a problem) pass - for article in mongo_db.get_articles_from_collection(feed["feed_id"]): + for article in mongo_db.get_articles(feed_id=feed["feed_id"]): name = article["article_date"].ctime().strip().replace(' ', '_') name = os.path.normpath(folder + "/" + name + ".txt") @@ -127,7 +127,7 @@ def export_txt(mongo_db): content += utils.clear_string(article["article_content"]) with open(name, "w") as f: - f.write(content.encode('utf-8')) + f.write(content) def export_epub(mongo_db): """ -- cgit