"f" should be "self"; reported by Neal Norwitz.
diff --git a/Lib/gzip.py b/Lib/gzip.py
index db1c8a6..7f56153 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -289,7 +289,7 @@
                 raise IOError('Negative seek in write mode')
             count = offset - self.offset
             for i in range(count/1024):
-                f.write(1024*'\0')
+                self.write(1024*'\0')
             self.write((count%1024)*'\0')
         elif self.mode == READ:
             if offset < self.offset: