mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Avoid encoding errors in exception handler. See #1839
This commit is contained in:
@@ -551,7 +551,7 @@ class ScanInterface(HIGVBox):
|
|||||||
try:
|
try:
|
||||||
command_execution.run_scan()
|
command_execution.run_scan()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
text = unicode(e)
|
text = unicode(e.message, errors='replace')
|
||||||
if isinstance(e, OSError):
|
if isinstance(e, OSError):
|
||||||
# Handle ENOENT specially.
|
# Handle ENOENT specially.
|
||||||
if e.errno == errno.ENOENT:
|
if e.errno == errno.ENOENT:
|
||||||
@@ -578,6 +578,8 @@ class ScanInterface(HIGVBox):
|
|||||||
else:
|
else:
|
||||||
text += u"\n\n" + _("plus the extra directories")
|
text += u"\n\n" + _("plus the extra directories")
|
||||||
text += u"\n\n" + os.pathsep.join(extra_paths)
|
text += u"\n\n" + os.pathsep.join(extra_paths)
|
||||||
|
else:
|
||||||
|
text += u" (%d)" % e.errno
|
||||||
warn_dialog = HIGAlertDialog(
|
warn_dialog = HIGAlertDialog(
|
||||||
message_format=_("Error executing command"),
|
message_format=_("Error executing command"),
|
||||||
secondary_text=text, type=gtk.MESSAGE_ERROR)
|
secondary_text=text, type=gtk.MESSAGE_ERROR)
|
||||||
|
|||||||
Reference in New Issue
Block a user