Hi,
I was trying to parse the contents of a single gzipped file, but kept getting an empty file.
@auth.allows_jwt()
@request.restful()
def log():
def POST(*args,**vars):
with gzip.GzipFile(fileobj=request.vars.file.file, mode='rb') as f:
test = f.readlines()
print test
return dict()
return dict(POST=POST)
So i decided to print the contents of the file beforehand to make sure it wasn't empty.
print request.vars.file
with gzip.GzipFile(fileobj=request.vars.file.file, mode='rb') as f:
test = f.readlines()
print test
To my surprise it started outputting the the contents of the zipped file.
If I comment out the print statement it stops working... Any ideas what is causing this behaviour?
Cheers,
James