Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix list index out of range in forward search #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

4179e1
Copy link

@4179e1 4179e1 commented Jul 5, 2023

The "IndexError: list index out of range" error can be easily reproduced in pythoni

  1. press ctrl + s to enter forward search
  2. press any key, and the error will appear
$ python3 pythoni
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(f-search `') Traceback (most recent call last):
  File "/home/yonl/pyrepl/pythoni", line 36, in <module>
    main(use_pygame_console=('pg' in sys.argv))
  File "/home/yonl/pyrepl/pyrepl/python_reader.py", line 403, in main
    getattr(rc, interactmethod)()
  File "/home/yonl/pyrepl/pyrepl/python_reader.py", line 207, in interact
    l = unicode(self.reader.readline(), 'utf-8')
  File "/home/yonl/pyrepl/pyrepl/reader.py", line 605, in readline
    self.handle1()
  File "/home/yonl/pyrepl/pyrepl/reader.py", line 588, in handle1
    self.do_cmd(cmd)
  File "/home/yonl/pyrepl/pyrepl/reader.py", line 535, in do_cmd
    cmd.do()
  File "/home/yonl/pyrepl/pyrepl/historical_reader.py", line 143, in do
    r.isearch_next()
  File "/home/yonl/pyrepl/pyrepl/historical_reader.py", line 285, in isearch_next
    s = self.get_item(i)
  File "/home/yonl/pyrepl/pyrepl/historical_reader.py", line 235, in get_item
    return self.transient_history.get(i, self.history[i])
IndexError: list index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant