mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-25 17:09:02 +00:00
str() -> unicode()
This commit is contained in:
@@ -94,7 +94,7 @@ def decodePage(page, encoding):
|
||||
Decode gzip/deflate HTTP response
|
||||
"""
|
||||
|
||||
if str(encoding).lower() in ('gzip', 'x-gzip', 'deflate'):
|
||||
if unicode(encoding).lower() in (u'gzip', u'x-gzip', u'deflate'):
|
||||
if encoding == 'deflate':
|
||||
# http://stackoverflow.com/questions/1089662/python-inflate-and-deflate-implementations
|
||||
data = StringIO.StringIO(zlib.decompress(page, -15))
|
||||
|
||||
@@ -163,7 +163,7 @@ class Connect:
|
||||
if not cookieStr:
|
||||
cookieStr = "Cookie: "
|
||||
|
||||
cookie = str(cookie)
|
||||
cookie = unicode(cookie)
|
||||
index = cookie.index(" for ")
|
||||
|
||||
cookieStr += "%s; " % cookie[8:index]
|
||||
@@ -257,7 +257,7 @@ class Connect:
|
||||
responseMsg += "(%s - %d):\n" % (status, code)
|
||||
|
||||
if conf.verbose <= 4:
|
||||
responseMsg += str(responseHeaders)
|
||||
responseMsg += unicode(responseHeaders)
|
||||
elif conf.verbose > 4:
|
||||
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def direct(query, content=True):
|
||||
output = base64unpickle(kb.resumedQueries[conf.hostname][query][:-1])
|
||||
|
||||
infoMsg = "resumed from file '%s': " % conf.sessionFile
|
||||
infoMsg += "%s..." % str(output)[:20]
|
||||
infoMsg += "%s..." % unicode(output)[:20]
|
||||
logger.info(infoMsg)
|
||||
elif select:
|
||||
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
||||
@@ -67,7 +67,7 @@ def direct(query, content=True):
|
||||
|
||||
if len(output) == 1:
|
||||
if len(output[0]) == 1:
|
||||
return str(list(output)[0][0])
|
||||
return unicode(list(output)[0][0])
|
||||
else:
|
||||
return list(output)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user