[New-bugs-announce] [issue18817] Got resource warning when running Lib/aifc.py

Vajrasky Kok report at bugs.python.org
Fri Aug 23 07:13:15 CEST 2013

New submission from Vajrasky Kok:

The python is compiled with debug option.

<omitted>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.

components: Library (Lib)
files: fix_resource_warning_aifc.patch
keywords: patch
messages: 195943
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Got resource warning when running Lib/aifc.py
type: resource usage
versions: Python 3.4
Added file: http://bugs.python.org/file31430/fix_resource_warning_aifc.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list