Why do you need to turn this into a StringIO? Why can't you just pass `r` directly to this and then create a GzipFile from it?