#10465: fix broken delegation in __getattr__ of _PaddedFile.
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index 7f2e798..8af6d2b 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -197,6 +197,12 @@
self.assertTrue(hasattr(f, "name"))
self.assertEqual(f.name, self.filename)
+ def test_paddedfile_getattr(self):
+ self.test_write()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ self.assertTrue(hasattr(f.fileobj, "name"))
+ self.assertEqual(f.fileobj.name, self.filename)
+
def test_mtime(self):
mtime = 123456789
with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite: