Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bcb2582

Browse files
committed
Fixes #1320
1 parent 301aca5 commit bcb2582

7 files changed

Lines changed: 11 additions & 10 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ def dataToOutFile(filename, data):
876876
f.write(data)
877877
except IOError, ex:
878878
errMsg = "something went wrong while trying to write "
879-
errMsg += "to the output file ('%s')" % ex
879+
errMsg += "to the output file ('%s')" % getUnicode(ex)
880880
raise SqlmapGenericException(errMsg)
881881

882882
return retVal
@@ -3662,7 +3662,7 @@ def evaluateCode(code, variables=None):
36623662
except KeyboardInterrupt:
36633663
raise
36643664
except Exception, ex:
3665-
errMsg = "an error occurred while evaluating provided code ('%s'). " % ex
3665+
errMsg = "an error occurred while evaluating provided code ('%s') " % getUnicode(ex)
36663666
raise SqlmapGenericException(errMsg)
36673667

36683668
def serializeObject(object_):

lib/core/dump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _write(self, data, newline=True, console=True, content_type=None):
7474
try:
7575
self._outputFP.write(text)
7676
except IOError, ex:
77-
errMsg = "error occurred while writing to log file ('%s')" % ex
77+
errMsg = "error occurred while writing to log file ('%s')" % getUnicode(ex)
7878
raise SqlmapGenericException(errMsg)
7979

8080
if kb.get("multiThreadMode"):
@@ -94,7 +94,7 @@ def setOutputFile(self):
9494
try:
9595
self._outputFP = openFile(self._outputFile, "ab" if not conf.flushSession else "wb")
9696
except IOError, ex:
97-
errMsg = "error occurred while opening log file ('%s')" % ex
97+
errMsg = "error occurred while opening log file ('%s')" % getUnicode(ex)
9898
raise SqlmapGenericException(errMsg)
9999

100100
def getOutputFile(self):

lib/core/option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ def _createTemporaryDirectory():
15211521
os.makedirs(tempfile.gettempdir())
15221522
except IOError, ex:
15231523
errMsg = "there has been a problem while accessing "
1524-
errMsg += "system's temporary directory location(s) ('%s'). Please " % ex
1524+
errMsg += "system's temporary directory location(s) ('%s'). Please " % getUnicode(ex)
15251525
errMsg += "make sure that there is enough disk space left. If problem persists, "
15261526
errMsg += "try to set environment variable 'TEMP' to a location "
15271527
errMsg += "writeable by the current user"

lib/core/replication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def execute(self, sql, parameters=[]):
7070
try:
7171
self.parent.cursor.execute(sql, parameters)
7272
except sqlite3.OperationalError, ex:
73-
errMsg = "problem occurred ('%s') while accessing sqlite database " % ex
73+
errMsg = "problem occurred ('%s') while accessing sqlite database " % unicode(ex)
7474
errMsg += "located at '%s'. Please make sure that " % self.parent.dbpath
7575
errMsg += "it's not used by some other program"
7676
raise SqlmapGenericException(errMsg)

lib/parse/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def _(self, *args):
862862
for arg in shlex.split(command):
863863
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
864864
except ValueError, ex:
865-
raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % ex
865+
raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % getUnicode(ex)
866866

867867
# Hide non-basic options in basic help case
868868
for i in xrange(len(argv)):

lib/utils/hash.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from lib.core.common import dataToStdout
4545
from lib.core.common import getFileItems
4646
from lib.core.common import getPublicTypeMembers
47+
from lib.core.common import getUnicode
4748
from lib.core.common import hashDBRetrieve
4849
from lib.core.common import hashDBWrite
4950
from lib.core.common import normalizeUnicode
@@ -769,7 +770,7 @@ def dictionaryAttack(attack_dict):
769770

770771
except Exception, ex:
771772
warnMsg = "there was a problem while loading dictionaries"
772-
warnMsg += " ('%s')" % ex
773+
warnMsg += " ('%s')" % getUnicode(ex)
773774
logger.critical(warnMsg)
774775

775776
message = "do you want to use common password suffixes? (slow!) [y/N] "

plugins/generic/entries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ def dumpTable(self, foundData=None):
341341
attackDumpedTable()
342342
except (IOError, OSError), ex:
343343
errMsg = "an error occurred while attacking "
344-
errMsg += "table dump ('%s')" % ex
344+
errMsg += "table dump ('%s')" % getUnicode(ex)
345345
logger.critical(errMsg)
346346
conf.dumper.dbTableValues(kb.data.dumpedTable)
347347

348348
except SqlmapConnectionException, ex:
349349
errMsg = "connection exception detected in dumping phase "
350-
errMsg += "('%s')" % ex
350+
errMsg += "('%s')" % getUnicode(ex)
351351
logger.critical(errMsg)
352352

353353
finally:

0 commit comments

Comments
 (0)