You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
curses.chgat() moves cursor, documentation says it shouldn't #62869
productivememberofsociety666 commented on Aug 6, 2013
productivememberofsociety666mannequin
MannequinAuthor
More actions
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.
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".
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.
Activity
productivememberofsociety666 commentedon Aug 6, 2013
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 :-)
BreamoreBoy commentedon Jun 19, 2014
Can we have a comment on this please.
NoSuck commentedon 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 commentedon Apr 26, 2017
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 commentedon Nov 4, 2017
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.