mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-78889: Stop IDLE Shell freezes from sys.stdout.shell.xyz (#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.
This commit is contained in:
		
							parent
							
								
									6682d91678
								
							
						
					
					
						commit
						58753f33e4
					
				
					 3 changed files with 8 additions and 0 deletions
				
			
		|  | @ -4,6 +4,9 @@ Released on 2024-10-xx | ||||||
| ========================= | ========================= | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 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-78955: Use user-selected color theme for Help => IDLE Doc. | ||||||
| 
 | 
 | ||||||
| gh-96905: In idlelib code, stop redefining built-ins 'dict' and 'object'. | gh-96905: In idlelib code, stop redefining built-ins 'dict' and 'object'. | ||||||
|  |  | ||||||
|  | @ -443,6 +443,9 @@ class StdioFile(io.TextIOBase): | ||||||
| 
 | 
 | ||||||
|     def __init__(self, shell, tags, encoding='utf-8', errors='strict'): |     def __init__(self, shell, tags, encoding='utf-8', errors='strict'): | ||||||
|         self.shell = shell |         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.tags = tags | ||||||
|         self._encoding = encoding |         self._encoding = encoding | ||||||
|         self._errors = errors |         self._errors = errors | ||||||
|  |  | ||||||
|  | @ -0,0 +1,2 @@ | ||||||
|  | Stop Shell freezes by blocking user access to non-method sys.stdout.shell attributes, | ||||||
|  | which are all private. | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Terry Jan Reedy
						Terry Jan Reedy