← Winnitude! Search  ·  Reader Mode (813 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 10 LINKS

bpython crashes trying to print large object · Issue #1020 · bpython/bpython

Repository navigation

bpython crashes trying to print large object  #1020


New issue

New issue

Closed

Closed
bpython crashes trying to print large object #1020 Labels
bug

duplicate

Description

@vshesh's profile vshesh opened on Jun 14, 2024

Hi,

Long time user of bpython, first time I got an error:


Traceback (most recent call last):
  File "/usr/local/bin/bpython", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bpython/curtsies.py", line 248, in main
    repl.mainloop(True, paste)
  File "/usr/local/lib/python3.12/site-packages/bpython/curtsies.py", line 181, in mainloop
    self.process_event_and_paint(e)
  File "/usr/local/lib/python3.12/site-packages/bpython/curtsies.py", line 151, in process_event_and_paint
    array, cursor_pos = self.paint()
                        ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bpython/curtsiesfrontend/repl.py", line 1610, in paint
    current_line = paint.paint_current_line(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bpython/curtsiesfrontend/replpainter.py", line 50, in paint_current_line
    return fsarray(lines, width=columns)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/curtsies/formatstringarray.py", line 268, in fsarray
    raise ValueError(f"Those strings won't fit for width {width}")
ValueError: Those strings won't fit for width 101
Exception: bpython exited with 1
[tty 33], line 1: bpython

version information

$ bpython
bpython version 0.24 on top of Python 3.12.3 /usr/local/opt/python@3.12/bin/python3.12

I can json.dumps the large object, bpython will just crash on doing it itself though. I am guessing this is because it would take more than one whole screen to print out the object.
having bpython die during a session when this happens is quite annoying - can this be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels


    bug

    duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions