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

`AssertionError` when `print()`ing carriage return character · Issue #900 · bpython/bpython

Repository navigation

AssertionError when print()ing carriage return character  #900


New issue

New issue

Open
#1068
Open
AssertionError when print()ing carriage return character #900 #1068

Description

@hop's profile hop opened on Jun 15, 2021

The most succinct example I have found is this:

$ bpython
bpython version 0.21 on top of Python 3.9.4 /Users/hop/Library/PipXEnvs/venvs/bpython/bin/python
>>> print('', end='\r')

Traceback (most recent call last):
  File "/Users/hop/bin/bpython", line 8, in <module>
    sys.exit(main())
  File "/Users/hop/Library/PipXEnvs/venvs/bpython/lib/python3.9/site-packages/bpython/curtsies.py", line 201, in main
    exit_value = repl.mainloop(True, paste)
  File "/Users/hop/Library/PipXEnvs/venvs/bpython/lib/python3.9/site-packages/bpython/curtsies.py", line 121, in mainloop
    self.process_event_and_paint(e)
  File "/Users/hop/Library/PipXEnvs/venvs/bpython/lib/python3.9/site-packages/bpython/curtsies.py", line 95, in process_event_and_paint
    array, cursor_pos = self.paint()
  File "/Users/hop/Library/PipXEnvs/venvs/bpython/lib/python3.9/site-packages/bpython/curtsiesfrontend/repl.py", line 1610, in paint
    assert cursor_row >= 0 and cursor_column >= 0, (
AssertionError: (-1, 79, 5, 0, 0)

Another variation leading to a crash is print('\r', end='').

print('\r\n', end='') does not crash, while print('\n\r', end='') will.

Reacted by Ian Chamberlain and Mehedi Hasan

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