All pastes #423490 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-04 06:11 UTC
rendered paste body
 --> -->
 
 
KeyError	Python 2.4.1: /usr/bin/python2.4
Wed Apr 4 03:06:23 2007

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 /home/anthony/svn/pyweek/trunk/lib/Http.py in wrapper(self=<Http.GameRequest instance>, *a=(), **kw={})
   21         """make exceptions appear in the browser instead of stderr"""
   22         try:
   23             original_function(self, *a, **kw)
   24         except:
   25             cgitb.Hook(display=1, logdir=None, context=5, format="html",
original_function = <function do_GET>, self = <Http.GameRequest instance>, a = (), kw = {}
 /home/anthony/svn/pyweek/trunk/lib/Http.py in do_GET(self=<Http.GameRequest instance>)
   47                 break
   48         # Handle it!
   49         urlHandler(self)
   50 
   51     @pretty
urlHandler = <function play>, self = <Http.GameRequest instance>
 /home/anthony/svn/pyweek/trunk/lib/game.py in play(request=<Http.GameRequest instance>)
   39         room = world.world.getByName ("room404")
   40     # And let's rock:
   41     room.handleRequest (request)
   42     request.avatar.save()
   43 
room = <room.MultiRoom object>, room.handleRequest = <bound method MultiRoom.handleRequest of <room.MultiRoom object>>, request = <Http.GameRequest instance>
 /home/anthony/svn/pyweek/trunk/lib/room.py in handleRequest(self=<room.MultiRoom object>, request=<Http.GameRequest instance>)
  139             request.avatar.roomInfo[self.id]['choice'] = choice
  140         self.__choice = choice
  141         rv = self.__rooms[choice].handleRequest(request)
  142         if request.path.endswith('/return'):
  143             del request.avatar.roomInfo[self.id]
rv undefined, self = <room.MultiRoom object>, self.__rooms undefined, choice = 'M', ].handleRequest undefined, request = <Http.GameRequest instance>
 /home/anthony/svn/pyweek/trunk/lib/room.py in handleRequest(self=<room.MultiRoom object>, request=<Http.GameRequest instance>)
  139             request.avatar.roomInfo[self.id]['choice'] = choice
  140         self.__choice = choice
  141         rv = self.__rooms[choice].handleRequest(request)
  142         if request.path.endswith('/return'):
  143             del request.avatar.roomInfo[self.id]
rv undefined, self = <room.MultiRoom object>, self.__rooms undefined, choice = 0, ].handleRequest undefined, request = <Http.GameRequest instance>
 /home/anthony/svn/pyweek/trunk/lib/rooms/CombatRoom.py in handleRequest(self=<rooms.CombatRoom.CombatRoom object>, request=<Http.GameRequest instance>)
   21     def handleRequest (self, request):
   22         action = request.path.split ('/')[-1]
   23         enemy = enemyFactory.getById (self.enemy)
   24         avatar = request.avatar
   25         if action == 'return':
enemy undefined, global enemyFactory = <enemy.EnemyFactory object>, enemyFactory.getById = <bound method EnemyFactory.getById of <enemy.EnemyFactory object>>, self = <rooms.CombatRoom.CombatRoom object>, self.enemy = 'irate_commode_patron'
 /home/anthony/svn/pyweek/trunk/lib/enemy.py in getById(self=<enemy.EnemyFactory object>, id='irate_commode_patron')
   77 
   78     def getById (self, id):
   79         return self.items[id]
   80 
   81 enemyFactory = EnemyFactory()
self = <enemy.EnemyFactory object>, self.items = {'4d_snack': <enemy.Enemy object>, 'coworker_in_need': <enemy.IniEnemy object>}, id = 'irate_commode_patron'

KeyError: 'irate_commode_patron'
      args = ('irate_commode_patron',)