Repository navigation
Open
pyreadline3/pyreadline3
#6Description
When using pyreadline as readline with rlcompleter on Windows 10 and Python 3.5 I get this error when pressing tab.
>>> Readline internal error
Traceback (most recent call last):
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\console\console.py", line 768, in hook_wrapper_23
res = ensure_str(readline_hook(prompt))
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\rlmain.py", line 571, in readline
self._readline_from_keyboard()
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\rlmain.py", line 536, in _readline_from_keyboard
if self._readline_from_keyboard_poll():
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\rlmain.py", line 556, in _readline_from_keyboard_poll
result = self.mode.process_keyevent(event.keyinfo)
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\modes\emacs.py", line 243, in process_keyevent
r = self.process_keyevent_queue[-1](keyinfo)
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\modes\emacs.py", line 286, in _process_keyevent
r = dispatch_func(keyinfo)
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\modes\basemode.py", line 257, in complete
completions = self._get_completions()
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\modes\basemode.py", line 200, in _get_completions
r = self.completer(ensure_unicode(text), i)
File "C:\Users\dbrattli\AppData\Local\Programs\Python\Python35-32\lib\rlcompleter.py", line 80, in complete
readline.redisplay()
AttributeError: module 'readline' has no attribute 'redisplay'
Reacted by Eric Wieser, Dan Rose, yar999, Greg, Yang Yang, hiepnguyen034, e_yi, pjxiao, Idan Pazi, m666m and 6 more
Reacted by erik, Brett Moan, Mark and ZheruQiu
Reacted by Andrea
Metadata
Metadata
Assignees
Labels
No labels
Activity
Implement readline.redisplay(), fixing pyreadline#49
eric-wieser commentedon Jan 6, 2017
Fixed in #51
robertquitt commentedon Jan 7, 2017
I tried #51, it fixes the AttributeError but pressing tab with an empty line does not have the desired effect. I am using Windows 10 64-bit with Python 3.5.2 on cmd.exe. I am not sure whether this is an issue with cmd.exe or an issue with pyreadline.
The following was the result of pressing the keys t, tab, backspace, tab, tab, tab
eric-wieser commentedon Jan 7, 2017
Hmm, that does look wrong.
Were you using this repo before, or the pypi version? Unfortunately, the two are not in sync, with master being out of date.
I don't think there's much point me spending much time of this patch, since it seems like this is abandonwsre
ankostis commentedon May 6, 2017
FYI, in WinPython-3.6 the #51 did not prevent the exception raised.
Have pushed 2 commits that fix this.
yemreak commentedon Sep 7, 2019
The temporary solution is there:
https://stackoverflow.com/a/57834015/9770490
skywind3000 commentedon Jan 25, 2021
Another workaround:
fix(PY36,pyreadline#1): PY36 missed `redisplay()` unless in __ALL__ >
fix(PY36,pyreadline#1): PY36 missed `redisplay()` unless in __ALL__ >
fix(PY36,pyreadline3#1): PY36 missed `redisplay()` unless in __ALL__ >
Implement readline.redisplay(), fixing pyreadline#49