MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / safeExpandUser

Function safeExpandUser

lib/core/common.py:2144–2161  ·  view source on GitHub ↗

Patch for a Python Issue18171 (http://bugs.python.org/issue18171) >>> os.path.basename(__file__) in safeExpandUser(__file__) True

(filepath)

Source from the content-addressed store, hash-verified

2142
2143
2144def safeExpandUser(filepath):
2145 """
2146 Patch for a Python Issue18171 (http://bugs.python.org/issue18171)
2147
2148 >>> os.path.basename(__file__) in safeExpandUser(__file__)
2149 True
2150 """
2151
2152 retVal = filepath
2153
2154 try:
2155 retVal = os.path.expanduser(filepath)
2156 except UnicodeError:
2157 _ = locale.getdefaultlocale()
2158 encoding = _[1] if _ and len(_) > 1 else UNICODE_ENCODING
2159 retVal = getUnicode(os.path.expanduser(filepath.encode(encoding)), encoding=encoding)
2160
2161 return retVal
2162
2163def safeStringFormat(format_, params):
2164 """

Callers 4

_setRequestFromFileFunction · 0.90
_setBulkMultipleTargetsFunction · 0.90
_setHTTPAuthenticationFunction · 0.90
_cleanupOptionsFunction · 0.90

Calls 1

getUnicodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…