Skip to content

gh-89544: Fix IDLE hang after Restart Shell while receiving output - #157644

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-89544-restart-buffer
Open

serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-89544-restart-buffer

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

restart_subprocess() reuses the MyRPCClient object: close(), then accept() calls SocketIO.__init__() again for the new connection. It resets the socket, responses and condition variables, but not the receive buffer, which was kept in class attributes shadowed by instance attributes. After Restart Shell while the GUI was receiving a large output (for example the result of 'a'*1_600_000), the partially received packet was kept, the QUEUED reply to transfer_path() from the new user process was appended to it, and the GUI process waited forever for a complete packet with the Tk event loop blocked.

Now the receive buffer is initialized per connection.

🤖 Generated with Claude Code

RPCClient.accept() reinitializes the SocketIO for the new connection,
but the receive buffer kept the partially received packet from the old
connection, so no message from the new user process was ever complete.
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.13 bugs and security fixes label Sep 16, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes needs backport to 3.13 bugs and security fixes labels Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant