mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
[3.12] gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (GH-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 58753f33e4
)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
parent
874eed6cfe
commit
a6516de08b
3 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue