X Tutup
Skip to content

bpo-17852: Fix PR #3372, flush BufferedWriter objects on exit.#4847

Closed
nascheme wants to merge 2 commits intopython:masterfrom
nascheme:atexit_flush_buffers_fix
Closed

bpo-17852: Fix PR #3372, flush BufferedWriter objects on exit.#4847
nascheme wants to merge 2 commits intopython:masterfrom
nascheme:atexit_flush_buffers_fix

Conversation

@nascheme
Copy link
Copy Markdown
Member

@nascheme nascheme commented Dec 13, 2017

New version of PR #3372, which was reverted by 317def9.

We can't use _Py_PyAtExit() as it only supports registering a single
callback. It is used by the atexit module and so we can't use it. We
can't use Py_AtExit() either because it calls functions too late in the
interpreter shutdown process. Instead, create io._flush_all_buffers.
In io.py, register it with the atexit module.

https://bugs.python.org/issue17852

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting change review type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup