Juergen Brendel wrote: > Hello! > > First post in this group, so please forgive me if this is a known issue. > > I have written a small WSGI application, which receives an HTTP-POST > request and then basically does this: > > def app(environ, start_response): > input = environ['wsgi.input'] > for d in input: > print "Received some data: ", d > > .... > > if __name__ == '__main__': > from paste import httpserver > httpserver.serve(app, host='127.0.0.1', port='8081') > > > Iterating like this over the wsgi.input object works perfectly well > under Linux (Ubuntu 7.04), but not at all under Windows. Under Windows, > the for-loop terminates right away. I assume that the iterable doesn't > indicate that there is a next, and just signals the end of things. So, > under Windows then, I am forced to use read(N), which is really > something I would like to avoid. > > Any help is greatly appreciated. Thank you very much...
It's just a coincidence it works on Linux; iteration isn't part of the required API of wsgi.input. Also, you should be really careful not to read past the end (environ['CONTENT_LENGTH']), as on some servers that will block. -- Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org : Write code, do good : http://topp.openplans.org/careers _______________________________________________ Paste-users mailing list [email protected] http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users
