diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-02-08 00:23:07 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-02-08 00:23:07 +0100 |
commit | 7c08e1cb45a84087be9b70fe36cc6db2ba4d93b2 (patch) | |
tree | 6009fe061947f0f1d0dd0eb40469572cf879a990 /pyaggr3g470r | |
parent | Misc improvements for the crawler. A semaphore is used to limit the number of... (diff) | |
download | newspipe-7c08e1cb45a84087be9b70fe36cc6db2ba4d93b2.tar.gz newspipe-7c08e1cb45a84087be9b70fe36cc6db2ba4d93b2.tar.bz2 newspipe-7c08e1cb45a84087be9b70fe36cc6db2ba4d93b2.zip |
Fixed a bug when exporting articles to HTML with Python 3.3.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/export.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pyaggr3g470r/export.py b/pyaggr3g470r/export.py index 54b0be13..f60bb3a9 100644 --- a/pyaggr3g470r/export.py +++ b/pyaggr3g470r/export.py @@ -177,20 +177,20 @@ def export_html(user): a_post += HTML_FOOTER with open(post_file_name, "w") as f: - f.write(a_post.encode("utf-8")) + f.write(a_post) posts += HTML_FOOTER if len(feed.articles.all()) != 0: with open(feed_index, "w") as f: - f.write(posts.encode("utf-8")) + f.write(posts) index += "</ul>\n" index += "<p>" + time.strftime("Generated on %d %b %Y at %H:%M.") + "</p>\n" index += HTML_FOOTER with open(webzine_root + "index.html", "w") as f: - f.write(index.encode("utf-8")) + f.write(index) with open(webzine_root + "style.css", "w") as f: - f.write(CSS.encode("utf-8")) + f.write(CSS) archive_file_name = datetime.now().strftime('%Y-%m-%d') + '.tar.gz' with tarfile.open(conf.WEBZINE_ROOT + archive_file_name, "w:gz") as tar: @@ -198,9 +198,9 @@ def export_html(user): shutil.rmtree(webzine_root) - with open(conf.WEBZINE_ROOT + archive_file_name, 'r') as export_file: + with open(conf.WEBZINE_ROOT + archive_file_name, 'rb') as export_file: return export_file.read(), archive_file_name - + def export_json(user): """ Export all articles of 'user' in JSON. |