{"action":"created","issue":{"url":"https://api.github.com/repos/ckan/ckan/issues/3074","repository_url":"https://api.github.com/repos/ckan/ckan","labels_url":"https://api.github.com/repos/ckan/ckan/issues/3074/labels{/name}","comments_url":"https://api.github.com/repos/ckan/ckan/issues/3074/comments","events_url":"https://api.github.com/repos/ckan/ckan/issues/3074/events","html_url":"https://github.com/ckan/ckan/issues/3074","id":157653349,"number":3074,"title":"Exception when creating a dataset with Chinese locale (`zh_CN` / `zh_TW`)","user":{"login":"amercader","id":200230,"avatar_url":"https://avatars.githubusercontent.com/u/200230?v=3","gravatar_id":"","url":"https://api.github.com/users/amercader","html_url":"https://github.com/amercader","followers_url":"https://api.github.com/users/amercader/followers","following_url":"https://api.github.com/users/amercader/following{/other_user}","gists_url":"https://api.github.com/users/amercader/gists{/gist_id}","starred_url":"https://api.github.com/users/amercader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amercader/subscriptions","organizations_url":"https://api.github.com/users/amercader/orgs","repos_url":"https://api.github.com/users/amercader/repos","events_url":"https://api.github.com/users/amercader/events{/privacy}","received_events_url":"https://api.github.com/users/amercader/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"k-nut","id":1096357,"avatar_url":"https://avatars.githubusercontent.com/u/1096357?v=3","gravatar_id":"","url":"https://api.github.com/users/k-nut","html_url":"https://github.com/k-nut","followers_url":"https://api.github.com/users/k-nut/followers","following_url":"https://api.github.com/users/k-nut/following{/other_user}","gists_url":"https://api.github.com/users/k-nut/gists{/gist_id}","starred_url":"https://api.github.com/users/k-nut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-nut/subscriptions","organizations_url":"https://api.github.com/users/k-nut/orgs","repos_url":"https://api.github.com/users/k-nut/repos","events_url":"https://api.github.com/users/k-nut/events{/privacy}","received_events_url":"https://api.github.com/users/k-nut/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-05-31T11:53:16Z","updated_at":"2016-06-03T07:14:06Z","closed_at":null,"body":"### CKAN Version if known (or site URL): master\r\n\r\nAfter creating a dataset and a resource via the UI form we get an exception: `Error - <type 'exceptions.KeyError'>: u'\\\\u6708'`\r\n\r\nFull stacktrace:\r\n\r\n```\r\nError - <type 'exceptions.KeyError'>: u'\\\\u6708'\r\nURL: http://192.168.33.15/dataset/sdasdasd\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in __call__\r\n  app_iter = self.application(environ, sr_checker)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__\r\n  resp = self.call_func(req, *args, **self.kwargs)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func\r\n  return self.func(req, *args, **kwargs)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__\r\n  return request.get_response(self.app)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response\r\n  application, catch_exc_info=False)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application\r\n  app_iter = application(self.environ, start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__\r\n  resp = self.call_func(req, *args, **self.kwargs)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func\r\n  return self.func(req, *args, **kwargs)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__\r\n  response = request.get_response(self.app)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response\r\n  application, catch_exc_info=False)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application\r\n  app_iter = application(self.environ, start_response)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py', line 389 in inner\r\n  result = application(environ, start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__\r\n  return self.app(environ, start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__\r\n  return self.wrap_app(environ, session_start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__\r\n  response = self.app(environ, start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__\r\n  response = self.dispatch(controller, environ, start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch\r\n  return controller(environ, start_response)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 337 in __call__\r\n  res = WSGIController.__call__(self, environ, start_response)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in __call__\r\n  response = self._dispatch_call()\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call\r\n  response = self._inspect_call(func)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call\r\n  result = self._perform_call(func, args)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call\r\n  return func(**args)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py', line 390 in read\r\n  extra_vars={'dataset_type': package_type})\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 216 in render\r\n  loader_class=loader_class)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template\r\n  return render_func()\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 154 in render_template\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render\r\n  return self.environment.handle_exception(exc_info, True)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read.html', line 3 in top-level template code\r\n  {% set pkg = c.pkg_dict %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read_base.html', line 1 in top-level template code\r\n  {% extends \"package/base.html\" %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/base.html', line 3 in top-level template code\r\n  {% set pkg = c.pkg_dict or pkg_dict %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 1 in top-level template code\r\n  {% extends \"base.html\" %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/base.html', line 103 in top-level template code\r\n  {%- block page %}{% endblock -%}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 19 in block \"page\"\r\n  {%- block content %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 22 in block \"content\"\r\n  {% block main_content %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 57 in block \"main_content\"\r\n  {% block primary %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 70 in block \"primary\"\r\n  {% block primary_content %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/page.html', line 90 in block \"primary_content\"\r\n  {% block primary_content_inner %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read.html', line 44 in block \"primary_content_inner\"\r\n  {% block package_additional_info %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/read.html', line 45 in block \"package_additional_info\"\r\n  {% snippet \"package/snippets/additional_info.html\", pkg_dict=pkg %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/jinja_extensions.py', line 255 in _call\r\n  return base.render_snippet(args[0], **kwargs)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 79 in render_snippet\r\n  renderer='snippet')\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 216 in render\r\n  loader_class=loader_class)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template\r\n  return render_func()\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 154 in render_template\r\n  return render_jinja2(template_name, globs)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 104 in render_jinja2\r\n  return template.render(**extra_vars)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render\r\n  return self.environment.handle_exception(exc_info, True)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/snippets/additional_info.html', line 11 in top-level template code\r\n  {% block package_additional_info %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/snippets/additional_info.html', line 64 in block \"package_additional_info\"\r\n  {% snippet 'snippets/local_friendly_datetime.html', datetime_obj=pkg_dict.metadata_modified %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/jinja_extensions.py', line 255 in _call\r\n  return base.render_snippet(args[0], **kwargs)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 79 in render_snippet\r\n  renderer='snippet')\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 216 in render\r\n  loader_class=loader_class)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template\r\n  return render_func()\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 154 in render_template\r\n  return render_jinja2(template_name, globs)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 104 in render_jinja2\r\n  return template.render(**extra_vars)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render\r\n  return self.environment.handle_exception(exc_info, True)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/snippets/additional_info.html', line 11 in top-level template code\r\n  {% block package_additional_info %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/package/snippets/additional_info.html', line 64 in block \"package_additional_info\"\r\n  {% snippet 'snippets/local_friendly_datetime.html', datetime_obj=pkg_dict.metadata_modified %}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/jinja_extensions.py', line 255 in _call\r\n  return base.render_snippet(args[0], **kwargs)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 79 in render_snippet\r\n  renderer='snippet')\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 216 in render\r\n  loader_class=loader_class)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template\r\n  return render_func()\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 154 in render_template\r\n  return render_jinja2(template_name, globs)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 104 in render_jinja2\r\n  return template.render(**extra_vars)\r\nFile '/usr/lib/ckan/default/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render\r\n  return self.environment.handle_exception(exc_info, True)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/templates/snippets/local_friendly_datetime.html', line 13 in top-level template code\r\n  {{ h.render_datetime(datetime_obj, with_hours=True) }}\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/helpers.py', line 1034 in render_datetime\r\n  with_hours=with_hours)\r\nFile '/usr/lib/ckan/default/src/ckan/ckan/lib/formatters.py', line 147 in localised_nice_date\r\n  .format(**details))\r\nKeyError: u'\\\\u6708'\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/ckan/ckan/issues/comments/223507728","html_url":"https://github.com/ckan/ckan/issues/3074#issuecomment-223507728","issue_url":"https://api.github.com/repos/ckan/ckan/issues/3074","id":223507728,"user":{"login":"k-nut","id":1096357,"avatar_url":"https://avatars.githubusercontent.com/u/1096357?v=3","gravatar_id":"","url":"https://api.github.com/users/k-nut","html_url":"https://github.com/k-nut","followers_url":"https://api.github.com/users/k-nut/followers","following_url":"https://api.github.com/users/k-nut/following{/other_user}","gists_url":"https://api.github.com/users/k-nut/gists{/gist_id}","starred_url":"https://api.github.com/users/k-nut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-nut/subscriptions","organizations_url":"https://api.github.com/users/k-nut/orgs","repos_url":"https://api.github.com/users/k-nut/repos","events_url":"https://api.github.com/users/k-nut/events{/privacy}","received_events_url":"https://api.github.com/users/k-nut/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T07:14:06Z","updated_at":"2016-06-03T07:14:06Z","body":"@wardi you are right. This is indeed a problem with the Chinese `ckan.po` / `ckan.mo` that is in that package.  Someone translated all the string formatters for `# ckan/lib/formatters.py:146` to their Chinese equivalents.\r\nThe dataset creation still works but displaying is broken because there we try to display the timestamp. How do we handle a situation like this? Fix the issue in the `dpkg` package and republish it? Or do the users have to wait until the next release? "}}
{"actor":{"display_login":"k-nut"}}