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

Created on 2010-03-27 05:01 by theosp, last changed 2014-05-24 12:10 by georg.brandl.

Files
File name Uploaded Description Edit
curses_bug.py theosp, 2010-03-27 05:01 bug's example
Messages (6)
msg174908 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-11-05 13:24
AutoBump™.
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 <report@bugs.python.org> 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 <report@bugs.python.org>
> <http://bugs.python.org/issue8243>
> _______________________________________
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.
History
Date User Action Args
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