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 <rep...@bugs.python.org>
<http://bugs.python.org/issue21802>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to