[Moin-user] ZeroDivisionError

Michael P. Soulier michael_soulier at mitel.com
Thu Oct 7 12:21:42 EDT 2004

Someone just changed a page in my wiki, and now a diff of that page
throws this exception. 

 /usr/local/lib/python2.2/site-packages/MoinMoin/request.py in run(self=<MoinMoin.request.RequestCGI instance>)
  454             else:
  455                 try:
  456                     cgitb.Hook(file=self).handle(saved_exc)
  457                     # was: cgitb.handler()
  458                 except:
cgitb = <module 'MoinMoin.support.cgitb' from '/usr/loca...hon2.2/site-packages/MoinMoin/support/cgitb.pyc'>, cgitb.Hook = <class MoinMoin.support.cgitb.Hook>, file undefined, self = <MoinMoin.request.RequestCGI instance>, ).handle undefined, saved_exc = (<class exceptions.ZeroDivisionError>, <exceptions.ZeroDivisionError instance>, <traceback object>)

 /usr/local/lib/python2.2/site-packages/MoinMoin/wikiaction.py in do_diff(pagename='OpenLetterOnPython', request=<MoinMoin.request.RequestCGI instance>)
  294     if request.user.show_fancy_diff:
  295         from MoinMoin.util.diff import diff
  296         request.write(diff(request, oldpage.get_raw_body(), newpage.get_raw_body()))
  297         newpage.send_page(request, count_hit=0, content_only=1, content_id="content-under-diff")
  298     else:
request = <MoinMoin.request.RequestCGI instance>, request.write = <bound method RequestCGI.write of <MoinMoin.request.RequestCGI instance>>, diff = <function diff>, oldpage = <MoinMoin.Page.Page instance>, oldpage.get_raw_body = <bound method Page.get_raw_body of <MoinMoin.Page.Page instance>>, newpage = <MoinMoin.Page.Page instance>, newpage.get_raw_body = <bound method Page.get_raw_body of <MoinMoin.Page.Page instance>>

 /usr/local/lib/python2.2/site-packages/MoinMoin/util/diff.py in diff(request=<MoinMoin.request.RequestCGI instance>, old="= An Open Letter on Python =\n\n== What Is This? =...s/cat_python.html#003382 Toward Python's future]\n", new="= An Open Letter on Python =\n\n== What Is This? =...s/cat_python.html#003382 Toward Python's future]\n")
   94         charmatch = charobj.get_matching_blocks()
   96         if charobj.ratio() < 0.5:
   97             # Insufficient similarity.
   98             if leftpane:
charobj = <difflib.SequenceMatcher instance>, charobj.ratio = <bound method SequenceMatcher.ratio of <difflib.SequenceMatcher instance>>

 //usr/lib/python2.2/difflib.py in ratio(self=<difflib.SequenceMatcher instance>)
  526         matches = reduce(lambda sum, triple: sum + triple[-1],
  527                          self.get_matching_blocks(), 0)
  528         return 2.0 * matches / (len(self.a) + len(self.b))
  530     def quick_ratio(self):
matches = 0, len undefined, self = <difflib.SequenceMatcher instance>, self.a = '', self.b = ''

ZeroDivisionError: float division
      __doc__ = 'Second argument to a division or modulo operation was zero.'
      __getitem__ = <bound method ZeroDivisionError.__getitem__ of <exceptions.ZeroDivisionError instance>>
      __init__ = <bound method ZeroDivisionError.__init__ of <exceptions.ZeroDivisionError instance>>
      __module__ = 'exceptions'
      __str__ = <bound method ZeroDivisionError.__str__ of <exceptions.ZeroDivisionError instance>>
      args = ('float division',)


Michael P. Soulier <michael_soulier at mitel.com>, 613-592-2122 x2522
6000/6010/60* Development, Mitel Networks Corporation
"...the word HACK is used as a verb to indicate a massive amount of nerd-like
effort." -Harley Hahn, A Student's Guide to Unix

More information about the Moin-user mailing list