On Dec 29, 2010, at 12:37 PM, Arun K.Rajeevan wrote:
> great as far as 25 page pdf is in consideration. next time a simple text file
> is good enough.
> how the page get rendered? using generic.html or is it have a custom view
> file?
> And what's the controller returns?
>
> btw which version of web2py you are using?
>
> ---------------------------------------------------------------------------------------------------------------------------------------
> for others:
>
> there's these lines in trace back
>
> File "P:\Web2PY\web2py_src\web2py\gluon\html.py", line 118, in xmlescape
> data = data.encode('utf8', 'xmlcharrefreplace')
> TypeError: encode() takes at most 2 arguments (3 given)
>
> Detailed traceback description
> Exception: <type 'exceptions.TypeError'>(encode() takes at most 2
> arguments (3 given))
> Python 2.6.4: P:\Python26\python.exe
>
I looked at this briefly. It's a rather strange error message, given that in
fact only two arguments are given.
I ran a little test sequence to verify:
>>> data = u'abcd'
>>> data.encode('utf8', 'xmlcharrefreplace')
'abcd'
>>> data.encode('utf8', 'xmlcharrefreplace', 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: encode() takes at most 2 arguments (3 given)
>>> isinstance(data, unicode)
True