[issue21802] Reader of BufferedRWPair is not closed if writer's close() fails

Serhiy Storchaka report at bugs.python.org
Wed Jun 18 19:52:22 CEST 2014


New submission from Serhiy Storchaka:

Current implementation of BufferedRWPair.close() is:

    def close(self):
        self.writer.close()
        self.reader.close()

When self.writer.close() raises an exception, self.reader left non-closed. This can cause file description leak unless GC sweep it.

Proposed patch fixes this issue. With applied patch for issue21715 it would be a little simpler.

----------
components: IO
files: bufferedrwpair_close.patch
keywords: patch
messages: 220945
nosy: benjamin.peterson, pitrou, serhiy.storchaka, stutzbach
priority: normal
severity: normal
stage: patch review
status: open
title: Reader of BufferedRWPair is not closed if writer's close() fails
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35684/bufferedrwpair_close.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21802>
_______________________________________


More information about the Python-bugs-list mailing list