From 01827360bc8cc46bffd559529494cfaf55e1f96b Mon Sep 17 00:00:00 2001 From: boyska Date: Mon, 22 May 2017 10:41:43 +0200 Subject: [PATCH] python3 compatibility --- plugins/talks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/talks.py b/plugins/talks.py index 2026602..d3950e5 100644 --- a/plugins/talks.py +++ b/plugins/talks.py @@ -307,8 +307,10 @@ class TalksGenerator(generators.Generator): if os.path.isdir(outdir): shutil.rmtree(outdir) shutil.copytree(self.talks[talkname]['resources'], outdir) - with open(os.path.join(self.output_path, TALK_ICS), 'w') as buf: - buf.write(talks_to_ics().encode('utf8')) + with io.open(os.path.join(self.output_path, TALK_ICS), + 'w', + encoding='utf8') as buf: + buf.write(talks_to_ics()) def add_talks_option_defaults(pelican):