Commit 160e2180 authored by Chris Withers's avatar Chris Withers

Bug #16441: avoid excessive memory usage working with large gzip files

parent 72bfbc5a
......@@ -421,7 +421,7 @@ class GzipFile(io.BufferedIOBase):
if offset < self.offset:
raise IOError('Negative seek in write mode')
count = offset - self.offset
for i in range(count // 1024):
for i in xrange(count // 1024):
self.write(1024 * '\0')
self.write((count % 1024) * '\0')
elif self.mode == READ:
......@@ -429,7 +429,7 @@ class GzipFile(io.BufferedIOBase):
# for negative seek, rewind and do positive seek
self.rewind()
count = offset - self.offset
for i in range(count // 1024):
for i in xrange(count // 1024):
self.read(1024)
self.read(count % 1024)
......
......@@ -464,6 +464,9 @@ Library
- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils
on Windows.
- Issue #16441: Avoid excessive memory usage working with large gzip
files using the gzip module.
Extension Modules
-----------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment