From: Serhiy Storchaka Date: Sun, 25 Aug 2013 16:16:01 +0000 (+0300) Subject: Issue #18817: Fix a resource warning in Lib/aifc.py demo. Patch by X-Git-Tag: v3.4.0a2~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58b3ebfab92d4241e65fbb0f34c84746fcbe347b;p=python Issue #18817: Fix a resource warning in Lib/aifc.py demo. Patch by Vajrasky Kok. --- 58b3ebfab92d4241e65fbb0f34c84746fcbe347b diff --cc Lib/aifc.py index c02c485bb0,3270047b11..b08775485c --- a/Lib/aifc.py +++ b/Lib/aifc.py @@@ -889,24 -872,28 +889,22 @@@ if __name__ == '__main__' if not sys.argv[1:]: sys.argv.append('/usr/demos/data/audio/bach.aiff') fn = sys.argv[1] -- f = open(fn, 'r') - print("Reading", fn) - print("nchannels =", f.getnchannels()) - print("nframes =", f.getnframes()) - print("sampwidth =", f.getsampwidth()) - print("framerate =", f.getframerate()) - print("comptype =", f.getcomptype()) - print("compname =", f.getcompname()) - if sys.argv[2:]: - gn = sys.argv[2] - print("Writing", gn) - g = open(gn, 'w') - g.setparams(f.getparams()) - while 1: - data = f.readframes(1024) - if not data: - break - g.writeframes(data) - g.close() - f.close() - print("Done.") - try: ++ with open(fn, 'r') as f: + print("Reading", fn) + print("nchannels =", f.getnchannels()) + print("nframes =", f.getnframes()) + print("sampwidth =", f.getsampwidth()) + print("framerate =", f.getframerate()) + print("comptype =", f.getcomptype()) + print("compname =", f.getcompname()) + if sys.argv[2:]: + gn = sys.argv[2] + print("Writing", gn) - g = open(gn, 'w') - try: ++ with open(gn, 'w') as g: + g.setparams(f.getparams()) + while 1: + data = f.readframes(1024) + if not data: + break + g.writeframes(data) - finally: - g.close() + print("Done.") - finally: - f.close() diff --cc Misc/NEWS index 7e5b1d629d,6de48123e7..b923109b8c --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -957,24 -652,24 +957,27 @@@ Buil - Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC 4.8. -- Issue #17962: Build with OpenSSL 1.0.1e on Windows. - +- Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1 + on Windows. -What's New in Python 3.3.1? -=========================== +Tools/Demos +----------- -*Release date: 07-Apr-2013* ++- Issue #18817: Fix a resource warning in Lib/aifc.py demo. Patch by ++ Vajrasky Kok. + -Build ------ +- Issue #18439: Make patchcheck work on Windows for ACKS, NEWS. -- Issue #17550: Fix the --enable-profiling configure switch. +- Issue #18448: Fix a typo in Tools/demo/eiffel.py. -IDLE -------- +- Issue #18457: Fixed saving of formulas and complex numbers in + Tools/demo/ss1.py. -- Issue #17625: In IDLE, close the replace dialog after it is used. +- Issue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by + Févry Thibault. +- Issue #12990: The "Python Launcher" on OSX could not launch python scripts + that have paths that include wide characters. What's New in Python 3.3.1 release candidate 1? ===============================================