keyerror exception on creating or viewing course schedule

Bug #783422 reported by Bill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool
Fix Released
Undecided
Unassigned

Bug Description

Server-- Ubuntu 11.04
SchoolTool version: 1.4, installed from Ubuntu 11.04 repositories. Service tested from Safari, Chromium on Linux, Firefox 4.01 on Linux and 3.6 on Mac os
ttf-liberation was installed according to instructions

This situation occurred on separate clean installs

Similar errors that have been written about are fixed by not using foreign characters like the umlaut, but no foreign characters have been used here.
------------------------------------------------------------------------------------------------
Exception

  KeyError: u'h'
Traceback

  File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 134, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.6/dist-packages/zope/app/publication/zopepublication.py", line 205, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 109, in mapply
  return debug_call(obj, args)
Extra information: <bound method SectionTimetableSetupView.__call__ of <zope.browserpage.metaconfigure.SectionTimetableSetupView object at 0xe06b4cc>>
File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 115, in debug_call
  return obj(*args)
File "/usr/lib/python2.6/dist-packages/schooltool/timetable/browser/__init__.py", line 494, in __call__
  self.days = self.getDays(self.ttschema)
File "/usr/lib/python2.6/dist-packages/schooltool/timetable/browser/__init__.py", line 485, in getDays
  return list(days(ttschema))
File "/usr/lib/python2.6/dist-packages/schooltool/timetable/browser/__init__.py", line 472, in days
  for day_id, day in schema.items():
File "/usr/lib/python2.6/dist-packages/schooltool/timetable/schema.py", line 115, in items
  return [(day, self.days[day]) for day in self.day_ids]
File "/usr/lib/python2.6/UserDict.py", line 22, in __getitem__
  raise KeyError(key)
-------------------------------------------------------------------------------------------------------------------------

Thanks for the help!

Revision history for this message
Bill (billclark) wrote :

Sorry, server information incorrect-- this is on Ubuntu 10.04.

Am getting similar error on SchoolTool 1.6 on 11.04 when working with timetables as well.

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) wrote :

Thanks for an excellent bug report!

It seems that there was a problem when school timetables were set up. Do you happen to remember how this was done? Spreadsheet import, wizard (School Timetables -> New Timetable -> [Next]), simple or advanced setup?

If you go to "School Timetables", can you look at all timetables (follow links)?

Thanks!

tags: added: timetables
tags: added: traceback
Revision history for this message
Bill (billclark) wrote :
Download full text (5.5 KiB)

Thank you for the quick response!

Problem is there are a couple of different installs I'm testing and they are starting to get confused. Have used the wizard and the advanced setup with similar results-- no spreadsheet import was used.

School Timetables>default (there are no other timetables) yields this error:

Exception

  KeyError: u'h'
Traceback

  File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 134, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.6/dist-packages/zope/app/publication/zopepublication.py", line 205, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 109, in mapply
  return debug_call(obj, args)
Extra information: <zope.browserpage.simpleviewclass.SimpleViewClass from /usr/lib/python2.6/dist-packages/schooltool/timetable/browser/templates/timetableschema.pt object at 0xe06b6cc>
File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 115, in debug_call
  return obj(*args)
File "/usr/lib/python2.6/dist-packages/zope/browserpage/simpleviewclass.py", line 44, in __call__
  return self.index(*args, **kw)
File "/usr/lib/python2.6/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.6/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.6/dist-packages/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
Template "/usr/lib/python2.6/dist-packages/schooltool/timetable/browser/templates/timetableschema.pt"
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 888, in do_useMacro
  self.interpret(macro)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 954, in do_defineSlot
  self.interpret(block)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  r...

Read more...

Revision history for this message
Bill (billclark) wrote :

Looks like this could be end-user head-space. :-) Think you're right about the timetable being set up incorrectly.

The schedule is a 10-day rotation between 2 weeks. The names of the days are a-j. When the timetable schema is set up for attendance periods, the last 3 days show with no check boxes. Thus keyerror u'h'-- h is the name of the 3rd to last day in the rotation.

The system is apparently not accepting the last 3 days as valid, guess a rotation is limited to 7 days. If so, how does one get 2 separate week timetables to set up automatically?

Revision history for this message
Bill (billclark) wrote :

Got it! When setting up the timetable, I originally selected times by 'days of the week' when it should have been by 'days of the rotation'. That is why it was limited to 7 days. After setting it up by 'days of the rotation' the schedule sets up correctly!

If that is the case, maybe it would be helpful if the ui automatically selects the correct setting? Don't know, maybe some people need to set up by days of the week with an irregular rotation number.

Anyway, thank you for helping talk me through this, Justas! Sorry for the stupid on my end.

Bill

Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Yes, some people want days of the week with a different rotation. Here in Providence, for example.

Changed in schooltool:
status: New → Fix Committed
Changed in schooltool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.