Still prints to stdout if problem is with PATH

Bug #212723 reported by era
2
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: command-not-found

Bug #129257 fixes the general case of printing error messages to standard output, but the code which deals with an incorrect PATH still prints to standard output.

vnix$ PATH=/sbin:/bin:/usr/games

vnix$ lesspipe
Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
bash: lesspipe: command not found

vnix$ lesspipe >/dev/null
bash: lesspipe: command not found

vnix$ lesspipe 2>/dev/null
Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.

vnix$ /usr/lib/command-not-found --version
0.2

vnix$ dpkg -l command-not-found
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii command-not-fo 0.2.8ubuntu2 Suggest installation of packages in interact

vnix$ $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"

Revision history for this message
era (era) wrote :

Here's a quick and somewhat untidy (sorry) patch which attempts to fix the printing of the PATH message to standard error instead of standard output, and also the "kaboom" message in /usr/lib/command-not-found

Revision history for this message
era (era) wrote :

It needs to be said that I am no Python programmer, and am unsure how I would test this. The diff as such is trivial, and should not take many seconds to clean up or reimplement properly.

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks! I cleaned it up a little and committed it to bzr for the next upload.

Changed in command-not-found:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package command-not-found - 0.2.25ubuntu2

---------------
command-not-found (0.2.25ubuntu2) intrepid; urgency=low

  [ Era Eriksson ]
  * Print where-to-find-command, incorrect-PATH, and crash-guard messages to
    stderr rather than stdout (LP: #212723).

  [ Colin Watson ]
  * Fix various crash bugs in the crash handler (LP: #269821).
  * Adjust crash handler syntax to be friendly to Python 2.4 (LP: #234540).

 -- Colin Watson <email address hidden> Wed, 15 Oct 2008 13:27:20 +0100

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.