Skip to content

Zenmap "import os" crash in Nmap 7.90 Profile editor #2148

Description

@fyodor

When profile editor is used in Zenmap 7.90 (multiplatform), Zenmap tends to crash with a traceback like:

Version: 7.90
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/zenmapGUI/ScriptInterface.py",
line 261, in script_list_timer_callback
callback(True, process)
File "/usr/lib/python2.6/site-packages/zenmapGUI/ScriptInterface.py",
line 270, in initial_script_list_cb
if status and self.handle_initial_script_list_output(process):
File "/usr/lib/python2.6/site-packages/zenmapGUI/ScriptInterface.py",
line 307, in handle_initial_script_list_output
basename = os.path.basename(filename)
NameError: global name 'os' is not defined

This was actually caused by "improvements" we made as part of our recent LGTM code quality efforts. We removed a bunch of "from X import *" statements for various libraries because those can pollute the namespace by importing way more than intended. But it turns out we were relying on one of those secondary imports then importing "os" itself. So we should fix this and also try to make sure there aren't other cases of this problem that we missed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions