classification
Title: curses.chgat() moves cursor, documentation says it shouldn't
Type: behavior Stage: needs patch
Components: Documentation, Extension Modules Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: IronGrid, berker.peksag, docs@python, productivememberofsociety666
Priority: normal Keywords: easy

Created on 2013-08-06 14:42 by productivememberofsociety666, last changed 2017-05-04 18:51 by python-dev.

Files
File name Uploaded Description Edit
chgat-bug.py productivememberofsociety666, 2013-08-06 16:26 Code demonstrating curses.chgat() moving the cursor.
Pull Requests
URL Status Linked Edit
PR 1430 open python-dev, 2017-05-04 18:51
Messages (4)
msg194552 - (view) Author: productivememberofsociety666 (productivememberofsociety666) Date: 2013-08-06 14:42
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 :-)
msg220998 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-19 15:58
Can we have a comment on this please.
msg221533 - (view) Author: Grady Martin (IronGrid) Date: 2014-06-25 07:54
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.
msg292350 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-04-26 14:10
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".
History
Date User Action Args
2017-05-04 18:51:37python-devsetpull_requests: + pull_request1558
2017-04-26 14:24:56BreamoreBoysetnosy: - BreamoreBoy
2017-04-26 14:10:13berker.peksagsetversions: + Python 3.6, Python 3.7, - Python 3.2, Python 3.4
nosy: + berker.peksag

messages: + msg292350

keywords: + easy
stage: needs patch
2014-06-25 07:54:34IronGridsetnosy: + IronGrid

messages: + msg221533
versions: + Python 3.2
2014-06-19 15:58:04BreamoreBoysetnosy: + BreamoreBoy

messages: + msg220998
versions: - Python 2.6, Python 3.1, Python 3.2, Python 3.3
2013-08-06 16:26:45productivememberofsociety666setfiles: + chgat-bug.py
2013-08-06 16:25:45productivememberofsociety666setfiles: - chgat-bug.py
2013-08-06 14:42:50productivememberofsociety666create