mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	[3.13] gh-125682: Reject non-ASCII digits in the Python implementation of JSON decoder (GH-125687) (GH-125692)
(cherry picked from commit d358425e69)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									014d0ee341
								
							
						
					
					
						commit
						6715afe349
					
				
					 3 changed files with 9 additions and 1 deletions
				
			
		|  | @ -16,6 +16,12 @@ def test_float(self): | |||
|         self.assertIsInstance(rval, float) | ||||
|         self.assertEqual(rval, 1.0) | ||||
| 
 | ||||
|     def test_nonascii_digits_rejected(self): | ||||
|         # JSON specifies only ascii digits, see gh-125687 | ||||
|         for num in ["1\uff10", "0.\uff10", "0e\uff10"]: | ||||
|             with self.assertRaises(self.JSONDecodeError): | ||||
|                 self.loads(num) | ||||
| 
 | ||||
|     def test_bytes(self): | ||||
|         self.assertEqual(self.loads(b"1"), 1) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miss Islington (bot)
						Miss Islington (bot)