Mod_python error: "PythonHandler emain"

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/site-packages/mod_python/apache.py", line 398, in HandlerDispatch
    result = obj(req)

  File "/usr/home/night/public_html.memory/w/emain.py", line 60, in handler
    getact=ecore.show(req,form)

  File "/usr/home/night/public_html.memory/w/eutils.py", line 17, in __init__
    self.start()

  File "/usr/home/night/public_html.memory/w/ecore.py", line 32, in start
    self.process()

  File "/usr/home/night/public_html.memory/w/ecore.py", line 146, in process
    htdata['LevelList']=self.getmfght()

  File "/usr/home/night/public_html.memory/w/ecore.py", line 171, in getmfght
    maxlen=max(map(lambda a:len(a[0]),sqlout))

  File "/usr/home/night/public_html.memory/w/ecore.py", line 171, in <lambda>
    maxlen=max(map(lambda a:len(a[0]),sqlout))

TypeError: object of type 'long' has no len()