Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
Partially fixes #1110242.
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 5f638c4..48bd522 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -331,7 +331,10 @@
             return
         self.close()
 
-    def flush(self):
+    def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH):
+        if self.mode == WRITE:
+           # Ensure the compressor's buffer is flushed
+           self.fileobj.write(self.compress.flush(zlib_mode))
         self.fileobj.flush()
 
     def fileno(self):