mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-24 08:29:07 +00:00
str() -> unicode()
This commit is contained in:
@@ -451,7 +451,7 @@ def readInput(message, default=None):
|
||||
message += "\n> "
|
||||
|
||||
if conf.batch and default:
|
||||
infoMsg = "%s%s" % (message, str(default))
|
||||
infoMsg = "%s%s" % (message, unicode(default))
|
||||
logger.info(infoMsg)
|
||||
|
||||
debugMsg = "used the default behaviour, running in batch mode"
|
||||
@@ -517,7 +517,7 @@ def sanitizeStr(inpStr):
|
||||
@rtype: C{str}
|
||||
"""
|
||||
|
||||
cleanString = str(inpStr)
|
||||
cleanString = unicode(inpStr)
|
||||
cleanString = cleanString.replace("\n", " ").replace("\r", "")
|
||||
|
||||
return cleanString
|
||||
@@ -638,8 +638,8 @@ def parseTargetDirect():
|
||||
conf.dbmsUser = details.group('user')
|
||||
conf.dbmsPass = details.group('pass')
|
||||
else:
|
||||
conf.dbmsUser = str()
|
||||
conf.dbmsPass = str()
|
||||
conf.dbmsUser = unicode()
|
||||
conf.dbmsPass = unicode()
|
||||
|
||||
if not conf.dbmsPass:
|
||||
conf.dbmsPass = None
|
||||
@@ -1032,7 +1032,7 @@ def safeStringFormat(formatStr, params):
|
||||
|
||||
if index != -1:
|
||||
if count < len(params):
|
||||
retVal = retVal[:index] + str(params[count]) + retVal[index+2:]
|
||||
retVal = retVal[:index] + unicode(params[count]) + retVal[index+2:]
|
||||
else:
|
||||
raise sqlmapNoneDataException, "wrong number of parameters during string formatting"
|
||||
count += 1
|
||||
@@ -1107,7 +1107,7 @@ def profile(profileOutputFile=None, dotOutputFile=None, imageOutputFile=None):
|
||||
import gtk
|
||||
import pydot
|
||||
except ImportError, e:
|
||||
errMsg = "profiling requires third-party libraries (%s)" % str(e)
|
||||
errMsg = "profiling requires third-party libraries (%s)" % unicode(e)
|
||||
logger.error(errMsg)
|
||||
return
|
||||
|
||||
@@ -1343,7 +1343,7 @@ def getCommonStart(strings=[]):
|
||||
if len(strings) == 1:
|
||||
return strings[0]
|
||||
|
||||
retVal = str()
|
||||
retVal = unicode()
|
||||
maxCount = min(len(string) for string in strings)
|
||||
|
||||
count = 0
|
||||
|
||||
@@ -63,7 +63,7 @@ class Dump:
|
||||
|
||||
return
|
||||
|
||||
data = str(data)
|
||||
data = unicode(data)
|
||||
|
||||
if data:
|
||||
data = data.replace("__NEWLINE__", "\n").replace("__TAB__", "\t")
|
||||
@@ -93,7 +93,7 @@ class Dump:
|
||||
if isinstance(element, basestring):
|
||||
self.__write("[*] %s" % element)
|
||||
elif isinstance(element, (list, tuple, set)):
|
||||
self.__write("[*] " + ", ".join(str(e) for e in element))
|
||||
self.__write("[*] " + ", ".join(unicode(e) for e in element))
|
||||
|
||||
if elements:
|
||||
self.__write("")
|
||||
|
||||
@@ -80,7 +80,7 @@ class ProgressBar:
|
||||
" " * (allFull - numHashes))
|
||||
|
||||
# Add the percentage at the beginning of the progress bar
|
||||
percentString = str(percentDone) + "%"
|
||||
percentString = unicode(percentDone) + "%"
|
||||
self.__progBar = "%s %s" % (percentString, self.__progBar)
|
||||
|
||||
def draw(self, eta=0):
|
||||
@@ -102,4 +102,4 @@ class ProgressBar:
|
||||
This method returns the progress bar string
|
||||
"""
|
||||
|
||||
return str(self.__progBar)
|
||||
return unicode(self.__progBar)
|
||||
|
||||
@@ -214,7 +214,7 @@ def __updateSqlmap():
|
||||
logger.debug(debugMsg)
|
||||
|
||||
def notify(event_dict):
|
||||
action = str(event_dict['action'])
|
||||
action = unicode(event_dict['action'])
|
||||
index = action.find('_')
|
||||
prefix = action[index + 1].upper() if index != -1 else action.capitalize()
|
||||
|
||||
@@ -224,7 +224,7 @@ def __updateSqlmap():
|
||||
if action.find('_completed') == -1:
|
||||
print "%s\t%s" % (prefix, event_dict['path'])
|
||||
else:
|
||||
revision = str(event_dict['revision'])
|
||||
revision = unicode(event_dict['revision'])
|
||||
index = revision.find('number ')
|
||||
|
||||
if index != -1:
|
||||
|
||||
Reference in New Issue
Block a user