exceptions.ZeroDivisionError

integer division or modulo by zero

/home/blackbird/Developement/WSGIarea/colubrid/trunk/examples/objectapplication.py in index, line 38

Traceback

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.

__call__ in /home/blackbird/Developement/WSGIarea/colubrid/trunk/colubrid/middlewares/debug.py

334 try:
335 app = getattr(__import__(self.module, '', '', ['']), self.handler)
336 result = app(environ, start_response)
337 try:
338 request = result.request
339 except:
340 pass
341 appiter = iter(result)
342 for line in appiter:
343 yield line
344 except:
345 exc_info = sys.exc_info()
346 try:
347 headers = [('Content-Type', 'text/html')]

local variables

NameValue
app<class 'examples.objectapplication.DispatcherApplication'>
appiterNone
environ{'APPLICATION_REQUEST': '/blog/', 'DOCUMENT_ROOT': '/htdocs', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': '*/*', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'wsgitest', 'HTTP_USER_AGENT': 'Wget/1.10', 'PATH': '/usr/local/bin:/usr/bin:/bin', 'PATH_INFO': '/blog/', 'PATH_TRANSLATED': '/home/blackbird/Developement/WSGIarea/colubrid/trunk/test.cgi/blog/', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '59394', 'REQUEST_METHOD': 'GET', 'REQUEST_URI': '/blog/', 'SCRIPT_FILENAME': '/home/blackbird/Developement/WSGIarea/colubrid/trunk/test.cgi', 'SCRIPT_NAME': '', 'SERVER_ADDR': '127.0.0.1', 'SERVER_ADMIN': '[no address given]', 'SERVER_NAME': 'wsgitest', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.0', 'SERVER_SIGNATURE': '', 'SERVER_SOFTWARE': 'Apache/2.0.54 (Ubuntu) mod_jk/1.2.15 mod_python/3.1.3 Python/2.4.2 PHP/4.4.0-3ubuntu1', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0xb7dfd0b0>, 'wsgi.input': <open file '<stdin>', mode 'r' at 0xb7dfd020>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': True, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}
exc_info(<class exceptions.ZeroDivisionError at 0xb7df4a1c>, <exceptions.ZeroDivisionError instance at 0xb7a8398c>, <traceback object at 0xb7a7f0cc>)
headers[('Content-Type', 'text/html')]
request<colubrid.request.Request object at 0xb7b73e2c>
result<examples.objectapplication.DispatcherApplication object at 0xb7b73d2c>
self<colubrid.middlewares.debug.DebuggedApplication object at 0xb7c02d4c>
start_response<function start_response at 0xb7b7a41c>

__iter__ in /home/blackbird/Developement/WSGIarea/colubrid/trunk/colubrid/application.py

109 pass
110
111 def process_request(self):
112 raise NotImplementedError
113
114 def __iter__(self):
115 try:
116 self.process_request()
117 except RequestBreak:
118 pass
119 except Exception, e:
120 if isinstance(e, ColubridException):
121 e(self)
122 else:

local variables

NameValue
e<exceptions.ZeroDivisionError instance at 0xb7a8398c>
self<examples.objectapplication.DispatcherApplication object at 0xb7b73d2c>

process_request in /home/blackbird/Developement/WSGIarea/colubrid/trunk/colubrid/application.py

221 # if it forces an redirect the __iter__ method skips the next
222 # part. call it magic if you like -.-
223 self._fix_slash(handler)
224
225 if min_len <= handler_len <= max_len:
226 parent = handler.im_class()
227 parent.request = self.request
228 return handler(parent, *handler_args)
229
230 raise PageNotFoundException
231
232 def _fix_slash(self, handler):
233 """
234 Fixes the trailing slash in an url.

local variables

NameValue
args[]
defaults()
handler<unbound method Blog.index>
handler_args[]
handler_len0
kwargsNone
max_len0
min_len0
parent<examples.objectapplication.Blog object at 0xb7a8396c>
path['blog']
path_info'/blog/'
self<examples.objectapplication.DispatcherApplication object at 0xb7b73d2c>
varargsNone
vargsNone

index in /home/blackbird/Developement/WSGIarea/colubrid/trunk/examples/objectapplication.py

31 self.request.write('<h1>About Hello World</h1><p>...</p>')
32
33
34class Blog(object):
35
36 def index(self):
37 self.request.write('<h1>Blog Index</h1>')
38 1/0
39
40 def article(self, article_id):
41 self.request.write('<h1>Article #%s</h1>' % article_id)
42
43 def archive(self, year=None, month=None, day=None):
44 this = datetime.now()

local variables

NameValue
self<examples.objectapplication.Blog object at 0xb7a8396c>

Request Data

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

environ
NameValue
APPLICATION_REQUEST'/blog/'
DOCUMENT_ROOT'/htdocs'
GATEWAY_INTERFACE'CGI/1.1'
HTTP_ACCEPT'*/*'
HTTP_CONNECTION'Keep-Alive'
HTTP_HOST'wsgitest'
HTTP_USER_AGENT'Wget/1.10'
PATH'/usr/local/bin:/usr/bin:/bin'
PATH_INFO'/blog/'
PATH_TRANSLATED'/home/blackbird/Developement/WSGIarea/colubrid/trunk/test.cgi/blog/'
QUERY_STRING''
REMOTE_ADDR'127.0.0.1'
REMOTE_PORT'59394'
REQUEST_METHOD'GET'
REQUEST_URI'/blog/'
SCRIPT_FILENAME'/home/blackbird/Developement/WSGIarea/colubrid/trunk/test.cgi'
SCRIPT_NAME''
SERVER_ADDR'127.0.0.1'
SERVER_ADMIN'[no address given]'
SERVER_NAME'wsgitest'
SERVER_PORT'80'
SERVER_PROTOCOL'HTTP/1.0'
SERVER_SIGNATURE''
SERVER_SOFTWARE'Apache/2.0.54 (Ubuntu) mod_jk/1.2.15 mod_python/3.1.3 Python/2.4.2 PHP/4.4.0-3ubuntu1'
wsgi.errors<open file '<stderr>', mode 'w' at 0xb7dfd0b0>
wsgi.input<open file '<stdin>', mode 'r' at 0xb7dfd020>
wsgi.multiprocessTrue
wsgi.multithreadFalse
wsgi.run_onceTrue
wsgi.url_scheme'http'
wsgi.version(1, 0)
GET
no data given
POST
no data given
FILES
no data given
COOKIES
no data given