This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
ckan/2.9/setup/patches/ckan/translation_encoding_fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/ckan/views/api.py b/ckan/views/api.py | ||
index c7cc44934..3bc21c163 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=u'utf-8')) | ||
return _finish_ok(translations) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters