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.

classification
Title: curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'
Type: Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Anthony Sottile, 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 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
curses_bug.py theosp, 2010-03-27 05:01 bug's example
Pull Requests
URL Status Linked Edit
PR 5179 merged jcrotts, 2018-01-14 03:52
PR 6404 merged miss-islington, 2018-04-07 01:28
PR 6405 merged miss-islington, 2018-04-07 01:29
PR 6406 merged miss-islington, 2018-04-07 01:30
Messages (15)
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.
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.
msg315049 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-07 01:27
New changeset ef5ce884a41c8553a7eff66ebace908c1dcc1f89 by Ned Deily (Jay Crotts) in branch 'master':
bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179)
https://github.com/python/cpython/commit/ef5ce884a41c8553a7eff66ebace908c1dcc1f89
msg315055 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-07 02:00
New changeset 98e8ac8d82202aae32961f10b1014641ae1fffbf by Ned Deily (Miss Islington (bot)) in branch '3.7':
[3.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6404)
https://github.com/python/cpython/commit/98e8ac8d82202aae32961f10b1014641ae1fffbf
msg315056 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-07 02:01
New changeset 70c44465475c41ab3aa832858b250ede6f170aac by Ned Deily (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6406)
https://github.com/python/cpython/commit/70c44465475c41ab3aa832858b250ede6f170aac
msg315057 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-07 02:01
New changeset 77f0a41d72886513f5e9277e5587455745c29ac1 by Ned Deily (Miss Islington (bot)) in branch '2.7':
[2.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6405)
https://github.com/python/cpython/commit/77f0a41d72886513f5e9277e5587455745c29ac1
msg315058 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-07 02:03
Thank you for producing the PR, Jay!
msg349572 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2019-08-13 15:37
In case it helps someone else, `insstr` seems to not have this limitation
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52490
2019-08-13 15:37:46Anthony Sottilesetnosy: + Anthony Sottile
messages: + msg349572
2018-04-07 02:03:45ned.deilysetstatus: open -> closed

components: - Extension Modules
versions: + Python 2.7, Python 3.6, Python 3.7
messages: + msg315058
type: enhancement ->
resolution: fixed
stage: patch review -> resolved
2018-04-07 02:01:37ned.deilysetmessages: + msg315057
2018-04-07 02:01:05ned.deilysetmessages: + msg315056
2018-04-07 02:00:09ned.deilysetmessages: + msg315055
2018-04-07 01:30:18miss-islingtonsetpull_requests: + pull_request6111
2018-04-07 01:29:19miss-islingtonsetpull_requests: + pull_request6110
2018-04-07 01:28:24miss-islingtonsetpull_requests: + pull_request6109
2018-04-07 01:27:12ned.deilysetmessages: + msg315049
2018-03-01 02:19:37jcrottssetversions: + Python 3.8, - Python 2.7, Python 3.6, Python 3.7
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