]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666)
authorChris A <christopher.aporta@gmail.com>
Mon, 2 Mar 2020 06:39:50 +0000 (01:39 -0500)
committerGitHub <noreply@github.com>
Mon, 2 Mar 2020 06:39:50 +0000 (08:39 +0200)
commit2565edec2c974b2acca03b4cc5025e83f903ddd7
tree58c6999be2b2ad47bcfcf5e5f294c8a07e81ff84
parent4edc95cf0a2960431621eee9bc194f6225f1690b
bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666)

Open issue in the BPO indicated a desire to make the implementation of
codecs.open() at parity with io.open(), which implements a try/except to
assure file stream gets closed before an exception is raised.
Lib/codecs.py
Lib/test/test_codecs.py
Misc/NEWS.d/next/Library/2019-12-20-16-06-28.bpo-38971.fKRYlF.rst [new file with mode: 0644]