Toshio Kuratomi <a.bad...@gmail.com> added the comment:

I've diagnosed this a bit further and have a workaround for you.  It appears 
that using addstr() with a string with embedded newlines is a piece of the 
problem.  If I modify your example program so that we add each line as a 
separate string instead of adding them as a single string with embedded 
newlines, we get the ncurses ERR on resize instead of a segfault:

import curses

def main(stdscr):
    y, x = curses.LINES//3, curses.COLS//3  # size is arbitrary
    box = '\n'.join('+'*x for _ in range(y))
    w = stdscr.subwin(y, x+1, y, x) 
    while True: 
        new_box = box[:]
        w.clear()
        for offset, line in enumerate(box.splitlines()):
            w.addstr(offset, 0, line) 
        w.getch()  # not required, just avoids a hot loop

curses.wrapper(main)


I don't see anything in the curses specification that forbids embedded newlines 
in the string to addstr(), though, so I am still thinking that this is a bug in 
ncurses.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35924>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to