mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Forward port MvL's fix in 43227:
Fix crash when a Unicode string containing an encoding declaration is compile()d. Fixes #1115379.
This commit is contained in:
		
							parent
							
								
									4d073bb9a1
								
							
						
					
					
						commit
						e98ccf6690
					
				
					 3 changed files with 11 additions and 0 deletions
				
			
		|  | @ -284,6 +284,10 @@ def f(): | |||
|         f1, f2 = f() | ||||
|         self.assertNotEqual(id(f1.func_code), id(f2.func_code)) | ||||
| 
 | ||||
|     def test_unicode_encoding(self): | ||||
|         code = u"# -*- coding: utf-8 -*-\npass\n" | ||||
|         self.assertRaises(SyntaxError, compile, code, "tmp", "exec") | ||||
| 
 | ||||
|     def test_subscripts(self): | ||||
|         # SF bug 1448804 | ||||
|         # Class to make testing subscript results easy | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Neal Norwitz
						Neal Norwitz