Skip to content

encoding problems #9

Closed
19emtuck opened this Issue Aug 7, 2011 · 2 comments

3 participants

@19emtuck
19emtuck commented Aug 7, 2011

there's some encoding problems, pyramid_debugtoolbar try to create a template with request vars and crash.
It's easy to reproduce, I've try it with lot's of different projects.
The easiest is shootout project (https://github.com/virhilo/shootout.git), (just a little correction in login.pt, an include
tag without '/>')

(thx for this beautiful project !)

the exception :

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

the full traceback

URL: http://localhost:6543/
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/WebError-0.10.3-py2.6.egg/weberror/evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/repoze.tm2-1.0b1-py2.6.egg/repoze/tm/init.py', line 23 in call
result = self.application(environ, save_status_and_headers)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/router.py', line 186 in call
response = self.handle_request(request)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/toolbar.py', line 137 in toolbar_tween
toolbar.process_response(response)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/toolbar.py', line 43 in process_response
vars, request=request)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 69 in render
return helper.render(value, None, request=request)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 416 in render
result = renderer(value, system_values)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_jinja2-1.1-py2.6.egg/pyramid_jinja2/init.py', line 277 in call
return self.template.render(system)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/Jinja2-2.5.5-py2.6.egg/jinja2/environment.py', line 891 in render
return self.environment.handle_exception(exc_info, True)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/templates/toolbar.jinja2', line 62 in top-level template code
{{ panel.content()|safe }}
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/panels/request_vars.py', line 45 in content
request=self.request)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/panels/init.py', line 24 in render
return render(template_name, vars, request=request)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 69 in render
return helper.render(value, None, request=request)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 416 in render
result = renderer(value, system_values)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_jinja2-1.1-py2.6.egg/pyramid_jinja2/init.py', line 277 in call
return self.template.render(system)
File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/Jinja2-2.5.5-py2.6.egg/jinja2/environment.py', line 891 in render
return self.environment.handle_exception(exc_info, True)
URL: http://localhost:6543/
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/WebError-0.10.3-py2.6.egg/weberror/evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/repoze.tm2-1.0b1-py2.6.egg/repoze/tm/init.py', line 23 in call
result = self.application(environ, save_status_and_headers)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/router.py', line 186 in call
response = self.handle_request(request)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/toolbar.py', line 137 in toolbar_tween
toolbar.process_response(response)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/toolbar.py', line 43 in process_response
vars, request=request)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 69 in render
return helper.render(value, None, request=request)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 416 in render
result = renderer(value, system_values)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_jinja2-1.1-py2.6.egg/pyramid_jinja2/init.py', line 277 in call
return self.template.render(system)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/Jinja2-2.5.5-py2.6.egg/jinja2/environment.py', line 891 in render
return self.environment.handle_exception(exc_info, True)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/templates/toolbar.jinja2', line 62 in top-level template code
{{ panel.content()|safe }}
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/panels/request_vars.py', line 45 in content
request=self.request)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/panels/init.py', line 24 in render
return render(template_name, vars, request=request)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 69 in render
return helper.render(value, None, request=request)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid-1.1.1dev-py2.6.egg/pyramid/renderers.py', line 416 in render
result = renderer(value, system_values)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_jinja2-1.1-py2.6.egg/pyramid_jinja2/init.py', line 277 in call
return self.template.render(system)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/Jinja2-2.5.5-py2.6.egg/jinja2/environment.py', line 891 in render
return self.environment.handle_exception(exc_info, True)
File '/home/sbard/geek/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/panels/templates/request_vars.jinja2', line 110 in top-level template code
{{ value|escape }}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 3462: ordinal not in range(128)File '/home/tuck/dev/python/pyramide/myvenv/lib/python2.6/site-packages/pyramid_debugtoolbar-0.2-py2.6.egg/pyramid_debugtoolbar/panels/templates/request_vars.jinja2', line 110 in top-level template code
{{ value|escape }}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 3462: ordinal not in range(128)

@asakura
asakura commented Aug 9, 2011

I have same error.

May be #10 useful for you.

@mcdonc mcdonc added a commit that closed this issue Aug 10, 2011
@mcdonc mcdonc - Request vars panel would cause a UnicodeDecodeError under some
  circumstances (see #9).

  Closes #9

  Closes #10

- Add an "alias" to the add_tween call; requires newest Pyramid trunk.
ca179ec
@mcdonc mcdonc closed this in ca179ec Aug 10, 2011
@mcdonc
Pylons Project member
mcdonc commented Aug 10, 2011

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.