--> -->

TypeError

object of type 'generator' has no len()

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /home/user/workspace/1.8-storage-cdenter/MoinMoin/request/__init__.py in run (self=<MoinMoin.request.request_standalone.Request object at 0xcc4b10>)

    1. 1302 self.page.send_page()
    2. 1303 else:
    3. 1304 handler(self.page.page_name, self)
    4. 1305
    5. 1306 # every action that didn't use to raise MoinMoinFinish must call this now:
    • handler = <function do_show at 0xe645f0>
    • self = <MoinMoin.request.request_standalone.Request object at 0xcc4b10>
    • self.page = <MoinMoin.Page.Page object at 0xe66290>
    • self.page.page_name = u'SystemInfo'
  2. /home/user/workspace/1.8-storage-cdenter/MoinMoin/action/__init__.py in do_show (pagename=u'SystemInfo', request=<MoinMoin.request.request_standalone.Request object at 0xcc4b10>, content_only=0, count_hit=1, cacheable=1, print_mode=0)

    1. 284 count_hit=count_hit,
    2. 285 print_mode=print_mode,
    3. 286 content_only=content_only,
    4. 287 )
    5. 288
    • content_only = 0
  3. /home/user/workspace/1.8-storage-cdenter/MoinMoin/Page.py in send_page (self=<MoinMoin.Page.Page object at 0xe80550>, **keywords={'content_only': 0, 'count_hit': 1, 'print_mode': 0})

    1. 986 format_args=pi['formatargs'],
    2. 987 do_cache=do_cache,
    3. 988 start_line=pi['lines'])
    4. 989
    5. 990 # check for pending footnotes
    • start_line undefined
    • pi = {'format': 'wiki', 'formatargs': '', 'language': 'en', 'lines': 10}
  4. /home/user/workspace/1.8-storage-cdenter/MoinMoin/Page.py in send_page_content (self=<MoinMoin.Page.Page object at 0xe80550>, request=<MoinMoin.request.request_standalone.Request object at 0xcc4b10>, body=u'<<SystemInfo>>\n', format='wiki', format_args='', do_cache=1, **kw={'start_line': 10})

    1. 1069
    2. 1070 if not (do_cache and self.canUseCache(Parser)):
    3. 1071 self.format(parser)
    4. 1072 else:
    5. 1073 try:
    • self = <MoinMoin.Page.Page object at 0xe80550>
    • self.format = <bound method Page.format of <MoinMoin.Page.Page object at 0xe80550>>
    • parser = <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>
  5. /home/user/workspace/1.8-storage-cdenter/MoinMoin/Page.py in format (self=<MoinMoin.Page.Page object at 0xe80550>, parser=<MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>)

    1. 1090 def format(self, parser):
    2. 1091 """ Format and write page content without caching """
    3. 1092 parser.format(self.formatter)
    4. 1093
    5. 1094 def execute(self, request, parser, code):
    • parser = <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>
    • parser.format = <bound method Parser.format of <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>>
    • self = <MoinMoin.Page.Page object at 0xe80550>
    • self.formatter = <MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>
  6. /home/user/workspace/1.8-storage-cdenter/MoinMoin/parser/text_moin_wiki.py in format (self=<MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>, formatter=<MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>, inhibit_p=False)

    1. 1541
    2. 1542 # Scan line, format and write
    3. 1543 formatted_line = self.scan(line, inhibit_p=inhibit_p)
    4. 1544 self.request.write(formatted_line)
    5. 1545
    • formatted_line undefined
    • self = <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>
    • self.scan = <bound method Parser.scan of <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>>
    • line = u'<<SystemInfo>> '
    • inhibit_p = False
  7. /home/user/workspace/1.8-storage-cdenter/MoinMoin/parser/text_moin_wiki.py in scan (self=<MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>, line=u'<<SystemInfo>> ', inhibit_p=False)

    1. 1357 self.in_table or self.in_list):
    2. 1358 result.append(self.formatter.paragraph(1, css_class="line867"))
    3. 1359 result.append(self.replace(match, inhibit_p))
    4. 1360 end = match.end()
    5. 1361 lastpos = end
    • result = ['<p class="line867">']
    • result.append = <built-in method append of list object at 0x100f3b0>
    • self = <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>
    • self.replace = <bound method Parser.replace of <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>>
    • match = <_sre.SRE_Match object at 0xf04fc0>
    • inhibit_p = False
  8. /home/user/workspace/1.8-storage-cdenter/MoinMoin/parser/text_moin_wiki.py in replace (self=<MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>, match=<_sre.SRE_Match object at 0xf04fc0>, inhibit_p=False)

    1. 1399 # Get replace method and replace hit
    2. 1400 replace_func = getattr(self, '_%s_repl' % type)
    3. 1401 result.append(replace_func(hit, match.groupdict()))
    4. 1402 return ''.join(result)
    5. 1403 else:
    • result = []
    • result.append = <built-in method append of list object at 0xde35f0>
    • replace_func = <bound method Parser._macro_repl of <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>>
    • hit = u'SystemInfo'
    • match = <_sre.SRE_Match object at 0xf04fc0>
    • match.groupdict = <built-in method groupdict of _sre.SRE_Match object at 0xf04fc0>
  9. /home/user/workspace/1.8-storage-cdenter/MoinMoin/parser/text_moin_wiki.py in _macro_repl (self=<MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>, word=u'SystemInfo', groups={u'big': None, u'big_off': None, u'big_on': None, u'comment': None, u'dl': None, u'email': None, u'emph': None, u'emph_ib_or_bi': None, u'emph_ibb': None, u'emph_ibi': None, ...})

    1. 1324 if self.macro is None:
    2. 1325 self.macro = macro.Macro(self)
    3. 1326 return self.formatter.macro(self.macro, macro_name, macro_args, markup=groups.get('macro'))
    4. 1327 _macro_name_repl = _macro_repl
    5. 1328 _macro_args_repl = _macro_repl
    • self = <MoinMoin.parser.text_moin_wiki.Parser instance at 0xe6db48>
    • self.formatter = <MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>
    • self.formatter.macro = <bound method Formatter.macro of <MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>>
    • self.macro = <MoinMoin.macro.Macro instance at 0xec2c20>
    • macro_name = u'SystemInfo'
    • macro_args = None
    • markup undefined
    • groups = {u'big': None, u'big_off': None, u'big_on': None, u'comment': None, u'dl': None, u'email': None, u'emph': None, u'emph_ib_or_bi': None, u'emph_ibb': None, u'emph_ibi': None, ...}
    • groups.get = <built-in method get of dict object at 0x104da50>
  10. /home/user/workspace/1.8-storage-cdenter/MoinMoin/formatter/__init__.py in macro (self=<MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>, macro_obj=<MoinMoin.macro.Macro instance at 0xec2c20>, name=u'SystemInfo', args=None, markup=u'<<SystemInfo>>')

    1. 312 # call the macro
    2. 313 try:
    3. 314 return macro_obj.execute(name, args)
    4. 315 except ImportError, err:
    5. 316 errmsg = unicode(err)
    • macro_obj = <MoinMoin.macro.Macro instance at 0xec2c20>
    • macro_obj.execute = <bound method Macro.execute of <MoinMoin.macro.Macro instance at 0xec2c20>>
    • name = u'SystemInfo'
    • args = None
  11. /home/user/workspace/1.8-storage-cdenter/MoinMoin/macro/__init__.py in execute (self=<MoinMoin.macro.Macro instance at 0xec2c20>, macro_name=u'SystemInfo', args=None)

    1. 126 else:
    2. 127 raise ImportError("Cannot load macro %s" % macro_name)
    3. 128 return execute(self, args)
    4. 129
    5. 130 def _m_lang(self, text):
    • execute = <function <lambda> at 0xa3a230>
    • self = <MoinMoin.macro.Macro instance at 0xec2c20>
    • args = None
  12. /home/user/workspace/1.8-storage-cdenter/MoinMoin/macro/__init__.py in (_self=<MoinMoin.macro.Macro instance at 0xec2c20>, _args=None)

    1. 113 call = wikiutil.importPlugin(self.cfg, 'macro', macro_name,
    2. 114 function='macro_%s' % macro_name)
    3. 115 execute = lambda _self, _args: _self._wrap(call, _args, [self])
    4. 116 except wikiutil.PluginAttributeError:
    5. 117 # fall back to old execute() method, no longer recommended
    • execute undefined
    • _self = <MoinMoin.macro.Macro instance at 0xec2c20>
    • _args = None
    • _self._wrap = <bound method Macro._wrap of <MoinMoin.macro.Macro instance at 0xec2c20>>
    • call = <function macro_SystemInfo at 0xa3ab90>
    • self = <MoinMoin.macro.Macro instance at 0xec2c20>
  13. /home/user/workspace/1.8-storage-cdenter/MoinMoin/macro/__init__.py in _wrap (self=<MoinMoin.macro.Macro instance at 0xec2c20>, function=<function macro_SystemInfo at 0xa3ab90>, args=None, fixed=[<MoinMoin.macro.Macro instance at 0xec2c20>])

    1. 95 try:
    2. 96 return wikiutil.invoke_extension_function(self.request, function,
    3. 97 args, fixed)
    4. 98 except ValueError, e:
    5. 99 return self.format_error(e)
    • args = None
    • fixed = [<MoinMoin.macro.Macro instance at 0xec2c20>]
  14. /home/user/workspace/1.8-storage-cdenter/MoinMoin/wikiutil.py in invoke_extension_function (request=<MoinMoin.request.request_standalone.Request object at 0xcc4b10>, function=<function macro_SystemInfo at 0xa3ab90>, args=None, fixed_args=[<MoinMoin.macro.Macro instance at 0xec2c20>])

    1. 2033 kwargs_to_pass.keys()[0]))
    2. 2034
    3. 2035 return function(*fixed_args, **kwargs)
    4. 2036
    5. 2037
    • function = <function macro_SystemInfo at 0xa3ab90>
    • fixed_args = [<MoinMoin.macro.Macro instance at 0xec2c20>]
    • kwargs = {}
  15. /home/user/workspace/1.8-storage-cdenter/MoinMoin/macro/SystemInfo.py in macro_SystemInfo (macro=<MoinMoin.macro.Macro instance at 0xec2c20>)

    1. 171 def macro_SystemInfo(macro):
    2. 172 if macro.request.isSpiderAgent: # reduce bot cpu usage
    3. 173 return ''
    4. 174 return SystemInfo(macro).render()
    5. 175
    • global SystemInfo = <class MoinMoin.macro.SystemInfo.SystemInfo at 0xa3b230>
    • macro = <MoinMoin.macro.Macro instance at 0xec2c20>
    • ).render undefined
  16. /home/user/workspace/1.8-storage-cdenter/MoinMoin/macro/SystemInfo.py in render (self=<MoinMoin.macro.SystemInfo.SystemInfo instance at 0xec2fc8>)

    1. 51 def render(self):
    2. 52 _ = self.request.getText
    3. 53 return self.formatter.rawHTML(self.getInfo())
    4. 54
    5. 55 def getInfo(self):
    • self = <MoinMoin.macro.SystemInfo.SystemInfo instance at 0xec2fc8>
    • self.formatter = <MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>
    • self.formatter.rawHTML = <bound method Formatter.rawHTML of <MoinMoin.formatter.text_html.Formatter instance at 0xe6db90>>
    • self.getInfo = <bound method SystemInfo.getInfo of <MoinMoin.macro.SystemInfo.SystemInfo instance at 0xec2fc8>>
  17. /home/user/workspace/1.8-storage-cdenter/MoinMoin/macro/SystemInfo.py in getInfo (self=<MoinMoin.macro.SystemInfo.SystemInfo instance at 0xec2fc8>)

    1. 94 totalsize += Page(request, page).size()
    2. 95
    3. 96 row(_('Number of pages'), str(len(pagelist)-len(systemPages)))
    4. 97 row(_('Number of system pages'), str(len(systemPages)))
    5. 98
    • row = <function <lambda> at 0xa3e398>
    • _ = <function <lambda> at 0xd477d0>
    • builtin str = <type 'str'>
    • builtin len = <built-in function len>
    • pagelist = <generator object at 0xeebf38>
    • systemPages = [u'Pr\xe9sentationTemplate', u'HilfeTemplate', u'HomepageReadPageTemplate', u'ProjectGroupsTemplate', u'ProjectTemplate', u'AideTemplate', u'HomepageGroupsTemplate', u'HomepageReadWritePageTemplate', u'HomepageTemplate', u'HulpTemplate', u'PagePersonnelleTemplate', u"SupportPapierD'UnePr\xe9sentationTemplate", u'SyncJobTemplate', u'TransparentTemplate', u'Cat\xe9gorieTemplate', u'HelpTemplate', u'HomepagePrivatePageTemplate', u'SlideShowTemplate', u'SlideTemplate', u'ThuisbladTemplate', ...]

TypeError

object of type 'generator' has no len()

  • args = ("object of type 'generator' has no len()",)
  • message = "object of type 'generator' has no len()"

System Details

  • Date: Sun, 17 Aug 2008 21:52:52 +0000
  • Platform: Linux linux 2.6.24-19-generic #1 SMP Fri Jul 11 21:01:46 UTC 2008 x86_64
  • Python: Python 2.5.2 (/usr/bin/python)
  • MoinMoin: Release 1.8.0 (alpha)