Uploaded image for project: 'Hue (READ ONLY)'
  1. Hue (READ ONLY)
  2. HUE-672

logs page can't handle non-ascii characters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta
    • Fix Version/s: backlog, 2.0.1
    • Component/s: core.api
    • Labels:
      None

      Description

      If the logs has a non-ascii character, the server throws an unstyled 500 page. So this tracks two issues:

      1. The error page looks ugly.
      2. Logs not handling i18n.

      The server backtrace is:

      [11/Apr/2012 12:27:27 +0000] access       WARNING  172.29.64.48 bcwalrus - "GET /logs HTTP/1.0"
      [11/Apr/2012 12:27:27 +0000] middleware   INFO     Processing exception: 'ascii' codec can't decode 
      byte 0xb3 in position 72: ordinal not in range(128): Traceback (most recent call last):
        File "/usr/share/hue/build/env/lib/python2.4/site-packages/Django-1.2.3-py2.4.egg/django/core/hand
      lers/base.py", line 100, in get_response
          response = callback(request, *callback_args, **callback_kwargs)
        File "/usr/share/hue/desktop/core/src/desktop/views.py", line 51, in log_view
          return render('logs.mako', request, dict(log=[l for l in h.buf]))
        File "/usr/share/hue/desktop/core/src/desktop/lib/django_util.py", line 211, in render
          template_lib=template_lib,
        File "/usr/share/hue/desktop/core/src/desktop/lib/django_util.py", line 138, in _render_to_response
          return django_mako.render_to_response(template, *args, **kwargs)
        File "/usr/share/hue/desktop/core/src/desktop/lib/django_mako.py", line 115, in render_to_response
          return HttpResponse(render_to_string(template_name, data_dictionary), **kwargs)
        File "/usr/share/hue/desktop/core/src/desktop/lib/django_mako.py", line 104, in render_to_string_normal
          result = template.render(**data_dict)
        File "/usr/share/hue/build/env/lib/python2.4/site-packages/Mako-0.3.4-py2.4.egg/mako/template.py", line 189, in render
          return runtime._render(self, self.callable_, args, data)
        File "/usr/share/hue/build/env/lib/python2.4/site-packages/Mako-0.3.4-py2.4.egg/mako/runtime.py", line 403, in _render
          _render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))
        File "/usr/share/hue/build/env/lib/python2.4/site-packages/Mako-0.3.4-py2.4.egg/mako/runtime.py", line 434, in _render_context
          _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
        File "/usr/share/hue/build/env/lib/python2.4/site-packages/Mako-0.3.4-py2.4.egg/mako/runtime.py", line 457, in _exec_template
          callable_(context, *args, **kwargs)
        File "/tmp/tmpFSmfhw/desktop/logs.mako.py", line 58, in render_body
          __M_writer(filters.html_escape(unicode(l )))
      UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 72: ordinal not in range(128)
      

        Attachments

          Activity

            People

            • Assignee:
              romain Romain Rigaux
              Reporter:
              bcwalrus bc Wong
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: