UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Issue #602 resolved
Иван Багаев created an issue

Create clean mercurial repo test-hg in webinterface

$ hg clone http://admin@

$ test-hg

$ hg add

$ hg commit -m "test commit"

$ hg push

проталкиваем в http://admin@

требуется http-авторизация

область (realm): RhodeCode authentication

пользователь: admin


ищем изменения

прервано: HTTP Error 500: Internal Server Error

On server view this traceback http://pastebin.com/mgTq9rL2

Comments (18)

  1. Marcin Kuzminski repo owner

    Hmm, that looks odd, and the error is from Mercurial itself. Do you have somewhere hooks that have non-ascii names ?

  2. Иван Багаев reporter

    not. This clean instalation. Also, I helped start the server as follows

    LC_ALL=en_US.utf8 paster serve production.ini

  3. Marcin Kuzminski repo owner

    Hmm, what about .hgrc file containing some hooks in a repository ? It must be that something non-ascii is there since it brakes in there, can you get somehow the values of (hname, funcname)) from mercurial ?

  4. Олег Петрачев

    I have the same problem:

    1. Clean install of RhodeCode 1.4.4 on FreeBSD 7.4 with python2.6.
    2. Set up one repository (minimal setup - only name and set private), all characters are ascii.
    3. hg clone ; hg add ; hg commit ; hg push -> abort: HTTP Error 500: Internal Server Error
    4. Restart rhodecode with: LC_ALL=C paster serve production.ini
    5. Push passes.

    Looks like setting C locale helps with Internal server error, but it leads to another problem: non-ascii characters from log messages are displayed as question marks in Journal.

    Can "500 error" be fixed somehow?

  5. Marcin Kuzminski repo owner

    How can this throw UnicodeDecodeError, when there's no non-ascii chars ! How do you serve rhodecode ? Did you try playing with setting different LOCALE, LANG env variables ?

  6. Denis Savenko

    I've installed new virtualenv with RhodeCode 1.4.4 in it. Config and database used from old version which worked fine before upgrade. Operation system is fully updated Ubuntu 11.04.

    I tried to start rhodecode both with init-script and "paster serve" - results are the same. Locale switching doesn't helps.

  7. Marcin Kuzminski repo owner

    Can you try with latest beta ? also i once got the strange errors when i passed some unicode to mercurial instead of strings, i wonder if doing

    ui.note(_("calling hook %s: %s\n") % (str(hname), str(funcname)))

    Would help

  8. Marcin Kuzminski repo owner

    Ok, than i now know how to fix it in rhodecode, need to make sure everything sent to mercurial is string. Thanks for help debugging this.

  9. Marcin Kuzminski repo owner

    a fix in rhodecode was introduced now in beta, can you test and confirm if it fixes the issue for you ?

  10. Log in to comment