File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,9 @@ int _Py_open_cloexec_works = -1;
5555
5656// mbstowcs() and mbrtowc() errors 
5757static  const  size_t  DECODE_ERROR  =  ((size_t )-1 );
58+ #ifdef  HAVE_MBRTOWC 
5859static  const  size_t  INCOMPLETE_CHARACTER  =  (size_t )-2 ;
59- 
60+ #endif 
6061
6162static  int 
6263get_surrogateescape (_Py_error_handler  errors , int  * surrogateescape )
@@ -129,7 +130,7 @@ is_valid_wide_char(wchar_t ch)
129130        // Reject lone surrogate characters 
130131        return  0 ;
131132    }
132-     if  (ch  >  MAX_UNICODE ) {
133+     if  (sizeof ( ch )  >   2   &&   ch  >  MAX_UNICODE ) {
133134        // bpo-35883: Reject characters outside [U+0000; U+10ffff] range. 
134135        // The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629, 
135136        // it creates characters outside the [U+0000; U+10ffff] range: 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments