This code is not Python 2.7 compatible:
|
translations = json.load(open(source, u'r', encoding=u'utf-8')) |
In Python 2, encoding is not a valid argument for the open function, but it is for the json.load.
Here is the commit which introduced the regression: a280cf1
2021-11-11 15:42:28,678 ERROR [ckan.config.middleware.flask_app] 'encoding' is an invalid keyword argument for this function
Traceback (most recent call last):
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/ckan/venv/src/ckan/ckan/views/api.py", line 482, in i18n_js_translations
translations = json.load(open(source, u'r', encoding=u'utf-8'))
TypeError: 'encoding' is an invalid keyword argument for this function
It seems to have been fixed partially already in another file: b2b92a4
Related issue: #6051
This code is not Python 2.7 compatible:
ckan/ckan/views/api.py
Line 482 in 6731c5a
In Python 2,
encodingis not a valid argument for theopenfunction, but it is for thejson.load.Here is the commit which introduced the regression: a280cf1
It seems to have been fixed partially already in another file: b2b92a4
Related issue: #6051