First time here? Check out the FAQ!

Revision history  [back]

UnicodeEncodeError at /questions/ask/

Hello, I am using most recent version of askbot from github (askbot-devel). When I am trying to create a new question with unicode letters in title I get following error:

UnicodeEncodeError at /questions/ask/
'ascii' codec can't encode characters in position 3-5: ordinal not in range(128)


Environment:


Request Method: POST
Request URL: http://.../questions/ask/

Django Version: 1.5.2
Python Version: 2.7.3
Installed Applications:
('longerusername',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.sitemaps',
 'django.contrib.messages',
 'compressor',
 'askbot',
 'askbot.deps.django_authopenid',
 'south',
 'askbot.deps.livesettings',
 'keyedcache',
 'robots',
 'django_countries',
 'djcelery',
 'djkombu',
 'followit',
 'tinymce',
 'group_messaging')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'askbot.middleware.forum_mode.ForumModeMiddleware',
 'askbot.middleware.cancel.CancelActionMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'askbot.middleware.view_log.ViewLogMiddleware',
 'askbot.middleware.spaceless.SpacelessMiddleware')


Traceback:
File "/home/dev/askbot/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/dev/askbot/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/dev/askbot/env/src/askbot/askbot/utils/decorators.py" in wrapper
  136.             return view_func(request, *args, **kwargs)
File "/home/dev/askbot/env/src/askbot/askbot/utils/decorators.py" in wrapper
  231.             return view_func(request, *args, **kwargs)
File "/home/dev/askbot/env/src/askbot/askbot/views/writers.py" in ask
  259.                         language=language
File "/home/dev/askbot/env/src/askbot/askbot/models/__init__.py" in user_post_question
  1759.                                     language=language
File "/home/dev/askbot/env/src/askbot/askbot/models/question.py" in create_new
  172.         parse_results = question.parse_and_save(author=author, is_private=is_private)
File "/home/dev/askbot/env/src/askbot/askbot/models/post.py" in parse_and_save
  507.         data = self.parse_post_text()
File "/home/dev/askbot/env/src/askbot/askbot/models/post.py" in parse_post_text
  439.         text = text_converter(self.text)
File "/home/dev/askbot/env/src/askbot/askbot/utils/markup.py" in markdown_input_converter
  205.     text = urlize_html(text)
File "/home/dev/askbot/env/src/askbot/askbot/utils/html.py" in urlize_html
  70.     soup = BeautifulSoup(html, 'html5lib')
File "/home/dev/askbot/env/local/lib/python2.7/site-packages/bs4/__init__.py" in __init__
  167.             if os.path.exists(markup):
File "/home/dev/askbot/env/lib/python2.7/genericpath.py" in exists
  18.         os.stat(path)

Exception Type: UnicodeEncodeError at /questions/ask/
Exception Value: 'ascii' codec can't encode characters in position 3-5: ordinal not in range(128)