Wheo open non ascii file in web

Issue #852 resolved
Michael Zakharov created an issue

path like this http://rhodecode.lan/Utils/Conversion/files/1e34ec9c55d32367f18499f7dfe2eba56f304d43/Document/Руководство администратора.doc

2013-05-31 11:08:10.667 ERROR [waitress] Exception when serving /Utils/Conversion/files/1e34ec9c55d32367f18499f7dfe2eba56f304d43/Document/Руководство администратора.doc
Traceback (most recent call last):
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/waitress-0.8.2-py2.7.egg/waitress/channel.py", line 329, in service
    task.service()
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/waitress-0.8.2-py2.7.egg/waitress/task.py", line 173, in service
    self.execute()
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/waitress-0.8.2-py2.7.egg/waitress/task.py", line 380, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/gzipper.py", line 38, in __call__
    response.gzip_start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/cascade.py", line 130, in __call__
    return self.apps[-1](environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/registry.py", line 379, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/middleware/https_fixup.py", line 46, in __call__
    return self.application(environ, custom_start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/middleware.py", line 163, in __call__
    self.app, new_environ, catch_exc_info=True)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/util.py", line 48, in call_wsgi_application
    app_iter = application(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/middleware/wrapper.py", line 40, in __call__
    return self.application(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/base.py", line 249, in __call__
    return self._handle_request(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/middleware/simplegit.py", line 109, in _handle_request
    return self.application(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/base.py", line 249, in __call__
    return self._handle_request(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/middleware/simplehg.py", line 73, in _handle_request
    return self.application(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/WebError-0.10.3-py2.7.egg/weberror/errormiddleware.py", line 156, in __call__
    return self.application(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Beaker-1.6.4-py2.7.egg/beaker/middleware.py", line 155, in __call__
    return self.wrap_app(environ, session_start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Routes-1.13-py2.7.egg/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/wsgiapp.py", line 107, in __call__
    response = self.dispatch(controller, environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/wsgiapp.py", line 312, in dispatch
    return controller(environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/lib/base.py", line 309, in __call__
    return WSGIController.__call__(self, environ, start_response)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py", line 211, in __call__
    response = self._dispatch_call()
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py", line 162, in _dispatch_call
    response = self._inspect_call(func)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py", line 105, in _inspect_call
    result = self._perform_call(func, args)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/core.py", line 57, in _perform_call
    return func(**args)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/RhodeCode-1.6.0-py2.7.egg/rhodecode/controllers/error.py", line 72, in document
    return render('/errors/error_document.html')
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/templating.py", line 243, in render_mako
    cache_type=cache_type, cache_expire=cache_expire)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/templating.py", line 218, in cached_template
    return render_func()
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/templating.py", line 240, in render_template
    return literal(template.render_unicode(**globs))
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.3-py2.7.egg/mako/template.py", line 421, in render_unicode
    as_unicode=True)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.3-py2.7.egg/mako/runtime.py", line 766, in _render
    **_kwargs_for_callable(callable_, data))
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.3-py2.7.egg/mako/runtime.py", line 798, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.3-py2.7.egg/mako/runtime.py", line 819, in _exec_template
    _render_error(template, context, e)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.3-py2.7.egg/mako/runtime.py", line 828, in _render_error
    result = template.error_handler(context, error)
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/Mako-0.7.3-py2.7.egg/mako/runtime.py", line 817, in _exec_template
    callable_(context, *args, **kwargs)
  File "/opt/rhodecode/data/templates/errors/error_document.html.py", line 61, in render_body
    __M_writer(escape(message))
  File "/opt/rhodecode-venv/lib/python2.7/site-packages/WebHelpers-1.3-py2.7.egg/webhelpers/pylonslib/flash.py", line 299, in __html__
    return escape(self.message)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 60: ordinal not in range(128)

Comments (6)

  1. Michael Zakharov reporter

    Afte web server crash and show

    Internal Server Error
    
    The server encountered an unexpected internal server error
    
    (generated by waitress)
    

    until cookies clean

  2. Marcin Kuzminski repo owner

    Despite that file would be unreachable (due to not beeing utf8 encode) the error from this ticket is now fixed.

  3. Log in to comment