Commit c5ac6eb9 authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño

Fix `po_import` behavior in Python 2

See merge request nexedi/erp5!1929
parents f9b3c7ae cb64370a
Pipeline #34209 failed with stage
in 0 seconds
......@@ -660,10 +660,8 @@ class MessageCatalog(LanguageManager, ObjectManager, SimpleItem):
messages = self._messages
# Load the data
if isinstance(data, bytes): # six.PY2
pass
elif isinstance(data, bytes): # six.PY3
data = data.decode()
if isinstance(data, bytes):
data = data.decode("utf-8")
po = polib.pofile(data)
encoding = to_str(po.encoding)
for entry in po:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment