Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Jun 12, 2019

When io.BufferedWrite.close() is called twice, the second call now
does nothing. Previously, the flush() method and raw.close() were
called at the second call.

Moreover, even if close() raises an exception, the file is now
considered as closed.

https://bugs.python.org/issue37223

When io.BufferedWrite.close() is called twice, the second call now
does nothing. Previously, the flush() method and raw.close() were
called at the second call.

Moreover, even if close() raises an exception, the file is now
considered as closed.
@vstinner
Copy link
Member Author

This PR changes the behavior of the io module for a corner case. I merged PR #14028 instead to only fix an error when running test_io. IMHO the current behavior makes sense and ensures that text, buffered and fileio states are consistent, especially for the closed attribute. I close this PR.

@vstinner vstinner closed this Jun 12, 2019
@vstinner vstinner deleted the bufferedwriter_close branch June 12, 2019 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants