First time here? Check out the FAQ!

Revision history  [back]

Askbot crashing on questions with åäö

Hi! Iv'e a clean intstall of Askbot on a CentOS-server with uWsgi. It's behind an Nginx (on an other server). Evrything works fine. Can create users, ask questions etc. Until I put a non ascii-character (Swedish åäö) in the title of a question.

The question is stored properly, And is possible to read on the /question/X/Testfrågan-url. I is also stored correctly in the databas in the askbot_post-table.

But I get a UnicodeDecodeError on /questions/ or /users/X/User for the user who has written the question. The UnicodeDecodeError complains about the title.

The string that could not be encoded/decoded was: estfr��gan<

I have tried with different setting for ALLOW_UNICODE_SLUGS and ASKBOT_TRANSLATE_URL, and droped the database and retried. Database is UTF-8, and so is the DATABASES.TEST_CHARSET, DATABASES.TEST_COLLATION.

What do I do wrong? How can I fix this?

Versions:
CentOS 7.2.1511
Askbot: 0.10.0
Django: 1.8.13
Python: 2.7.5
uWSgi 2.0.13.1
PostgreSQL: 9.3

Traceback:

File "/var/www/askbot/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/www/askbot/lib/python2.7/site-packages/askbot/views/readers.py" in questions
  287.         return render(request, 'main_page.html', template_data)
File "/var/www/askbot/lib/python2.7/site-packages/django/shortcuts.py" in render
  67.             template_name, context, request=request, using=using)
File "/var/www/askbot/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  99.         return template.render(context, request)
File "/var/www/askbot/lib/python2.7/site-packages/askbot/skins/template_backends.py" in render
  86.         return self.template.render(context)
File "/var/www/askbot/lib/python2.7/site-packages/coffin/template/__init__.py" in render
  55.         return super(Template, self).render(**context)
File "/var/www/askbot/lib/python2.7/site-packages/jinja2/environment.py" in render
  989.         return self.environment.handle_exception(exc_info, True)
File "/var/www/askbot/lib/python2.7/site-packages/jinja2/environment.py" in handle_exception
  754.         reraise(exc_type, exc_value, tb)
File "/var/www/askbot/lib/python2.7/site-packages/askbot/templates/main_page.html" in top-level template code
  2. {% import "macros.html" as macros %}
File "/var/www/askbot/lib/python2.7/site-packages/askbot/templates/two_column_body.html" in top-level template code
  1. {% extends "base.html" %}
File "/var/www/askbot/lib/python2.7/site-packages/askbot/templates/base.html" in top-level template code
  46.             {% block body %}
File "/var/www/askbot/lib/python2.7/site-packages/askbot/templates/two_column_body.html" in block "body"
  5.     {% block content%}
File "/var/www/askbot/lib/python2.7/site-packages/askbot/templates/main_page.html" in block "content"
  21.         {% include "main_page/questions_loop.html" %}
File "/var/www/askbot/lib/python2.7/site-packages/askbot/templates/main_page/questions_loop.html" in top-level template code
  6.         {{ thread.get_summary_html(search_state=search_state, visitor = request.user) }}

Exception Type: UnicodeDecodeError at /questions/
Exception Value: 'ascii' codec can't decode byte 0xc3 in position 1064: ordinal not in range(128)