[Bug 1813124] [NEW] When using the bash source command command-not-found behaves as if it was interactive

Tom Rosenfeld 1813124 at bugs.launchpad.net
Thu Jan 24 07:38:38 UTC 2019


Public bug reported:

When using the bash "source" command from an interactive shell it is 
 1) very slow
 2) pressing Control-C repeatedly reports python errors like:
Failed to import the site module
Traceback (most recent call last):
  File "/usr/lib/python3.4/site.py", line 586, in <module>
    main()

This has been verified on Ubuntu 14 and 18.

This can be reproduced by sourcing a file with about 50 lines of a word which is not found.
For example:
  for i in $(seq 50); do echo lss ; done > bad.sh
  source ./bad.sh

output will show something like:
 No command 'lss' found, did you mean:
 Command 'ss' from package 'iproute2' (main)
 Command 'ls' from package 'coreutils' (main)
...

Additionally, if you try to press ^C repeatedly you will get the errors
from Python.

I would have expected the command-not-found to behave as if it was in a non interactive shell and not provide 
interactive feedback, and not slow down the execution by doing a search that significantly slows the executions.

Thanks,
-tom

** Affects: command-not-found (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to command-not-found in Ubuntu.
https://bugs.launchpad.net/bugs/1813124

Title:
  When using the bash source command command-not-found behaves as if it
  was interactive

Status in command-not-found package in Ubuntu:
  New

Bug description:
  When using the bash "source" command from an interactive shell it is 
   1) very slow
   2) pressing Control-C repeatedly reports python errors like:
  Failed to import the site module
  Traceback (most recent call last):
    File "/usr/lib/python3.4/site.py", line 586, in <module>
      main()

  This has been verified on Ubuntu 14 and 18.

  This can be reproduced by sourcing a file with about 50 lines of a word which is not found.
  For example:
    for i in $(seq 50); do echo lss ; done > bad.sh
    source ./bad.sh

  output will show something like:
   No command 'lss' found, did you mean:
   Command 'ss' from package 'iproute2' (main)
   Command 'ls' from package 'coreutils' (main)
  ...

  Additionally, if you try to press ^C repeatedly you will get the
  errors from Python.

  I would have expected the command-not-found to behave as if it was in a non interactive shell and not provide 
  interactive feedback, and not slow down the execution by doing a search that significantly slows the executions.

  Thanks,
  -tom

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/command-not-found/+bug/1813124/+subscriptions



More information about the foundations-bugs mailing list