> I did encounter same problem recently. I have inspected how it works, and > eventually understand why it goes wrong. It's not a bug of webob, it's a > bug > of uWSGI. I did write a simple wsgi app to reproduce the issue, > > def application(environ, start_response): > input = environ['wsgi.input'] > while True: > line = input.readline() > if not line: > break > print repr(line) > > run it with uwsgi and submit a multipart/form-data from. Following lines > are > the output > > '-----------------------------256672629917035\r' > 'Content-Disposition: form-data; name="title"\r\n' > '\r\n' > > As you can see, the '\n' of first line is not there in the result of the > first line, that's why webob thinks there are no more data to read. I have > read source code of uwsgi_Input_getline in plugins/python/wsgi_handlers.c, > but still, I can't tell why the tail '\n' of first line disappears. > However, > obviously, it's a bug of uWSGI. > > To workaround this bug, you can access request.body before accessing the > form fields, it forces webob to copy the whole body, and then the params, > str_POST can be read correctly.. > > Hope this would be helpful. > Victor Lin. > >
I have tried reproducing this behaviour, but whenever file i try to upload the lines are right. On which uWSGI version are you trying ? -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
