Skip to content

Commit

Permalink
[ckan#6531] Py2/py3 compatible version of open
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra authored and ThrawnCA committed Jan 6, 2022
1 parent 8a57722 commit 620d089
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import logging
import html
import io

from flask import Blueprint, make_response
import six
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit 620d089

Please sign in to comment.