I have a function controllers/default.py test_stream.

def test_stream():
    '''Test the stream output
    '''
    import cStringIO
    stringio = cStringIO.StringIO()
    stringio.write('This is the first line.\n')
    stringio.write('This is the second line.')

    stringio.seek(0)
    return response.stream(stringio, attachment=True, request=request,
                           filename='test_%s.txt' % 'stream')

                           
When I call it over URL http://localhost:8000/myapp/default/test_stream all 
is ok.

But when I call it over menu with 

... ('Teststream', False, URL('genre', 'test_stream')) ...



I get the following error at the console:

ERROR:Rocket.Errors.Thread-4:Unhandled Error when serving connection:
Traceback (most recent call last):

  File "/home/robert/Projekte/web2py/gluon/rocket.py", line 1337, in run
    self.run_app(conn)

  File "/home/robert/Projekte/web2py/gluon/rocket.py", line 1855, in run_app
    self.conn.sendall(b('0\r\n\r\n'))

  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)

error: [Errno 32] Datenübergabe unterbrochen (broken pipe)

Any idea?

-- 
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/groups/opt_out.

Reply via email to