Title: curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'
Type: enhancement Stage: patch review
Components: Documentation, Extension Modules Versions: Python 3.7, Python 3.6, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Charles.Merriam, CharlesMerriam, Ramchandra Apte, docs@python, georg.brandl, jcrotts, ned.deily, theosp
Priority: normal Keywords: easy, patch

Created on 2010-03-27 05:01 by theosp, last changed 2018-01-16 19:52 by jcrotts.

File name Uploaded Description Edit theosp, 2010-03-27 05:01 bug's example
Pull Requests
URL Status Linked Edit
PR 5179 open jcrotts, 2018-01-14 03:52
Messages (9)
msg174908 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-11-05 13:24
msg218985 - (view) Author: Charles Merriam (Charles.Merriam) Date: 2014-05-23 18:42
Some more information to just nail this thing that's been here forever.

1.  This has been an issue in Python since at least 2001.
2.  It is a duplicate of the item 441129 which was closed as won't fix.
3.  It is bug in curses implementations.
4.  This occurs whenever the lower-right character of a screen or window is written.  The writing, via addch() or addstr(), causes the cursor to advance outside the window and triggers the error.  It triggers the same error as attempting to write beyond the edge of the screen, window, or pad.   
5.  This occurs with the main windows, sub windows, and pads.
6.  There are two work-arounds for users:
    a.   Don't do that.  Make your window bigger.
    b.   Catch and ignore the error.  The library does the right thing but 
    is trying to be too smart about raising errors.
7.  There are two good resolutions to the problem:
    a.  Document it.  Add a note to addch() and addstr() to the effect:
        "Writing outside the pad, window, or subwindow will cause a curses.error Exception.  Also, attempting to write the lower right corner of a pad, window, or sub window will cause an exception to be raised after the character is printed.  You may safely ignore the error in this case."
    b.  Document it as above and add an example.
    c.  Wrap it so it works on Python if no other curses implementation.  Many long discussions can be arguments before agreeing why this a bad idea.
This is an annoying, obscure bug that deserves a couple lines in the documentation.  If you need sample code, I can provide.
msg218991 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-05-23 19:32
FTR, the previous issue is Issue441429.  A documentation patch would be welcomed.
msg218996 - (view) Author: Charles Merriam (CharlesMerriam) Date: 2014-05-23 21:00
My typo.  Documentation verbiage was included in the bug report.
Submitting a patch to the documentation is a harder than just
rewriting the library.  I speak English, MarkDown, HTML, JavaScript,
and even RST.  I don't speak Sphinx, DocBook, or TeX.

On Fri, May 23, 2014 at 12:32 PM, Ned Deily <> wrote:
> Ned Deily added the comment:
> FTR, the previous issue is Issue441429.  A documentation patch would be welcomed.
> ----------
> assignee:  -> docs@python
> components: +Documentation
> keywords: +easy
> nosy: +docs@python, ned.deily
> stage:  -> needs patch
> versions: +Python 3.5 -Python 3.2, Python 3.3
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
msg219035 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-05-24 12:10
Knowledge of RST should be more than enough; there is not much Sphinx-specific markup, and even that you won't pick up easily while looking at the file.
msg219036 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-05-24 12:10
you WILL pick up, of course.
msg272058 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-08-05 20:32
See also Issue27693 which documents a similar issue using curses.textpad.
msg309535 - (view) Author: Jay Crotts (jcrotts) * Date: 2018-01-06 03:14
I can create a documentation patch and PR if this still needs doing.
msg310106 - (view) Author: Jay Crotts (jcrotts) * Date: 2018-01-16 19:52
Submitted a PR for this issue, awaiting review.
Date User Action Args
2018-01-16 19:52:58jcrottssetmessages: + msg310106
2018-01-14 03:52:39jcrottssetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request5031
2018-01-06 03:14:33jcrottssetnosy: + jcrotts
messages: + msg309535
2017-11-01 17:31:00serhiy.storchakasettype: behavior -> enhancement
versions: + Python 3.6, Python 3.7, - Python 3.4, Python 3.5
2016-08-05 20:32:27ned.deilysetmessages: + msg272058
2014-05-24 12:10:27georg.brandlsetmessages: + msg219036
2014-05-24 12:10:16georg.brandlsetnosy: + georg.brandl
messages: + msg219035
2014-05-23 21:00:07CharlesMerriamsetnosy: + CharlesMerriam
messages: + msg218996
2014-05-23 19:32:13ned.deilysetassignee: docs@python
components: + Documentation
versions: + Python 3.5, - Python 3.2, Python 3.3
keywords: + easy
nosy: + ned.deily, docs@python

messages: + msg218991
stage: needs patch
2014-05-23 18:42:13Charles.Merriamsetnosy: + Charles.Merriam
messages: + msg218985
2012-11-05 14:10:04serhiy.storchakasetcomponents: + Extension Modules, - Library (Lib)
versions: + Python 2.7, Python 3.2, Python 3.3, Python 3.4, - Python 2.6
2012-11-05 13:24:49Ramchandra Aptesetcomponents: + Library (Lib)
2012-11-05 13:24:40Ramchandra Aptesetnosy: + Ramchandra Apte
messages: + msg174908
2010-03-27 05:01:07theospcreate