mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	gh-96189: Fix test_invalid_utf8 on a number of build bots (GH-96190)
The clearing of the temporary directory is not working on some platforms and leaving behind files. This has been updated to use the pattern in test_cmd_line.py [1] using the special TESTFN rather than a test directory. [1] https://github.com/python/cpython/blob/main/Lib/test/test_cmd_line.py#L559
This commit is contained in:
		
							parent
							
								
									e046cf872e
								
							
						
					
					
						commit
						054328f0dd
					
				
					 1 changed files with 38 additions and 38 deletions
				
			
		| 
						 | 
					@ -239,8 +239,8 @@ def test_invalid_utf8(self):
 | 
				
			||||||
        # it's an otherwise valid Python source file.
 | 
					        # it's an otherwise valid Python source file.
 | 
				
			||||||
        template = b'"%s"\n'
 | 
					        template = b'"%s"\n'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        with tempfile.TemporaryDirectory() as tmpd:
 | 
					        fn = TESTFN
 | 
				
			||||||
            fn = os.path.join(tmpd, 'test.py')
 | 
					        self.addCleanup(unlink, fn)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def check(content):
 | 
					        def check(content):
 | 
				
			||||||
            with open(fn, 'wb') as fp:
 | 
					            with open(fn, 'wb') as fp:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue