command-not-found crashed with NameError in __main__: name 'sys' is not defined

Bug #864461 reported by knorr on 2011-10-02
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Medium
Unassigned

Bug Description

got mistaken in name of command "top" in terminal: type tp instead, command-not-found crashes

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: command-not-found 0.2.44ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-12.19-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu2
Architecture: i386
Date: Sun Oct 2 13:46:58 2011
ExecutablePath: /usr/lib/command-not-found
InstallationMedia: Lubuntu 10.10 "Maverick Meerkat" - i386 (20101010)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/lib/command-not-found -- tp
ProcEnviron:
 SHELL=/bin/bash
 LANG=ru_RU.UTF-8
PythonArgs: ['/usr/lib/command-not-found', '--', 'tp']
SourcePackage: command-not-found
Title: command-not-found crashed with NameError in __main__: name 'sys' is not defined
Traceback:
 Traceback (most recent call last):
   File "/usr/lib/command-not-found", line 20, in <module>
     sys.exit(127)
 NameError: name 'sys' is not defined
UpgradeStatus: Upgraded to oneiric on 2011-09-11 (21 days ago)
UserGroups: adm admin cdrom dialout dip fuse lpadmin plugdev sambashare

knorr (a-sokolov) wrote :
tags: removed: need-duplicate-check
Colin Watson (cjwatson) wrote :

This is a race condition; it happens if you manage to interrupt command-not-found before it's managed to import sys.

Perhaps the exception handler should import sys again?

Changed in command-not-found (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
visibility: private → public
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package command-not-found - 0.2.46ubuntu6

---------------
command-not-found (0.2.46ubuntu6) precise; urgency=low

  * Import sys again in command-not-found's KeyboardInterrupt handler
    (LP: #864461).
  * Forcibly remove /usr/lib from the start of sys.path to avoid unsightly
    ImportWarning noise (LP: #983875).
  * Update scan.data to current precise.
 -- Colin Watson <email address hidden> Tue, 17 Apr 2012 12:35:51 +0100

Changed in command-not-found (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers