]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__() (GH-13601)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 28 May 2019 00:05:49 +0000 (17:05 -0700)
committerGitHub <noreply@github.com>
Tue, 28 May 2019 00:05:49 +0000 (17:05 -0700)
commit0f352d44e7c14c1c93e3999402c85512b9d5a6ca
tree0a244c3f70f569c51c37c6086ccd90aa13164627
parentabdda3ae2a19326bb10bb6e54400c5d3a904b742
bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__() (GH-13601)

Fix destructor _pyio.BytesIO and _pyio.TextIOWrapper: initialize
their _buffer attribute as soon as possible (in the class body),
because it's used by __del__() which calls close().
(cherry picked from commit a3568417c49f36860393075b21c93996a5f6799b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Lib/_pyio.py
Misc/NEWS.d/next/Library/2019-05-28-01-06-44.bpo-37054.sLULGQ.rst [new file with mode: 0644]