Content-Length: 267499 | pFad | http://github.com/python/cpython/commit/a6516de08b7062d224a6a5f88a7d4ad4dd1fd051

F7 [3.12] gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (G… · python/cpython@a6516de · GitHub
Skip to content

Commit

Permalink
[3.12] gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (G…
Browse files Browse the repository at this point in the history
…H-121876) (#121912)

gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (GH-121876)

Problem occurred when attribute xyz could not be pickled.
Since this is not trivial to selectively fix, block all
attributes (other than 'width').  IDLE does not access them
and they are private implementation details.
(cherry picked from commit 58753f3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
  • Loading branch information
miss-islington and terryjreedy authored Jul 17, 2024
1 parent 874eed6 commit a6516de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/idlelib/News3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Released after 2023-10-02
=========================


gh-78889: Stop Shell freezes by blocking user access to non-method
sys.stdout.shell attributes, which are all private.

gh-78955: Use user-selected color theme for Help => IDLE Doc.

gh-96905: In idlelib code, stop redefining built-ins 'dict' and 'object'.
Expand Down
3 changes: 3 additions & 0 deletions Lib/idlelib/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ class StdioFile(io.TextIOBase):

def __init__(self, shell, tags, encoding='utf-8', errors='strict'):
self.shell = shell
# GH-78889: accessing unpickleable attributes freezes Shell.
# IDLE only needs methods; allow 'width' for possible use.
self.shell._RPCProxy__attributes = {'width': 1}
self.tags = tags
self._encoding = encoding
self._errors = errors
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Stop Shell freezes by blocking user access to non-method sys.stdout.shell attributes,
which are all private.

0 comments on commit a6516de

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/commit/a6516de08b7062d224a6a5f88a7d4ad4dd1fd051

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy