[issue18669] curses.chgat() moves cursor, documentation says it shouldn't

New submission from productivememberofsociety666:
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 :-)
---------- assignee: docs@python components: Documentation, Extension Modules files: chgat-bug.py messages: 194552 nosy: docs@python, productivememberofsociety666 priority: normal severity: normal status: open title: curses.chgat() moves cursor, documentation says it shouldn't type: behavior versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file31175/chgat-bug.py
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Changes by productivememberofsociety666 productivememberofsociety666@sol.fr.am:
Removed file: http://bugs.python.org/file31175/chgat-bug.py
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Changes by productivememberofsociety666 productivememberofsociety666@sol.fr.am:
Added file: http://bugs.python.org/file31178/chgat-bug.py
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Mark Lawrence added the comment:
Can we have a comment on this please.
---------- nosy: +BreamoreBoy versions: -Python 2.6, Python 3.1, Python 3.2, Python 3.3
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

IronGrid added the comment:
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.
---------- nosy: +IronGrid versions: +Python 3.2
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Berker Peksag added the comment:
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".
---------- keywords: +easy nosy: +berker.peksag stage: -> needs patch versions: +Python 3.6, Python 3.7 -Python 3.2, Python 3.4
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Changes by Mark Lawrence breamoreboy@gmail.com:
---------- nosy: -BreamoreBoy
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Changes by Roundup Robot devnull@psf.upfronthosting.co.za:
---------- pull_requests: +1558
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue18669 _______________________________________

Change by Serhiy Storchaka storchaka+cpython@gmail.com:
---------- assignee: docs@python -> serhiy.storchaka nosy: +serhiy.storchaka
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue18669 _______________________________________

Change by Serhiy Storchaka storchaka+cpython@gmail.com:
---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: -Python 3.5
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue18669 _______________________________________

Serhiy Storchaka storchaka+cpython@gmail.com added the comment:
New changeset b838cc3ff4e039af949c6a19bd896e98e944dcbe by Serhiy Storchaka (Chillar Anand) in branch 'master': bpo-18699: Corrected documentation for window.chgat in curses module (#1430) https://github.com/python/cpython/commit/b838cc3ff4e039af949c6a19bd896e98e94...
New changeset 6dbecd2cd9c9448b34e1a632509220f3c4cf7587 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430) (#4271) https://github.com/python/cpython/commit/6dbecd2cd9c9448b34e1a632509220f3c4c...
New changeset fd38819497fd2a52ada674f0c890f5b414d0e87f by Serhiy Storchaka in branch '2.7': [2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430). (#4272) https://github.com/python/cpython/commit/fd38819497fd2a52ada674f0c890f5b414d...
There is a typo in the issue number in commit messages.
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue18669 _______________________________________
participants (6)
-
Berker Peksag
-
IronGrid
-
Mark Lawrence
-
productivememberofsociety666
-
Roundup Robot
-
Serhiy Storchaka