Skip to content

Fix UnicodeDecodeError on abort fucntion #4829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

usingsky
Copy link
Contributor

@usingsky usingsky commented Jun 5, 2019

Fixes #
UnicodeDecodeError occurs when rendering error_document_template.html in non-english such as Korean, Chinese or Japan...
File "/usr/lib/ckan/venv/src/ckan/ckan/templates/error_document_template.html", line 8, in block "primary" {{ content}} UnicodeDecodeError: 'ascii' codec can't decode byte 0xec in position 0: ordinal not in range(128)

Expect : 이 페이지를 보기 위한 권한 없음(Not authorized to see this page)
Actual : Internal Server Error

Proposed fixes:

This is because detail of the error are encoded as utf8 before executing the flask_abort function.
Unlike pylons_abort, flask_abort does not use WebOb, so it does not seem necessary to encode it before calling flask_abort.

Features:

  • includes tests covering changes
  • includes updated documentation
  • includes user-visible changes
  • includes API changes
  • includes bugfix for possible backport

Please [X] all the boxes above that apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants