Nmap Development mailing list archives

Re: zenmap: problems with CLI options


From: David Fifield <david () bamsoftware com>
Date: Sun, 13 Dec 2009 14:51:13 -0700

On Mon, Dec 07, 2009 at 12:46:35PM +0100, Robert Premuž wrote:
I use zenmap 5.0 on MS Windows XP Pro. SP3.

http://nmap.org/book/zenmap-command-line.html says that zenmap has
some command line options but "zenmap -h" gives no output. The process
zenmap.exe starts but then immediately dies.

You are right. I found the reason for this. py2exe, which we use to make
the Windows executable, redirects sys.stdout into a sink object, so
nothing the program prints will be written to the screen. However they
have a good reason for this. Here is a comment from boot_common.py in
py2exe:

# The sys.stdout and sys.stderr that GUI programs get (from Windows) are
# more than useless.  This is not a py2exe problem, pythonw.exe behaves
# in the same way.
#
# To demonstrate, run this program with pythonw.exe:
#
# import sys
# sys.stderr = open("out.log", "w")
# for i in range(10000):
#     print i
#
# and open the 'out.log' file.  It contains this:
#
# Traceback (most recent call last):
#   File "out.py", line 6, in ?
#     print i
# IOError: [Errno 9] Bad file descriptor
#
# In other words, after printing a certain number of bytes to the
# system-supplied sys.stdout (or sys.stderr) an exception will be
# raised.

I don't know if there's anything we can do about this. I am open to
suggestions.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: