stream.seek(0)
mpu.upload_part_from_file(stream, partCount[0])
stream.seek(0)
stream.truncate()
with file(fileName) as inputFile:
    while True:
        chunk = inputFile.read(8192)
if not chunk:
    compressor.close()
uploadPart()
mpu.complete_upload()
break
compressor.write(chunk)
if stream.tell() > 10 << 20:
    uploadPart()
Как сжать gzip при загрузке в s3 с помощью boto