mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-11-04 09:57:38 +03:00 
			
		
		
		
	Fixes #1347
This commit is contained in:
		
							parent
							
								
									690347a170
								
							
						
					
					
						commit
						337eb9861a
					
				| 
						 | 
					@ -1583,9 +1583,10 @@ def safeExpandUser(filepath):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        retVal = os.path.expanduser(filepath)
 | 
					        retVal = os.path.expanduser(filepath)
 | 
				
			||||||
    except UnicodeDecodeError:
 | 
					    except UnicodeError:
 | 
				
			||||||
        _ = locale.getdefaultlocale()
 | 
					        _ = locale.getdefaultlocale()
 | 
				
			||||||
        retVal = getUnicode(os.path.expanduser(filepath.encode(_[1] if _ and len(_) > 1 else UNICODE_ENCODING)))
 | 
					        encoding = _[1] if _ and len(_) > 1 else UNICODE_ENCODING
 | 
				
			||||||
 | 
					        retVal = getUnicode(os.path.expanduser(filepath.encode(encoding)), encoding=encoding)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return retVal
 | 
					    return retVal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2115,7 +2116,7 @@ def getUnicode(value, encoding=None, noneToNull=False):
 | 
				
			||||||
    elif isinstance(value, basestring):
 | 
					    elif isinstance(value, basestring):
 | 
				
			||||||
        while True:
 | 
					        while True:
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                return unicode(value, encoding or kb.get("pageEncoding") or UNICODE_ENCODING)
 | 
					                return unicode(value, encoding or (kb.get("pageEncoding") if kb.get("originalPage") else None) or UNICODE_ENCODING)
 | 
				
			||||||
            except UnicodeDecodeError, ex:
 | 
					            except UnicodeDecodeError, ex:
 | 
				
			||||||
                try:
 | 
					                try:
 | 
				
			||||||
                    return unicode(value, UNICODE_ENCODING)
 | 
					                    return unicode(value, UNICODE_ENCODING)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user