command-not-found crashes when PATH is unset

Bug #258572 reported by jabbadoo
4
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Low
Michael Vogt

Bug Description

Binary package hint: command-not-found

This happens for all commands typed command' and then adding a ' on the next line. this happens of cource for the " too...

prompt$ ls'
> '
Command 'ls' is available in '/bin/ls'

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
'NoneType' object has no attribute 'split'
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 24, in <module>
    CommandNotFound(options.data_dir).advise(args[0])
  File "/usr/lib/python2.5/site-packages/CommandNotFound/CommandNotFound.py", line 115, in advise
    missing = list(set(prefixes) - set(os.getenv("PATH").split(":")))
AttributeError: 'NoneType' object has no attribute 'split'
Python version: 2.5.1 final 0
bash: ls
: command not found

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I have tried to reproduce your bug, but command-not-found does not crash. I have tested it with hardy and intrepid. Which version of Ubuntu do you use? Which version does command-not-found have?

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I confirm this on ubuntu.
Fixed branch is available at http://suxx.pl/~zyga/command-not-found--getenv-issues-fix/

Changed in command-not-found:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

sorry forgot to say: this was broken on hardy.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This can happen when you unset PATH. It's a pathological case but it's broken (and now fixed in the mentioned branch)

Changed in command-not-found:
assignee: nobody → mvo
Michael Vogt (mvo)
Changed in command-not-found:
status: Confirmed → Fix Committed
Revision history for this message
jabbadoo (jabbadoo) wrote : Re: [Bug 258572] Re: crash at quotation without space and newline

I use 7.10. Forgot to say, sorry. I don't understand what Zygmunt
Krynickimeans with reset PATH... I have not done anything like that,
but it seemed
so on the error... what ever, I have no idea...

On Sat, Aug 16, 2008 at 4:43 PM, Benjamin Drung <email address hidden>wrote:

> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. I have tried to reproduce your bug, but command-not-found
> does not crash. I have tested it with hardy and intrepid. Which version
> of Ubuntu do you use? Which version does command-not-found have?
>
> --
> crash at quotation without space and newline
> https://bugs.launchpad.net/bugs/258572
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package command-not-found - 0.2.23ubuntu1

---------------
command-not-found (0.2.23ubuntu1) intrepid; urgency=low

  [ Zygmunt Krynicki ]
  * fix crash when PATH is unset (LP: #258572)

  [ Michael Vogt ]
  * scan.data:
    - updated to current intrepid

 -- Michael Vogt <email address hidden> Wed, 20 Aug 2008 15:57:14 +0200

Changed in command-not-found:
status: Fix Committed → Fix Released
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.