[issue45804] IDLE - faster shell writing

Roger Serwy report at bugs.python.org
Sun Nov 14 12:40:25 EST 2021


Roger Serwy <roger.serwy at gmail.com> added the comment:

All good questions, Terry! I do have a git clone of the cpython repo, but I haven't worked through the new commit/patch process since Mercurial. I'm a bit rusty.

The buffering provided is for calls to `write`. It does not do any line buffering. Calls to `isatty` will behave the same. The negative side effect is that the subprocess will proceed as if writes have been committed to the PyShell window, so any pending transfers can be lost if the subprocess terminates unexpectedly.

I used a separate OS thread to handle the transfer of the writes rather than using the Tcl/Tk event loop. The Tcl/Tk loop runs on the main thread, so any long-running processes will prevent a `.after` callback function from being called.

The base class was not changed. I haven't followed all the changes to the stream class (and its implications) since 3.5, so the code subclasses the newer `StdOutputFile` class to minimize disruption.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45804>
_______________________________________


More information about the Python-bugs-list mailing list