Use codecs.open for translation po files

This commit is contained in:
Gina Häußge 2017-01-26 17:22:51 +01:00
parent a3f24c59e9
commit 54a9a7b906

View file

@ -7,6 +7,7 @@ __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms
import os
import datetime
import codecs
from collections import defaultdict
from flask import request, g, url_for, make_response, render_template, send_from_directory, redirect, abort
@ -924,7 +925,7 @@ def _get_translations(locale, domain):
def messages_from_po(path, locale, domain):
messages = dict()
with file(path) as f:
with codecs.open(path, encoding="utf-8") as f:
catalog = read_po(f, locale=locale, domain=domain)
for message in catalog: