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.chgat() moves cursor, documentation says it shouldn't #62869

Closed
productivememberofsociety666 mannequin opened this issue Aug 6, 2013 · 5 comments
Closed

curses.chgat() moves cursor, documentation says it shouldn't #62869

productivememberofsociety666 mannequin opened this issue Aug 6, 2013 · 5 comments
Assignees
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir easy extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@productivememberofsociety666
Copy link
Mannequin

BPO 18669
Nosy @berkerpeksag, @serhiy-storchaka, @NoSuck
PRs
  • bpo-18669: Corrected documentation for window.chgat in curses module #1430
  • Files
  • chgat-bug.py: Code demonstrating curses.chgat() moving the cursor.
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2017-11-04.08:45:58.154>
    created_at = <Date 2013-08-06.14:42:50.692>
    labels = ['extension-modules', 'easy', 'type-bug', '3.7', 'docs']
    title = "curses.chgat() moves cursor, documentation says it shouldn't"
    updated_at = <Date 2017-11-04.08:49:25.112>
    user = 'https://bugs.python.org/productivememberofsociety666'

    bugs.python.org fields:

    activity = <Date 2017-11-04.08:49:25.112>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2017-11-04.08:45:58.154>
    closer = 'serhiy.storchaka'
    components = ['Documentation', 'Extension Modules']
    creation = <Date 2013-08-06.14:42:50.692>
    creator = 'productivememberofsociety666'
    dependencies = []
    files = ['31178']
    hgrepos = []
    issue_num = 18669
    keywords = ['easy']
    message_count = 5.0
    messages = ['194552', '220998', '221533', '292350', '305545']
    nosy_count = 5.0
    nosy_names = ['docs@python', 'berker.peksag', 'serhiy.storchaka', 'productivememberofsociety666', 'IronGrid']
    pr_nums = ['1430']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18669'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @productivememberofsociety666
    Copy link
    Mannequin Author

    According to docs.python.org/2/library/curses.html#chgat (or any other version), curses.chgat() is not supposed to move the cursor at all.

    This is true if you don't give it x,y coordinates, but if you do, the cursor does in fact move to those coordinates, since it then uses C curses's mvchgat() internally and doesn't correct the position afterwards.

    See included file for demonstration:

    Expected output is:
    one
    two

    Actual output is:
    two

    Fix the documentation or fix the code :-)

    @productivememberofsociety666 productivememberofsociety666 mannequin added docs Documentation in the Doc dir extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Aug 6, 2013
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jun 19, 2014

    Can we have a comment on this please.

    @NoSuck
    Copy link
    Mannequin

    NoSuck mannequin commented Jun 25, 2014

    I get this error with 3.2.3, running Debian Stable.

    It's annoying because this error prevents curses apps from being able to highlight the current line.

    @berkerpeksag
    Copy link
    Member

    I think this is a documentation issue. curses.chgat() documentation tries to describe different signatures in one place and some of these signatures change the behavior of the function. For example, curses.chgat() calls mvwchgat() when users pass y and x to it and mvwchgat() is documented as "the mvwchgat function does a cursor move before acting".

    @serhiy-storchaka
    Copy link
    Member

    New changeset b838cc3 by Serhiy Storchaka (Chillar Anand) in branch 'master':
    bpo-18699: Corrected documentation for window.chgat in curses module (bpo-1430)
    b838cc3

    New changeset 6dbecd2 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
    bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430) (bpo-4271)
    6dbecd2

    New changeset fd38819 by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430). (bpo-4272)
    fd38819

    There is a typo in the issue number in commit messages.

    @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 docs Documentation in the Doc dir easy extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants