Control: tag -1 +moreinfo On Wed, 2018-06-13 at 17:06 -0400, Matt Coleman wrote: > Error Output: > ================ > Traceback (most recent call last): > File "/usr/lib/python3/dist-packages/configshell_fb/shell.py", line > 893, in run_interactive > old_completer = readline.get_completer() > NameError: name 'readline' is not defined > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/usr/bin/targetcli", line 121, in <module> > main() > File "/usr/bin/targetcli", line 111, in main > shell.run_interactive() > File "/usr/lib/python3/dist-packages/configshell_fb/shell.py", line > 899, in run_interactive > readline.set_completer(old_completer) > NameError: name 'readline' is not defined > in /home/matt/reproduce/vendor/symfony/ in > /home/matt/reproduce/vendor/symfony/symfony/src/Symfony/Component/Pro > cess/Process.php on line 239
I think there may be something non-standard in your setup. Because: if sys.stdout.isatty(): import readline tty=True else: tty=False # remember the original setting oldTerm = os.environ.get('TERM') os.environ['TERM'] = '' import readline # restore the orignal TERM setting if oldTerm != None: os.environ['TERM'] = oldTerm del oldTerm In either case, readline needs to be imported. readline supported is provided through package libpython2.7-stdlib:amd64 for Python2. @Matt: Are you able to import the readline module on the standard python interpreter ? Here, on my setup, I can: $ ipython Python 2.7.15 (default, May 1 2018, 05:55:50) Type "copyright", "credits" or "license" for more information. IPython 5.5.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. [TerminalIPythonApp] WARNING | File not found: '/home/rrs/.pythonrc' In [1]: import readline In [2]: help(readline) In [3]: Do you really want to exit ([y]/n)? 10:17 ♒♒♒ ☺ 😄 -- Ritesh Raj Sarraf | http://people.debian.org/~rrs Debian - The Universal Operating System
signature.asc
Description: This is a digitally signed message part