Skip to content

Transpose with an empty line crashes bpython #548

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

Closed
Julian opened this issue Jul 1, 2015 · 1 comment
Closed

Transpose with an empty line crashes bpython #548

Julian opened this issue Jul 1, 2015 · 1 comment

Comments

@Julian
Copy link

Julian commented Jul 1, 2015

Minor edge case I think:

⊙  bpython                                                                                                                                                                                                                                                                                                                                                Julian@Macnetic
bpython version 0.15.dev155 on top of Python 2.7.10 /usr/local/opt/python/bin/python2.7
>>>
Traceback (most recent call last):
  File "/usr/local/bin/bpython", line 9, in <module>
    load_entry_point('bpython==0.15.dev155', 'console_scripts', 'bpython')()
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 88, in main
    interactive=(not exec_args))
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 189, in mainloop
    process_event(e)
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 147, in process_event
    repl.process_event(e)
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 524, in process_event
    return self.process_key_event(e)
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 626, in process_key_event
    cut_buffer=self.cut_buffer)
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/manual_readline.py", line 67, in call
    return func(**args)
  File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/manual_readline.py", line 286, in transpose_character_before_cursor
    line[cursor_offset - 1] +
IndexError: string index out of range

Also, I encountered this because I tried to send SIGINFO to bpython which is bound to ^T by default, and being overridden here for the readline stuff. Not sure if that's intentional as well, I don't know what OS X uses for readline transpose instead.

wevial added a commit to wevial/bpython that referenced this issue Aug 26, 2015
sebastinas added a commit that referenced this issue Aug 26, 2015
Fix bug #548 - Transpose when empty line crashes
@sebastinas
Copy link
Contributor

This should be fixed.

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

No branches or pull requests

2 participants