Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
160e2180
Commit
160e2180
authored
Nov 09, 2012
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #16441: avoid excessive memory usage working with large gzip files
parent
72bfbc5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/gzip.py
Lib/gzip.py
+2
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/gzip.py
View file @
160e2180
...
...
@@ -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
x
range
(
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
x
range
(
count
//
1024
):
self
.
read
(
1024
)
self
.
read
(
count
%
1024
)
...
...
Misc/NEWS
View file @
160e2180
...
...
@@ -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
-----------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment