[pypy-issue] [issue1513] Curses crash: TypeError: initializer for ctype 'char *' must be a str or list or tuple, not unicode

Julian Berman tracker at bugs.pypy.org
Mon Jun 10 01:17:55 CEST 2013


New submission from Julian Berman <Julian+PyPy at GrayVines.com>:

Python 2.7.3 (5acfe049a5b0, May 21 2013, 13:47:22)
[PyPy 2.0.2 with GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]

Getting the following traceback with a curses app (bpython):

⊙  bpython -i wsgi.py                                                                                                                                                  
Julian at air
Traceback (most recent call last):
  File "app_main.py", line 72, in run_toplevel
  File "/Users/Julian/.local/share/virtualenvs/great/bin/bpython", line 9, in 
<module>
    load_entry_point('bpython==0.12', 'console_scripts', 'bpython')()
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 1918, in main
    banner=banner)
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 1815, in curses_wrapper
    return func(stdscr, *args, **kwargs)
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 1888, in main_curses
    exit_value = clirepl.repl()
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 1116, in repl
    inp = self.get_line()
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 673, in get_line
    if self.p_key(key) is None:
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 1011, in p_key
    self.addstr(key)
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 348, in addstr
    self.complete()
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 448, in complete
    self.show_list(self.matches, self.argspec)
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 1271, in show_list
    height_offset = self.mkargspec(topline, down) + 1
  File "/Users/Julian/.local/share/virtualenvs/great/site-
packages/bpython/cli.py", line 722, in mkargspec
    get_colpair(self.config, 'name') | curses.A_BOLD)
  File "/usr/local/Cellar/pypy/2.0.2/lib_pypy/_curses.py", line 509, in _wrapped
    return func(self, *outargs)
  File "/usr/local/Cellar/pypy/2.0.2/lib_pypy/_curses.py", line 598, in addstr
    code = lib.waddstr(self._win, text)
TypeError: initializer for ctype 'char *' must be a str or list or tuple, not 
unicode

Don't have time to investigate further at this exact moment, so apologies, but the 
quickest way to reproduce is:

$ mktmpenv --python=pypy
$ pip install bpython flask
$ bpython
>>> import flask
>>> flask.Flask

and then hit (, which will trigger bpython's tooltip for docstrings and along with 
it that traceback.

If I get some time to dig I'll update with more details, though I bet this means 
enough to let you guys know what's up already if you're familiar with the curses 
integration code.

----------
messages: 5842
nosy: Julian, pypy-issue
priority: bug
release: 2.0
status: unread
title: Curses crash: TypeError: initializer for ctype 'char *' must be a str or list or tuple, not unicode

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


More information about the pypy-issue mailing list