mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	gh-104340: Suppress warning about unawaited exception for closed pipe stdin (#104586)
This commit is contained in:
		
							parent
							
								
									b27fe67f3c
								
							
						
					
					
						commit
						7fc8e2d462
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		|  | @ -81,6 +81,9 @@ def pipe_connection_lost(self, fd, exc): | |||
|                 self._stdin_closed.set_result(None) | ||||
|             else: | ||||
|                 self._stdin_closed.set_exception(exc) | ||||
|                 # Since calling `wait_closed()` is not mandatory, | ||||
|                 # we shouldn't log the traceback if this is not awaited. | ||||
|                 self._stdin_closed._log_traceback = False | ||||
|             return | ||||
|         if fd == 1: | ||||
|             reader = self.stdout | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
| When an ``asyncio`` pipe protocol loses its connection due to an error, and the caller doesn't await ``wait_closed()`` on the corresponding ``StreamWriter``, don't log a warning about an exception that was never retrieved. After all, according to the ``StreamWriter.close()`` docs, the ``wait_closed()`` call is optional ("not mandatory"). | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum