mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Patch for an Issue #1124
This commit is contained in:
@@ -14,6 +14,7 @@ import hashlib
|
||||
import httplib
|
||||
import inspect
|
||||
import json
|
||||
import locale
|
||||
import logging
|
||||
import ntpath
|
||||
import os
|
||||
@@ -1558,6 +1559,22 @@ def normalizePath(filepath):
|
||||
|
||||
return retVal
|
||||
|
||||
def safeExpandUser(filepath):
|
||||
"""
|
||||
Patch for a Python Issue18171 (http://bugs.python.org/issue18171)
|
||||
"""
|
||||
|
||||
retVal = filepath
|
||||
|
||||
try:
|
||||
retVal = os.path.expanduser(filepath)
|
||||
except UnicodeDecodeError:
|
||||
_ = locale.getdefaultlocale()
|
||||
retVal = getUnicode(os.path.expanduser(filepath.encode(_[1] if _ and len(_) > 1 else UNICODE_ENCODING)))
|
||||
|
||||
print retVal
|
||||
return retVal
|
||||
|
||||
def safeStringFormat(format_, params):
|
||||
"""
|
||||
Avoids problems with inappropriate string format strings
|
||||
|
||||
Reference in New Issue
Block a user