Skip to content

bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__()#13601

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:pyio_del
May 27, 2019
Merged

bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__()#13601
vstinner merged 1 commit into
python:masterfrom
vstinner:pyio_del

Conversation

@vstinner

@vstinner vstinner commented May 27, 2019

Copy link
Copy Markdown
Member

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().

https://bugs.python.org/issue37054

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().

@pitrou pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@vstinner vstinner merged commit a356841 into python:master May 27, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@vstinner vstinner deleted the pyio_del branch May 27, 2019 23:44
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 27, 2019
…3601)

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 a356841)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
@bedevere-bot

Copy link
Copy Markdown

GH-13604 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request May 28, 2019
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 a356841)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…3601)

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().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants