1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Avoid encoding errors in exception handler. See #1839

This commit is contained in:
dmiller
2019-12-10 20:51:56 +00:00
parent 112fc96c50
commit ff61845ce2

View File

@@ -551,7 +551,7 @@ class ScanInterface(HIGVBox):
try:
command_execution.run_scan()
except Exception, e:
text = unicode(e)
text = unicode(e.message, errors='replace')
if isinstance(e, OSError):
# Handle ENOENT specially.
if e.errno == errno.ENOENT:
@@ -578,6 +578,8 @@ class ScanInterface(HIGVBox):
else:
text += u"\n\n" + _("plus the extra directories")
text += u"\n\n" + os.pathsep.join(extra_paths)
else:
text += u" (%d)" % e.errno
warn_dialog = HIGAlertDialog(
message_format=_("Error executing command"),
secondary_text=text, type=gtk.MESSAGE_ERROR)