From 35c5ffb53476923ce59bf4206b3a8d4580bec659 Mon Sep 17 00:00:00 2001 From: Martin Paljak Date: Sat, 28 Dec 2013 20:12:51 +0000 Subject: [PATCH] Fix for getpelican/pelican#1198 When rendering templates, the locale was set to C in getpelican/pelican@ddcccfeaa952d2e1e24ceac94e5d66c73b57c01b If one used a locale that made use of unicode characters (like et_EE.UTF-8) the files on disk would be in correct locale while links would be to C. Works with Python3, gives ascii decoding errors with Python2 --- pelican/writers.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pelican/writers.py b/pelican/writers.py index 30b0ed16..f22afbd8 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -147,12 +147,7 @@ class Writer(object): def _write_file(template, localcontext, output_path, name, override): """Render the template write the file.""" - old_locale = locale.setlocale(locale.LC_ALL) - locale.setlocale(locale.LC_ALL, str('C')) - try: - output = template.render(localcontext) - finally: - locale.setlocale(locale.LC_ALL, old_locale) + output = template.render(localcontext) path = os.path.join(output_path, name) try: os.makedirs(os.path.dirname(path))