mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a DeprecationWarning.
This commit is contained in:
parent
b1cc1d407b
commit
5b1a785702
3 changed files with 22 additions and 8 deletions
|
@ -153,6 +153,13 @@ class TestGzip(unittest.TestCase):
|
|||
self.assertEqual(f.myfileobj.mode, 'rb')
|
||||
f.close()
|
||||
|
||||
def test_1647484(self):
|
||||
for mode in ('wb', 'rb'):
|
||||
f = gzip.GzipFile(self.filename, mode)
|
||||
self.assert_(hasattr(f, "name"))
|
||||
self.assertEqual(f.name, self.filename)
|
||||
f.close()
|
||||
|
||||
def test_main(verbose=None):
|
||||
test_support.run_unittest(TestGzip)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue