mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #20875: Prevent possible gzip "'read' is not defined" NameError.
Patch by Claudiu Popa.
This commit is contained in:
parent
5e572fd490
commit
6120739f0c
3 changed files with 11 additions and 1 deletions
|
@ -396,6 +396,13 @@ class TestGzip(BaseTest):
|
|||
with gzip.GzipFile(fileobj=io.BytesIO(gzdata)) as f:
|
||||
self.assertEqual(f.read(), b'Test')
|
||||
|
||||
def test_prepend_error(self):
|
||||
# See issue #20875
|
||||
with gzip.open(self.filename, "wb") as f:
|
||||
f.write(data1)
|
||||
with gzip.open(self.filename, "rb") as f:
|
||||
f.fileobj.prepend()
|
||||
|
||||
class TestOpen(BaseTest):
|
||||
def test_binary_modes(self):
|
||||
uncompressed = data1 * 50
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue