Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' #52490

Closed
theosp mannequin opened this issue Mar 27, 2010 · 15 comments
Closed
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir easy

Comments

@theosp
Copy link
Mannequin

theosp mannequin commented Mar 27, 2010

BPO 8243
Nosy @birkenfeld, @ned-deily, @merriam, @asottile, @jcrotts
PRs
  • bpo-8243: Doc patch for curses.window.addstr and curses.window.addch #5179
  • [3.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) #6404
  • [2.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) #6405
  • [3.6] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) #6406
  • Files
  • curses_bug.py: bug's example
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-04-07.02:03:45.882>
    created_at = <Date 2010-03-27.05:01:07.251>
    labels = ['easy', '3.7', '3.8', 'docs']
    title = "curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'"
    updated_at = <Date 2019-08-13.15:37:46.191>
    user = 'https://bugs.python.org/theosp'

    bugs.python.org fields:

    activity = <Date 2019-08-13.15:37:46.191>
    actor = 'Anthony Sottile'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-04-07.02:03:45.882>
    closer = 'ned.deily'
    components = ['Documentation']
    creation = <Date 2010-03-27.05:01:07.251>
    creator = 'theosp'
    dependencies = []
    files = ['16673']
    hgrepos = []
    issue_num = 8243
    keywords = ['patch', 'easy']
    message_count = 15.0
    messages = ['174908', '218985', '218991', '218996', '219035', '219036', '272058', '309535', '310106', '315049', '315055', '315056', '315057', '315058', '349572']
    nosy_count = 9.0
    nosy_names = ['georg.brandl', 'ned.deily', 'CharlesMerriam', 'theosp', 'docs@python', 'Ramchandra Apte', 'Charles.Merriam', 'Anthony Sottile', 'jcrotts']
    pr_nums = ['5179', '6404', '6405', '6406']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue8243'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @theosp theosp mannequin added the type-bug An unexpected behavior, bug, or error label Mar 27, 2010
    @RamchandraApte
    Copy link
    Mannequin

    RamchandraApte mannequin commented Nov 5, 2012

    AutoBump™.

    @RamchandraApte RamchandraApte mannequin added the stdlib Python modules in the Lib dir label Nov 5, 2012
    @serhiy-storchaka serhiy-storchaka added extension-modules C modules in the Modules dir and removed stdlib Python modules in the Lib dir labels Nov 5, 2012
    @CharlesMerriam
    Copy link
    Mannequin

    CharlesMerriam mannequin commented May 23, 2014

    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.

    @ned-deily
    Copy link
    Member

    FTR, the previous issue is bpo-441429. A documentation patch would be welcomed.

    @ned-deily ned-deily added easy docs Documentation in the Doc dir labels May 23, 2014
    @merriam
    Copy link
    Mannequin

    merriam mannequin commented May 23, 2014

    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 bpo-441429. 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\>


    @birkenfeld
    Copy link
    Member

    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.

    @birkenfeld
    Copy link
    Member

    you WILL pick up, of course.

    @ned-deily
    Copy link
    Member

    See also bpo-27693 which documents a similar issue using curses.textpad.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Nov 1, 2017
    @jcrotts
    Copy link
    Mannequin

    jcrotts mannequin commented Jan 6, 2018

    I can create a documentation patch and PR if this still needs doing.

    @jcrotts
    Copy link
    Mannequin

    jcrotts mannequin commented Jan 16, 2018

    Submitted a PR for this issue, awaiting review.

    @jcrotts jcrotts mannequin added 3.8 only security fixes and removed 3.7 (EOL) end of life labels Mar 1, 2018
    @ned-deily
    Copy link
    Member

    New changeset ef5ce88 by Ned Deily (Jay Crotts) in branch 'master':
    bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179)
    ef5ce88

    @ned-deily
    Copy link
    Member

    New changeset 98e8ac8 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)
    98e8ac8

    @ned-deily
    Copy link
    Member

    New changeset 70c4446 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)
    70c4446

    @ned-deily
    Copy link
    Member

    New changeset 77f0a41 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)
    77f0a41

    @ned-deily
    Copy link
    Member

    Thank you for producing the PR, Jay!

    @ned-deily ned-deily added 3.7 (EOL) end of life and removed extension-modules C modules in the Modules dir labels Apr 7, 2018
    @ned-deily ned-deily removed the type-feature A feature request or enhancement label Apr 7, 2018
    @asottile
    Copy link
    Mannequin

    asottile mannequin commented Aug 13, 2019

    In case it helps someone else, insstr seems to not have this limitation

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir easy
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants