TypeError

unsupported operand type(s) for +: 'int' and 'unicode'

'error.html' in <module>, line 3

Traceback (click to switch to raw view)

A problem occurred in your Python WSGI application. Here is the sequence of function calls leading up to the error, in the order they occurred. Click on a header to show context lines.

test in exception.py

1from jinja import Environment, FileSystemLoader
2from colubrid.debug import DebuggedApplication
3from wsgiref.simple_server import make_server
4e = Environment(loader=FileSystemLoader('templates'))
5
6def test(*args):
7 tmpl = e.loader.load('error.html')
8 tmpl.render(items=range(10))
9
10make_server("localhost", 7000, DebuggedApplication(test, False)).serve_forever()

▸ local variables

NameValue
'args'({'COLORTERM': 'gnome-terminal', 'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'text/plain', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-ctcwJH7DB2,guid=ca2af0450a6f14bc3c6d22b3230dff00', 'DESKTOP_SESSION': 'default', 'DISPLAY': ':0.0', 'GATEWAY_INTERFACE': 'CGI/1.1', 'GDMSESSION': 'default', 'GDM_XSERVER_LOCATION': 'local', 'GNOME_DESKTOP_SESSION_ID': 'Default', 'GNOME_KEYRING_SOCKET': '/tmp/keyring-97xe6c/socket', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/blackbird/.gtkrc-1.2-gnome2', 'HISTCONTROL': 'ignoredups', 'HOME': '/home/blackbird', 'HTTP_ACCEPT': 'text/xml,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.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'DWd4db234d24ab29be1b2ab2618e9e178e=YmxhY2tiaXJkfDF8VWR2ZU9JK0xmNFU9', 'HTTP_HOST': 'localhost:7000', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20060601 Firefox/2.0.0.2 (Ubuntu-edgy)', 'LANG': 'en_US.UTF-8', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'LOGNAME': 'blackbird', 'LS_COLORS': 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:', 'OLDPWD': '/home/blackbird/Development/jinja/trunk', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games', 'PATH_INFO': '/', 'PWD': '/home/blackbird/Development/jinja/trunk/tests', 'PYTHONPATH': '/home/blackbird/Development/jinja/trunk/tests/..', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_HOST': 'localhost.localdomain', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'localhost.localdomain', 'SERVER_PORT': '7000', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.5', 'SESSION_MANAGER': 'local/volverine:/tmp/.ICE-unix/4572', 'SHELL': '/bin/bash', 'SHLVL': '2', 'SSH_AGENT_PID': '4607', 'SSH_AUTH_SOCK': '/tmp/ssh-gFXngS4572/agent.4572', 'TERM': 'xterm', 'USER': 'blackbird', 'USERNAME': 'blackbird', 'WINDOWID': '41964402', 'XAUTHORITY': '/home/blackbird/.Xauthority', '_': '/usr/bin/python', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0xb7df30b0>, 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0xb796189c>, 'wsgi.input': <socket._fileobject object at 0xb7967ae4>, 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}, <bound method ServerHandler.start_response of <wsgiref.simple_server.ServerHandler instance at 0xb7964fac>>)
'tmpl'<jinja.translators.python.Template object at 0xb796ae0c>

<module> in 'error.html'

1<ul>
2{% for item in items %}
3 {{ item + "this will break the application" }}
4{% endfor %}
5</ul>

▸ local variables

NameValue
'item'0
'items'[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
'loop'<LoopContext 1/10>

Request Data

The following list contains all important request variables. Click on a header to expand the list.