2009/8/18 gert <[email protected]>: >> > import os,sys >> >> > def application(environ, response): >> > print('STDERR %s' % __file__, file=sys.stderr) >> > #query=environ.get['QUERY_STRING'] >> > query=os.path.join(os.path.dirname(__file__),'teeeeeeeeeemp') >> > print('test',file=environ['wsgi.errors']) >> > range=environ.get('HTTP_RANGE','bytes=0-').replace >> > ('bytes=','').split(',') >> > offset=[] >> > for r in range: offset.append(r.split('-')) >> > with open(query,'wb') as f >> > f.seek(offset[0][0]) >> > while True: >> > chunk=environ['wsgi.input'].read(8192).decode('latin1') >> > if not chunk: break >> > f.write(chunk) >> > l=os.fstat(f.fileno()).st_size >> > response('200 OK', [('Content-Type', 'text/plain'), ('Content- >> > Length', str(len(l)))]) >> > return [l] >> > #500 Internal Server Error >> >> Do you get a 500 error without the print statements? > > yes
So, there isn't a problem with logging then. :-) >> > Ps did you read the other post about chunk transfer or was the >> > question not clear like this one ? >> >> I didn't see any question in the chunked transfer post. I thought you >> were just making some statement about it working. >> > > Nope there where problems > curl: (56) Received problem 2 in the chunky parser I'll have a look when I get a chance then. If the original message didn't provide the exact details of how to run curl for the test, then supply it. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
