pypy3.5 traceback when hitting backspace in repl

Issue #2718 resolved
Miro Hrončok
created an issue

In interactive prompt, when I remove a character via backspace, a traceback is scattered all around my terminal with the following:

Traceback (most recent call last):
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/reader.py", line 620, in readline
    self.handle1()
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/reader.py", line 603, in handle1
    self.do_cmd(cmd)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/reader.py", line 555, in do_cmd
    self.refresh()
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/reader.py", line 537, in refresh
    self.console.refresh(screen, self.cxy)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 245, in refresh
    self.move_cursor(cx, cy)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 355, in move_cursor
    self.flushoutput()
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 479, in flushoutput
    self.__tputs(text)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 503, in __tputs
    if '*' in m.group(2):
TypeError: 'str' does not support the buffer interface

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/pypy3-5.10.0/lib_pypy/_pypy_interact.py", line 32, in interactive_console
    run_interactive(mainmodule)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/simple_interact.py", line 73, in run_multiline_interactive_console
    returns_unicode=True)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/readline.py", line 275, in multiline_input
    return reader.readline(returns_unicode=returns_unicode)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/reader.py", line 625, in readline
    self.restore()
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/reader.py", line 518, in restore
    self.console.restore()
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 392, in restore
    self.flushoutput()
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 479, in flushoutput
    self.__tputs(text)
  File "/usr/lib/pypy3-5.10.0/lib_pypy/pyrepl/unix_console.py", line 503, in __tputs
   if '*' in m.group(2):
TypeError: 'str' does not support the buffer interface

Note that this only happens with a minimal setup in Fedora's build environment. where the tty is somehow limited and I cannot reproduce this on my normal environment.

Adding b into if b'*' in m.group(2) fixes the problem, will try to send a PR, but Bitbucket keeps saying it is forking the repo forever.

Comments (3)

  1. Miro Hrončok reporter

    Reproducer on Fedora:

    1. install pypy3 to mock: $ mock -r fedora-rawhide-x86_64 --install pypy3
    2. go into mock's shell: $ mock -r fedora-rawhide-x86_64 --shell
    3. run pypy3: <mock-chroot> sh-4.4# pypy3
    4. type letters: asdfgh
    5. hit Backspace
  2. Log in to comment