python imported wrong file

Bug #1077999 reported by b49P23TIvg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
New
Undecided
Unassigned

Bug Description

Someone asked me to modify keepnote. I unpacked the gz file, changed directory to the top level keepnote directory created by tar, then checked to see if keepnote is installed on my system with the command
keepnote.
Keepnote happens to be written in python2 and there are a bunch of python files in the directory I described. keepnote is not installed on my system. Command-not-found imported a file from the local directory and failed. Command-not-found clearly won't work with every python2 file, and shouldn't load files from the local directory anyway. I suppose this problem might be pervasive.

$ keepnote
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
Exception information:

invalid syntax (tarfile.py, line 61)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 86, in main
    cnf = CommandNotFound(options.data_dir)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 130, in __init__
    self.sources_list = self._getSourcesList()
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 170, in _getSourcesList
    from aptsources.sourceslist import SourcesList
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 32, in <module>
    import shutil
  File "/usr/lib/python3.2/shutil.py", line 14, in <module>
    import tarfile
  File "/tmp/keepnote-0.7.8/keepnote/tarfile.py", line 61
    raise ImportError, "tarfile does not work for platform==mac"
                     ^
SyntaxError: invalid syntax

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: command-not-found 0.3ubuntu5
ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
Uname: Linux 3.5.0-18-generic x86_64
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
Date: Mon Nov 12 10:59:25 2012
InstallationDate: Installed on 2010-12-03 (709 days ago)
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=dumb
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: command-not-found
UpgradeStatus: Upgraded to quantal on 2012-10-23 (19 days ago)

Revision history for this message
b49P23TIvg (b49p23tivg) wrote :
Revision history for this message
b49P23TIvg (b49p23tivg) wrote :

/tmp/keepnote-0.7.8/keepnote

The directory was as above, not as I stated.

Debra Virden (teddydlv)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.