mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-23 01:56:36 +03:00
fix for a bug reported by shaohua pan (and one other bug)
This commit is contained in:
parent
18db96c45f
commit
1b3d287a09
|
@ -1386,7 +1386,7 @@ def getPartRun():
|
||||||
# Return the INI tag to consider for common outputs (e.g. 'Databases')
|
# Return the INI tag to consider for common outputs (e.g. 'Databases')
|
||||||
return commonPartsDict[retVal][1] if retVal in commonPartsDict else retVal
|
return commonPartsDict[retVal][1] if retVal in commonPartsDict else retVal
|
||||||
|
|
||||||
def getUnicode(value):
|
def getUnicode(value, encoding=None):
|
||||||
"""
|
"""
|
||||||
Return the unicode representation of the supplied value:
|
Return the unicode representation of the supplied value:
|
||||||
|
|
||||||
|
@ -1397,8 +1397,10 @@ def getUnicode(value):
|
||||||
>>> getUnicode(1)
|
>>> getUnicode(1)
|
||||||
u'1'
|
u'1'
|
||||||
"""
|
"""
|
||||||
|
if encoding is None:
|
||||||
|
encoding = conf.dataEncoding if 'dataEncoding' in conf else "utf-8"
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, basestring):
|
||||||
return value if isinstance(value, unicode) else unicode(value, conf.dataEncoding if 'dataEncoding' in conf else "utf-8", errors='replace')
|
return value if isinstance(value, unicode) else unicode(value, encoding, errors='replace')
|
||||||
else:
|
else:
|
||||||
return unicode(value)
|
return unicode(value)
|
||||||
|
|
||||||
|
@ -1475,8 +1477,8 @@ def smokeTest():
|
||||||
else:
|
else:
|
||||||
# Run doc tests
|
# Run doc tests
|
||||||
# Reference: http://docs.python.org/library/doctest.html
|
# Reference: http://docs.python.org/library/doctest.html
|
||||||
results = doctest.testmod(module)
|
(failure_count, test_count) = doctest.testmod(module)
|
||||||
if results.failed > 0:
|
if failure_count > 0:
|
||||||
retVal = False
|
retVal = False
|
||||||
|
|
||||||
infoMsg = "smoke test "
|
infoMsg = "smoke test "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user