Pylons/pyramid_debugtoolbar — Issue #40: 'NoneType' object has no attribute 'split'
Author: mankyd
Created: 2011-10-15 13:56:19+00:00
State: open

Made a brand new pyramid installation this morning. Followed the basic steps:

# new virtualenv
# pip install pyramid
# paster create -t pyramid_routesalchemy app
# cd app
# python setup.py develop
# paster serve develpment.ini

Visited the page in my browser, and immediately get this (truncated for clarity):

File "/home/dave/.virtualenvs/app/lib/python2.7/site-packages/pyramid/router.py", line 176, in __call__
response = self.handle_request(request)
File "/home/dave/.virtualenvs/app/lib/python2.7/site-packages/pyramid_debugtoolbar-0.9.4-py2.7.egg/pyramid_debugtoolbar/toolbar.py", line 105, in toolbar_tween
toolbar = DebugToolbar(request, panel_classes)
File "/home/dave/.virtualenvs/app/lib/python2.7/site-packages/pyramid_debugtoolbar-0.9.4-py2.7.egg/pyramid_debugtoolbar/toolbar.py", line 27, in __init__
p_dt_active = url_unquote(self.request.cookies.get('p_dt_active', ''))
File "/usr/lib/python2.7/urllib.py", line 1203, in unquote
res = s.split('%')
AttributeError: 'NoneType' object has no attribute 'split'

Fix for me was to replace:

p_dt_active = url_unquote(self.request.cookies.get('p_dt_active', ''))

with:

p_dt_active = url_unquote(self.request.cookies.get('p_dt_active') or '')