diff --git a/ckan/views/api.py b/ckan/views/api.py index c7cc44934b4..2c0bdf06b9d 100644 --- a/ckan/views/api.py +++ b/ckan/views/api.py @@ -3,6 +3,7 @@ import os import logging import html +import io from flask import Blueprint, make_response import six @@ -479,7 +480,7 @@ def i18n_js_translations(lang, ver=API_REST_DEFAULT_VERSION): u'base', u'i18n', u'{0}.js'.format(lang))) if not os.path.exists(source): return u'{}' - translations = json.load(open(source, u'r', encoding=u'utf-8')) + translations = json.load(io.open(source, u'r', encoding='utf-8')) return _finish_ok(translations)