Code in view does not follow Python indentation rules. : opens a block. 
pass closes a block. So this:

with open(filename, mode="r") as fp:
    for line in fp:
        print line

should be

with open(filename, mode="r") as fp:
    for line in fp:
        print line
    pass
pass

Clearly there is a bug in the parser since you should not get that error. 
You should get a error that says block not closed.

On Thursday, 3 April 2014 12:45:14 UTC-5, Ramesh Aj wrote:
>
> The Following code is giving "gluon.rocket.SocketTimeout'>(Socket timed 
> out before request" error
>
> {{extend 'layout.html'}}
> {{import xml.etree.ElementTree as ET}}
> <h1>
>     This is a Stations detail page
> </h1>
> {{
> filename = xmlfile
> with open(filename, mode="r") as fp:
>     for line in fp:
>         print line
> fp.close()
> =BEAUTIFY(response._vars)
> }}
>
> Can somebody suggest what could be issue?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to