Skip to content

Crash on find source of empty line in Python 3 #443

@thomasballinger

Description

@thomasballinger

Hitting "find source" (F2 by default) on an empty line in Python 3 causes a crash:

tom-mba:scratch tomb$ bpython3
bpython version 0.13-363 on top of Python 3.3.3 /usr/local/opt/python3/bin/python3.3
>>>
Traceback (most recent call last):
  File "/usr/local/bin/bpython3", line 9, in <module>
    load_entry_point('bpython==0.13-363', 'console_scripts', 'bpython')()
  File "/usr/local/lib/python3.3/site-packages/bpython/curtsies.py", line 69, in main
    mainloop(config, locals_, banner, interp, paste, interactive=(not exec_args))
  File "/usr/local/lib/python3.3/site-packages/bpython/curtsies.py", line 144, in mainloop
    process_event(e)
  File "/usr/local/lib/python3.3/site-packages/bpython/curtsies.py", line 133, in process_event
    array, cursor_pos = repl.paint()
  File "/usr/local/lib/python3.3/site-packages/bpython/curtsiesfrontend/repl.py", line 1150, in paint
    arr[statusbar_row, :] = paint.paint_statusbar(1, width, self.status_bar.current_line, self.config)
  File "/usr/local/lib/python3.3/site-packages/bpython/curtsiesfrontend/replpainter.py", line 176, in paint_statusbar
    return fsarray([func_for_letter(config.color_scheme['main'])(msg.ljust(columns))[:columns]])
AttributeError: 'SourceNotFound' object has no attribute 'ljust'
tom-mba:scratch tomb$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions