I am short of ideas. You tell us that the variable output is a list but len(output) calls the __len__ method in the cgi.py module.
Can anybody reproduce this behavior? Massimo On Apr 27, 8:09 pm, 王怀玉 <why00...@163.com> wrote: > the output: > CHECK: <type 'list'> ['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 > Transitional > //EN" "http://www.w3.org/TR/xhtml1/DTD/xh... > > I try the bug in some platforms. python version is 2.5.4, web2py 1.77.3 > > winxp, bug appears sometimes > > win7, bug appears everytime > > centos5.3, bug appears sometimes > > 在2010-04-28 03:55:11,mdipierro <mdipie...@cs.depaul.edu> 写道: >To help us > debug this.. > >before line 1162 in gluon/rocket.py > > if > hasattr(output, '__len__'): > sections = len(output) > >please > add > > if hasattr(output, '__len__'): > print > 'CHECK:',type(output), repr(output)[:100]+'...' > sections = > len(output) > >and try to reproduce the problem. What is the output? > > >On > Apr 25, 10:53 pm, hywang <why00...@163.com> wrote: >> I run web2py from > source on centos 5.3. >> When upload a file, an error occurs. >> > -----db.py----------- >> db.define_table('easy_test', >> Field('picture', > 'upload') >> ) >> >> ---------controller file--------------- >> def hello(): > >> form = SQLFORM(db.easy_test) >> if form.accepts(request.vars, > session): >> request.flash = 'ok' >> return dict(form=form) >> >> > when submit the form, it returns 'server error' >> consel error msg : >> > ERROR:Rocket.Errors.Thread-3:Traceback (most recent call last): >> File > "E:\web2py\gluon\rocket.py", line 747, in run >> self.run_app(conn) >> > File "E:\web2py\gluon\rocket.py", line 1162, in run_app >> sections = > len(output) >> File "C:\Python25\lib\cgi.py", line 633, in __len__ >> > return len(self.keys()) >> File "C:\Python25\lib\cgi.py", line 609, in keys > >> raise TypeError, "not indexable" >> TypeError: not indexable >> >> -- > >> Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en