mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-28286: Deprecate opening GzipFile for writing implicitly. (GH-16417)
Always specify the mode argument for writing.
This commit is contained in:
parent
bd44a7ead9
commit
a0652328a2
5 changed files with 25 additions and 2 deletions
|
@ -469,7 +469,9 @@ class TestGzip(BaseTest):
|
|||
if "x" in mode:
|
||||
support.unlink(self.filename)
|
||||
with open(self.filename, mode) as f:
|
||||
with gzip.GzipFile(fileobj=f) as g:
|
||||
with self.assertWarns(FutureWarning):
|
||||
g = gzip.GzipFile(fileobj=f)
|
||||
with g:
|
||||
self.assertEqual(g.mode, gzip.WRITE)
|
||||
|
||||
def test_bytes_filename(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue