can't decode byte 0xc3 in position 10: ordinal not in range(128)

Issue #169 resolved
Marc Sanfaçon created an issue

I just pulled the latest changes from the 1.2 Beta and updated my install. Now I get the following error when trying to log on

{{{ Module rhodecode.controllers.home:67 in index

return render('/index.html') Module pylons.templating:243 in render_mako cache_type=cache_type, cache_expire=cache_expire) Module pylons.templating:218 in cached_template return render_func() Module pylons.templating:240 in render_template return literal(template.render_unicode(globs)) Module mako.template:305 in render_unicode as_unicode=True) Module mako.runtime:660 in _render kwargs_for_callable(callable, data)) Module mako.runtime:692 in render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) Module mako.runtime:713 in _exec_template _render_error(template, context, e) Module mako.runtime:722 in _render_error result = template.error_handler(context, error) Module mako.runtime:711 in _exec_template callable(context, args, *kwargs) Module _base_root_html:50 in render_body M_writer(escape(next.body())) Module _base_base_html:127 in render_body M_writer(escape(next.main())) Module _index_html:259 in render_main M_writer(escape(repo['contact'])) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128) CGI Variables CONTENT_LENGTH '0' CONTENT_TYPE '; charset="utf-8"' HTTP_ACCEPT 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,/;q=0.5' HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.3' HTTP_ACCEPT_ENCODING 'gzip,deflate,sdch' HTTP_ACCEPT_LANGUAGE 'en-US,en;q=0.8,fr-CA;q=0.6' HTTP_CACHE_CONTROL 'max-age=0' HTTP_CONNECTION 'Keep-Alive' HTTP_COOKIE 'switchTo5x=8; unam=3749672-12f0e487532-2c7632af-1; marketingid=other:lk:http://twitter.com/; utmz=91313928.1302725353.12.3.utmcsr=twitter.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utma=91313928.213794269.1288189782.1301834220.1302725353.12; _mkto_trk=id:969-GCA-889&token:_mch-abc.com-1288189782538-61792; rhodecode=98af5af22c459bfe9dfa4d31f1f2bcf307cc7e49b59e4c9188790388b4cb7851b960e65e' HTTP_HOST 'mercurial' HTTP_REFERER 'https://mercurial/_admin/login?came_from=%2F' HTTP_USER_AGENT 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16' HTTP_VIA '1.1 mercurialcom' HTTP_X_FORWARDED_FOR '192.168.128.6' HTTP_X_FORWARDED_HOST 'mercurial' HTTP_X_FORWARDED_SERVER 'mercurial' PATH_INFO '/' REMOTE_ADDR '192.168.64.78' REQUEST_METHOD 'GET' SERVER_NAME '192.168.64.78' SERVER_PORT '5000' SERVER_PROTOCOL 'HTTP/1.1' WSGI Variables application <rhodecode.lib.middleware.simplegit.SimpleGit object at 0x4281ed0> beaker.get_session <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x42817d0>> beaker.session {'rhodecode_user': <AuthUser('id:2:admin|True')>, '_accessed_time': 1303042029.831871, '_creation_time': 1303042023.07813} paste.httpserver.thread_pool <paste.httpserver.ThreadPool object at 0x290aed0> paste.registry <paste.registry.Registry object at 0x7f3ecdfcbbd0> paste.throw_errors True pylons.action_method <bound method HomeController.index of <rhodecode.controllers.home.HomeController object at 0x7f3ecdfcbed0>> pylons.controller <rhodecode.controllers.home.HomeController object at 0x7f3ecdfcbed0> pylons.environ_config {'session': 'beaker.session', 'cache': 'beaker.cache'} pylons.pylons <pylons.util.PylonsContext object at 0x7f3ecdfcbe50> pylons.routes_dict {'action': u'index', 'controller': u'home'} routes.route <routes.route.Route object at 0x3ecb550> routes.url <routes.util.URLGenerator object at 0x7f3ecdfcbcd0> webob._parsed_query_vars (GET([]), '') webob.adhoc_attrs {'language': 'en-us'} wsgi process 'Multithreaded' wsgiorg.routing_args (<routes.util.URLGenerator object at 0x7f3ecdfcbcd0>, {'action': u'index', 'controller': u'home'}) }}}

Comments (6)

  1. Marcin Kuzminski repo owner

    there was nothing changed in term of unicode decoding recently, does repo['contact'] have some non utf8 data inside ? turn on debug in .ini and use interactive debbuger to display repo['contact']

  2. Marc Sanfaçon reporter

    Actually, the last name of the contact has a ç in it.

    I changed it directly in the DB and it is working now. I actually changed the owner of the REPO to that user, so that was probably the problem. However, the name was set in Rhodecode, I would have expected it to correctly encode it.

  3. Marcin Kuzminski repo owner

    That's odd input fields should take proper encoding, maybe someone copy-paste it with broken encoding ? i just did same example on my rhodecode instance, i created an user with ç char in name, and made him owner of a repository, no problems with encoding.

  4. Marc Sanfaçon reporter

    Maybe I copy/pasted the ç, don't remember.

    One thing that I find strange is that I updated the DB but I still see the ç in Rhodecode ui. I restarted the service, but the ç is still there. At least now, it is working.

  5. Marcin Kuzminski repo owner

    it's cache, you might want to delete data dir after code updates.

    I'm closing this issue, if you'll get any errors let me know or reopen it.

  6. Log in to comment