crashes on bashrc reload

Bug #1701552 reported by ThorX89
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found
New
Undecided
Unassigned

Bug Description

With the following .bashrc:

 [ -z "$bx_has__bashrc" ] || return
 bx_has__bashrc=1
 echo >&2 '. BASHRC'
 bind -x $'"\C-e": bx_bashrc_edit;'

 bx_bashrc_edit()
 {
 #set -x
 vim +'set ft=sh' "$HOME/.bashrc" && unset -v bx_has__bashrc && builtin . "$HOME/.bashrc";
 #set +x
  }

I get
 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.4.3 final 0
 Distributor ID: LinuxMint
 Description: Linux Mint 17.3 Rosa
 Release: 17.3
 Codename: rosa
 Exception information:

 'utf-8' codec can't encode character '\udccf' in position 0: surrogates not allowed
 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 90, in main
  if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
   File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 265, in advise
  packages = self.getPackages(command)
   File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 157, in getPackages
  result.update([(pkg, db.component) for pkg in db.lookup(command)])
   File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 85, in lookup
  result = self.db.lookup(command)
   File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 41, in lookup
  key = key.encode('utf-8')
 UnicodeEncodeError: 'utf-8' codec can't encode character '\udccf' in position 0: surrogates not allowed

whenever .bashrc is reloaded with Ctrl-E. Uncommenting the set `set -x` and `set +x` cause the
error text to no longer appear.

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.