classification
Title: FD leaks in aifc module
Type: resource usage Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: ezio.melotti, georg.brandl, jcea, python-dev, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2012-11-16 12:49 by serhiy.storchaka, last changed 2013-01-27 02:05 by jcea. This issue is now closed.

Files
File name Uploaded Description Edit
aifc_close.patch serhiy.storchaka, 2012-11-16 13:35 Patch for 3.x review
aifc_close-2.7.patch serhiy.storchaka, 2012-11-16 13:35 Patch for 2.7 review
Messages (8)
msg175683 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-11-16 12:49
Aifc_write.close() can raise exception and left the internal file object not closed.  The patch closes the file object even in case of error and reset _file to None even in case of the file object close() raises an exception, so that Aifc_write.close() can be called repeatedly.
msg175685 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-11-16 12:59
Adding "with" support to Aifc_write looks like a new feature, but Aifc_write doesn't seem to be part of the public API.  Does this change (indirectly) add "with" support to any part of the public API?
msg175686 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-11-16 13:35
Sorry, I miss that test_close() already exists. Merged.
msg175688 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-11-16 13:43
> Adding "with" support to Aifc_write looks like a new feature, but Aifc_write doesn't seem to be part of the public API.  Does this change (indirectly) add "with" support to any part of the public API?

Don't pay attention, it was a wrong patch.  For "with" support see issue16486.
msg178325 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-27 20:44
If no one objects I will commit this next year.
msg178366 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-12-28 07:20
Looks good to me, except:
the patch contains unrelated whitespace changes.  Please don't commit them along the fix.  If you think they are really necessary, they should go in a separate commit.
msg178388 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-28 16:29
Of course. Thanks for point. It's my editor made wrong whitespace changes after block indent/unindent. "hg diff" shows this changes and I shouldn't miss this. I will review every patch before commit one more time.
msg178533 - (view) Author: Roundup Robot (python-dev) Date: 2012-12-29 20:46
New changeset cf8d692cc847 by Serhiy Storchaka in branch '2.7':
Issue #16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
http://hg.python.org/cpython/rev/cf8d692cc847

New changeset e3c4e9f4ea0f by Serhiy Storchaka in branch '3.2':
Issue #16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
http://hg.python.org/cpython/rev/e3c4e9f4ea0f

New changeset 9a571c4a16d1 by Serhiy Storchaka in branch '3.3':
Issue #16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
http://hg.python.org/cpython/rev/9a571c4a16d1

New changeset 79a8f6e1dfb0 by Serhiy Storchaka in branch 'default':
Issue #16485: Fix file descriptor not being closed if file header patching fails on closing of aifc file.
http://hg.python.org/cpython/rev/79a8f6e1dfb0
History
Date User Action Args
2013-01-27 02:05:17jceasetnosy: + jcea
2012-12-29 21:00:53serhiy.storchakasetresolution: works for me -> fixed
2012-12-29 20:57:42serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: works for me
versions: + Python 2.7
2012-12-29 20:46:32python-devsetnosy: + python-dev
messages: + msg178533
2012-12-28 16:29:14serhiy.storchakasetmessages: + msg178388
2012-12-28 07:20:56georg.brandlsetnosy: + georg.brandl
messages: + msg178366
2012-12-27 20:47:30serhiy.storchakasetassignee: serhiy.storchaka
2012-12-27 20:44:45serhiy.storchakasetmessages: + msg178325
2012-11-16 13:43:09serhiy.storchakasetmessages: + msg175688
2012-11-16 13:41:15serhiy.storchakalinkissue16486 dependencies
2012-11-16 13:35:16serhiy.storchakasetfiles: + aifc_close.patch, aifc_close-2.7.patch

messages: + msg175686
2012-11-16 13:32:54serhiy.storchakasetfiles: - aifc_close.patch
2012-11-16 13:32:50serhiy.storchakasetfiles: - aifc_close-2.7.patch
2012-11-16 12:59:31ezio.melottisetnosy: + ezio.melotti

messages: + msg175685
stage: patch review
2012-11-16 12:54:33serhiy.storchakasetfiles: + aifc_close-2.7.patch
2012-11-16 12:54:02serhiy.storchakasetfiles: + aifc_close.patch
nosy: + r.david.murray
2012-11-16 12:53:26serhiy.storchakasetfiles: - aifc_close.patch
2012-11-16 12:49:33serhiy.storchakacreate