diff --git a/Lib/io.py b/Lib/io.py index 7f938987b71..320a4b9b5f2 100644 --- a/Lib/io.py +++ b/Lib/io.py @@ -1167,7 +1167,7 @@ class BufferedRWPair(BufferedIOBase): @property def closed(self): - return self.writer.closed() + return self.writer.closed class BufferedRandom(BufferedWriter, BufferedReader): diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 8a7da60947b..967018ea453 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -554,8 +554,9 @@ class BufferedRWPairTest(unittest.TestCase): r = MockRawIO(()) w = MockRawIO() pair = io.BufferedRWPair(r, w) + self.assertFalse(pair.closed) - # XXX need implementation + # XXX More Tests class BufferedRandomTest(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS index 775392437c0..026e4781d70 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -86,6 +86,8 @@ Core and Builtins Library ------- +- Issue #4736: io.BufferedRWPair's closed property now functions properly. + - Issue #3954: Fix a potential SystemError in _hotshot.logreader error handling.