Issue 18817: Got resource warning when running Lib/aifc.py (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/63017

classification

Title: Got resource warning when running Lib/aifc.py
Type: resource usage Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4, Python 2.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka, vajrasky
Priority: low Keywords: patch

Created on 2013-08-23 05:13 by vajrasky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_resource_warning_aifc.patch vajrasky,2013-08-23 05:13 review
Messages (3)
msg195943 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-08-23 05:13
The python is compiled with debug option. cpython$ ./python Lib/aifc.py Lib/test/sndhdrdata/sndhdr.aiff Reading Lib/test/sndhdrdata/sndhdr.aiff nchannels = 2 nframes = 5 sampwidth = 2 framerate = 44100 comptype = b'NONE' compname = b'not compressed' sys:1: ResourceWarning: unclosed file <_io.BufferedReader name='Lib/test/sndhdrdata/sndhdr.aiff'> Attached the patch to close the file automatically and print "Done." message not just with writing mode but for reading mode as well.
msg196150 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-08-25 16:18
New changeset e3eec06aa12e by Serhiy Storchaka in branch '2.7': Issue #18817: Fix a resource warning in Lib/aifc.py demo. http://hg.python.org/cpython/rev/e3eec06aa12e New changeset e0c33e0c0483 by Serhiy Storchaka in branch '3.3': Issue #18817: Fix a resource warning in Lib/aifc.py demo. http://hg.python.org/cpython/rev/e0c33e0c0483 New changeset 1da223c1b7ed by Serhiy Storchaka in branch 'default': Issue #18817: Fix a resource warning in Lib/aifc.py demo. Patch by http://hg.python.org/cpython/rev/1da223c1b7ed
msg196151 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-08-25 16:24
Thank you for your patch Vajrasky.
History
Date User Action Args
2022-04-11 14:57:49 admin set github: 63017
2013-08-25 16:24:53 serhiy.storchaka set status: open -> closedversions: + Python 2.7, Python 3.3messages: + resolution: fixedstage: patch review -> resolved
2013-08-25 16🔞25 python-dev set nosy: + python-devmessages: +
2013-08-23 19:14:28 serhiy.storchaka set stage: patch review
2013-08-23 19:14:04 serhiy.storchaka set priority: normal -> lowassignee: serhiy.storchaka
2013-08-23 08:20:58 pitrou set nosy: + serhiy.storchaka
2013-08-23 05:13:15 vajrasky create