commit | 37d3ff14871a25429fb93167aeace0589be45426 | [log] [tgz] |
---|---|---|
author | Nadeem Vawda <nadeem.vawda@gmail.com> | Sun Aug 05 02:19:09 2012 +0200 |
committer | Nadeem Vawda <nadeem.vawda@gmail.com> | Sun Aug 05 02:19:09 2012 +0200 |
tree | f0053233c44a4013f6f157e4c30984cc83089cbb | |
parent | 9c92a691e1f0f889fffd22a48d02ceaea38c05c6 [diff] [blame] |
#15546: Fix {GzipFile,LZMAFile}.read1()'s handling of pathological input data.
diff --git a/Lib/gzip.py b/Lib/gzip.py index 8b89426..5bcfe61 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py
@@ -385,7 +385,10 @@ return b'' try: - self._read() + # For certain input data, a single call to _read() may not return + # any data. In this case, retry until we get some data or reach EOF. + while self.extrasize <= 0: + self._read() except EOFError: pass if size < 0 or size > self.extrasize: