mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Fix test_os: workaround #8611 bug
This commit is contained in:
		
							parent
							
								
									5ea823cf55
								
							
						
					
					
						commit
						70f88c59eb
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1165,8 +1165,15 @@ def check(encoding, bytesfn, unicodefn):
 | 
			
		|||
            decoded = self.get_output(encoding, 'repr(os.fsdecode(%a))' % bytesfn)
 | 
			
		||||
            self.assertEqual(decoded, repr(unicodefn))
 | 
			
		||||
 | 
			
		||||
        check('ascii', b'abc\xff', 'abc\udcff')
 | 
			
		||||
        check('utf-8', b'\xc3\xa9\x80', '\xe9\udc80')
 | 
			
		||||
        try:
 | 
			
		||||
            sys.executable.encode("ascii")
 | 
			
		||||
        except UnicodeEncodeError:
 | 
			
		||||
            # Python doesn't start with ASCII locale if its path is not ASCII,
 | 
			
		||||
            # see issue #8611
 | 
			
		||||
            pass
 | 
			
		||||
        else:
 | 
			
		||||
            check('ascii', b'abc\xff', 'abc\udcff')
 | 
			
		||||
            check('iso-8859-15', b'\xef\xa4', '\xef\u20ac')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue