1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 05:31:31 +00:00

Ignore a GError from printing.

This strange error happens when canceling a "Print to File" operation on
Windows:

Traceback (most recent call last):
  File "zenmapGUI\MainWindow.pyo", line 831, in _print_cb
  File "zenmapGUI\Print.pyo", line 156, in run_print_operation
GError: Error from StartDoc

The web seems mostly silent on this error, and I can't guess at the
cause. Let's ignore the error as it seems to be harmless.

Reported by Imre Adácsi.
http://seclists.org/nmap-dev/2012/q4/161
This commit is contained in:
david
2012-11-22 04:39:32 +00:00
parent 06c190da84
commit aa25518d95
2 changed files with 16 additions and 1 deletions

View File

@@ -1,5 +1,13 @@
# Nmap Changelog ($Id$); -*-text-*- # Nmap Changelog ($Id$); -*-text-*-
o [Zenmap] Removed a crashing error that could happen when canceling a
"Print to File" on Windows:
Traceback (most recent call last):
File "zenmapGUI\MainWindow.pyo", line 831, in _print_cb
File "zenmapGUI\Print.pyo", line 156, in run_print_operation
GError: Error from StartDoc
This bug was reported by Imre Adácsi. [David Fifield]
o [NSE] Added new fingerprints for http-enum: Sitecore, Moodle, typo3, o [NSE] Added new fingerprints for http-enum: Sitecore, Moodle, typo3,
SquirrelMail, RoundCube. [Jesper Kückelhahn] SquirrelMail, RoundCube. [Jesper Kückelhahn]

View File

@@ -103,6 +103,7 @@
# else. This might go in a separate Print Setup dialog. # else. This might go in a separate Print Setup dialog.
import gtk import gtk
import gobject
import pango import pango
MONOSPACE_FONT_DESC = pango.FontDescription("Monospace 12") MONOSPACE_FONT_DESC = pango.FontDescription("Monospace 12")
@@ -153,4 +154,10 @@ def run_print_operation(inventory, entry):
state = PrintState(inventory, entry) state = PrintState(inventory, entry)
op.connect("begin-print", state.begin_print) op.connect("begin-print", state.begin_print)
op.connect("draw-page", state.draw_page) op.connect("draw-page", state.draw_page)
op.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, None) try:
op.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, None)
except gobject.GError:
# Canceling the print operation can result in the error
# GError: Error from StartDoc
# http://seclists.org/nmap-dev/2012/q4/161
pass