mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Issue #13441: _PyUnicode_CheckConsistency() dumps the string if the maximum
character is bigger than U+10FFFF and locale.localeconv() dumps the string before decoding it. Temporary hack to debug the issue #13441.
This commit is contained in:
		
							parent
							
								
									a996f1e1a0
								
							
						
					
					
						commit
						da29cc36aa
					
				
					 2 changed files with 39 additions and 0 deletions
				
			
		|  | @ -391,6 +391,19 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) | |||
|             if (ch > maxchar) | ||||
|                 maxchar = ch; | ||||
|         } | ||||
|         if (maxchar > 0x10FFFF) { | ||||
|             printf("Invalid Unicode string! {"); | ||||
|             for (i=0; i < ascii->length; i++) | ||||
|             { | ||||
|                 Py_UCS4 ch = PyUnicode_READ(kind, data, i); | ||||
|                 if (i) | ||||
|                     printf(", U+%04x", ch); | ||||
|                 else | ||||
|                     printf("U+%04x", ch); | ||||
|             } | ||||
|             printf("} (len=%u)\n", ascii->length); | ||||
|             abort(); | ||||
|         } | ||||
|         if (kind == PyUnicode_1BYTE_KIND) { | ||||
|             if (ascii->state.ascii == 0) { | ||||
|                 assert(maxchar >= 128); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner