First time here? Check out the FAQ!
2

Unicode error
 

Hi!
I have an unicode error when using user with Cyrillic name and going to Profile -> Email subscriptions.
The traceback:

Environment:


Request Method: GET
Request URL: http://ask.jungland.org/users/4/reguliator/?sort=email_subscriptions

Django Version: 1.3
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.sitemaps',
 'askbot',
 'askbot.deps.django_authopenid',
 'south',
 'askbot.deps.livesettings',
 'keyedcache',
 'robots',
 'django_countries',
 'djcelery',
 'djkombu']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
 'askbot.middleware.cancel.CancelActionMiddleware',
 'askbot.deps.recaptcha_django.middleware.ReCaptchaMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'askbot.middleware.view_log.ViewLogMiddleware',
 'askbot.middleware.spaceless.SpacelessMiddleware')


Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/projects/sites/jungland/src/forum/askbot/views/users.py" in user
  963.     return user_view_func(request, profile_owner, context)
File "/home/projects/sites/jungland/src/forum/askbot/views/users.py" in wrapped_func
  64.         return f(request, profile_owner, context)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
  93.                     response = view_func(request, *args, **kwargs)
File "/home/projects/sites/jungland/src/forum/askbot/views/users.py" in user_email_subscriptions
  882.     logging.debug(get_request_info(request))
File "/home/projects/sites/jungland/src/forum/askbot/utils/http.py" in get_request_info
  44.     info += 'user: %s\n' % request.user

Exception Type: UnicodeDecodeError at /users/4/reguliator/
Exception Value: 'ascii' codec can't decode byte 0xd0 in position 6: ordinal not in range(128)

The user is actually named Регулятор. Actually this happens only if you are logged in as Регулятор and go to YOUR subscriptions. if you are logged as other user, it's OK.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 13 years ago
DominiCattus's avatar
105
DominiCattus
asked 13 years ago

Comments

Yes, I've reproduced this. Will fix shortly.
Evgeny's avatar Evgeny (13 years ago)
Works on this site now, just tested.
Evgeny's avatar Evgeny (13 years ago)
looks like there is another one!!! will need to go through through all uses of the username in any output. I made a quick hack fix on this site though.
Evgeny's avatar Evgeny (13 years ago)
see more comments

1 Answer

1

Fixed in 0.6.98. Thanks.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 13 years ago
link

Comments

see more comments