This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author a.badger
Recipients Josiah Ulfers, a.badger, lisroach, twouters
Date 2019-05-08.15:53:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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[:]
        for offset, line in enumerate(box.splitlines()):
            w.addstr(offset, 0, line) 
        w.getch()  # not required, just avoids a hot loop


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.
Date User Action Args
2019-05-08 15:53:50a.badgersetrecipients: + a.badger, twouters, lisroach, Josiah Ulfers
2019-05-08 15:53:50a.badgersetmessageid: <>
2019-05-08 15:53:50a.badgerlinkissue35924 messages
2019-05-08 15:53:50a.badgercreate