[pypy-issue] [issue1574] [PyPy3] Typing Unicode characters in interactive interpreter causes crash

Star Brilliant tracker at bugs.pypy.org
Fri Aug 2 12:54:51 CEST 2013


New submission from Star Brilliant <m13253 at hotmail.com>:

When I type the following code into the interactive interpreter, PyPy3 crashes.

>>>> import math
>>>> print('π=%.15f' % math.pi)
Traceback (most recent call last):
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/_pypy_interact.py", line 44, in 
interactive_console
    run_multiline_interactive_console(mainmodule)
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/simple_interact.py", line 62, 
in run_multiline_interactive_console
    returns_unicode=True)
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/readline.py", line 216, in 
multiline_input
    return reader.readline(returns_unicode=returns_unicode)
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 605, in 
readline
    self.handle1()
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 588, in 
handle1
    self.do_cmd(cmd)
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 540, in 
do_cmd
    self.refresh()
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 521, in 
refresh
    screen = self.calc_screen()
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/completing_reader.py", line 
230, in calc_screen
    screen = super(CompletingReader, self).calc_screen()
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 292, in 
calc_screen
    l, l2 = disp_str(line)
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 78, in 
disp_str
    s = [uc(x) for x in buffer]
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 78, in 
<listcomp>
    s = [uc(x) for x in buffer]
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 61, in 
_my_unctrl
    return uc(ord(c))
  File "/home/brilliant/pypy3-2.1-beta1-linux64/lib_pypy/pyrepl/reader.py", line 53, in 
_my_unctrl
    if unicodedata.category(c).startswith('C'):
TypeError: argument 1 must be unicode

Note:
1. print('Café') will not crash.
2. Putting the code into a file and executing it with PyPy3 will not crash.

----------
messages: 6023
nosy: m13253, pypy-issue
priority: bug
release: 2.1
status: unread
title: [PyPy3] Typing Unicode characters in interactive interpreter causes crash

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1574>
________________________________________


More information about the pypy-issue mailing list