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

Function safeFilepathEncode

lib/core/common.py:2128–2141  ·  view source on GitHub ↗

Returns filepath in (ASCII) format acceptable for OS handling (e.g. reading) >>> 'sqlmap' in safeFilepathEncode(paths.SQLMAP_HOME_PATH) True

(filepath)

Source from the content-addressed store, hash-verified

2126 return retVal
2127
2128def safeFilepathEncode(filepath):
2129 """
2130 Returns filepath in (ASCII) format acceptable for OS handling (e.g. reading)
2131
2132 >>> 'sqlmap' in safeFilepathEncode(paths.SQLMAP_HOME_PATH)
2133 True
2134 """
2135
2136 retVal = filepath
2137
2138 if filepath and six.PY2 and isinstance(filepath, six.text_type):
2139 retVal = getBytes(filepath, sys.getfilesystemencoding() or UNICODE_ENCODING)
2140
2141 return retVal
2142
2143
2144def safeExpandUser(filepath):

Callers 3

_setTamperingFunctionsFunction · 0.90
_setPreprocessFunctionsFunction · 0.90
_setPostprocessFunctionsFunction · 0.90

Calls 1

getBytesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…