diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 576d20a0f..f4c053ec9 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -1298,7 +1298,7 @@ def checkConnection(suppressOutput=False): raise SqlmapConnectionException(errMsg) except socket.error, ex: errMsg = "problem occurred while " - errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getUnicode(ex)) + errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, ex.message) raise SqlmapConnectionException(errMsg) if not suppressOutput and not conf.dummy and not conf.offline: diff --git a/lib/core/common.py b/lib/core/common.py index 5b914b159..6f9303876 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -876,7 +876,7 @@ def dataToOutFile(filename, data): f.write(data) except IOError, ex: errMsg = "something went wrong while trying to write " - errMsg += "to the output file ('%s')" % getUnicode(ex) + errMsg += "to the output file ('%s')" % ex.message raise SqlmapGenericException(errMsg) return retVal @@ -3662,7 +3662,7 @@ def evaluateCode(code, variables=None): except KeyboardInterrupt: raise except Exception, ex: - errMsg = "an error occurred while evaluating provided code ('%s') " % getUnicode(ex) + errMsg = "an error occurred while evaluating provided code ('%s') " % ex.message raise SqlmapGenericException(errMsg) def serializeObject(object_): diff --git a/lib/core/dump.py b/lib/core/dump.py index 08410602d..4401f1742 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -74,7 +74,7 @@ class Dump(object): try: self._outputFP.write(text) except IOError, ex: - errMsg = "error occurred while writing to log file ('%s')" % getUnicode(ex) + errMsg = "error occurred while writing to log file ('%s')" % ex.message raise SqlmapGenericException(errMsg) if kb.get("multiThreadMode"): @@ -94,7 +94,7 @@ class Dump(object): try: self._outputFP = openFile(self._outputFile, "ab" if not conf.flushSession else "wb") except IOError, ex: - errMsg = "error occurred while opening log file ('%s')" % getUnicode(ex) + errMsg = "error occurred while opening log file ('%s')" % ex.message raise SqlmapGenericException(errMsg) def getOutputFile(self): diff --git a/lib/core/option.py b/lib/core/option.py index f5edb95b4..896446cd0 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1521,7 +1521,7 @@ def _createTemporaryDirectory(): os.makedirs(tempfile.gettempdir()) except IOError, ex: errMsg = "there has been a problem while accessing " - errMsg += "system's temporary directory location(s) ('%s'). Please " % getUnicode(ex) + errMsg += "system's temporary directory location(s) ('%s'). Please " % ex.message errMsg += "make sure that there is enough disk space left. If problem persists, " errMsg += "try to set environment variable 'TEMP' to a location " errMsg += "writeable by the current user" diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index ef2f535f7..154c5d7e3 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -862,7 +862,7 @@ def cmdLineParser(): for arg in shlex.split(command): argv.append(getUnicode(arg, encoding=sys.stdin.encoding)) except ValueError, ex: - raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % getUnicode(ex) + raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % ex.message # Hide non-basic options in basic help case for i in xrange(len(argv)): diff --git a/lib/parse/configfile.py b/lib/parse/configfile.py index 653faefbc..507cce17b 100644 --- a/lib/parse/configfile.py +++ b/lib/parse/configfile.py @@ -73,7 +73,7 @@ def configFileParser(configFile): config = UnicodeRawConfigParser() config.readfp(configFP) except Exception, ex: - errMsg = "you have provided an invalid and/or unreadable configuration file ('%s')" % getUnicode(ex) + errMsg = "you have provided an invalid and/or unreadable configuration file ('%s')" % ex.message raise SqlmapSyntaxException(errMsg) if not config.has_section("Target"): diff --git a/lib/utils/hash.py b/lib/utils/hash.py index b1459b032..69994d23e 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -770,7 +770,7 @@ def dictionaryAttack(attack_dict): except Exception, ex: warnMsg = "there was a problem while loading dictionaries" - warnMsg += " ('%s')" % getUnicode(ex) + warnMsg += " ('%s')" % ex.message logger.critical(warnMsg) message = "do you want to use common password suffixes? (slow!) [y/N] " diff --git a/plugins/generic/entries.py b/plugins/generic/entries.py index 598bf3a01..125aa8226 100644 --- a/plugins/generic/entries.py +++ b/plugins/generic/entries.py @@ -341,13 +341,13 @@ class Entries: attackDumpedTable() except (IOError, OSError), ex: errMsg = "an error occurred while attacking " - errMsg += "table dump ('%s')" % getUnicode(ex) + errMsg += "table dump ('%s')" % ex.message logger.critical(errMsg) conf.dumper.dbTableValues(kb.data.dumpedTable) except SqlmapConnectionException, ex: errMsg = "connection exception detected in dumping phase " - errMsg += "('%s')" % getUnicode(ex) + errMsg += "('%s')" % ex.message logger.critical(errMsg) finally: