On Sep 12, 2010, at 8:57 AM, weheh wrote:
> 
> I'm flattening some text, assuming it's html, and get this error
> message when the text input is less than 4 characters:
> 
> input='abc'
> stream=cStringIO.StringIO(TAG(input).flatten())

What are you expecting this to generate? At first glance, it seems like an 
abuse of TAG().


> 
> 
>  File "C:/web2py/applications/myapp/controllers/myfunc.py", line 311,
> in process_text_in
>    stream=cStringIO.StringIO(TAG(input).flatten())
>  File "C:\web2py\gluon\html.py", line 821, in __call__
>    return web2pyHTMLParser(decoder.decoder(html)).tree
>  File "C:\web2py\gluon\decoder.py", line 72, in decoder
>    encoding = autoDetectXMLEncoding(buffer)
>  File "C:\web2py\gluon\decoder.py", line 38, in autoDetectXMLEncoding
>    bytes = (byte1, byte2, byte3, byte4) = tuple(map(ord,
> buffer[0:4]))
> ValueError: need more than 3 values to unpack
> 
> 4 or more characters works OK.


Reply via email to