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:
Lars Gustäbel 2007-02-13 16:09:24 +00:00
parent b1cc1d407b
commit 5b1a785702
3 changed files with 22 additions and 8 deletions

View file

@ -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)