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 addch() argument position reverses in Python3.4.0 #65287
Comments
There is a test code that is "RB" characters display on screen. I expected displaying "R" to right, and displaying "B" to bottom. It was run as expected in Python 2.7.3 and 3.2.3 on Cygwin. import curses
def test(stdscr):
stdscr.addch(0, 5, b'R')
stdscr.addch(5, 0, b'B')
stdscr.refresh()
stdscr.getch()
curses.wrapper(test) Please make sure of issues, and fix it. |
It looks like the arguments were inadvertently swapped during the conversion to Argument Clinic. The Library Reference doc says: window.addch(y, x, ch[, attr]) but the Argument Clinic docstring for 3.4.0 says: Help on built-in function addch: addch(...) method of _curses.curses window instance
Perhaps we should check for others? |
That's my fault. That conversion was done at a time when there were a lot fewer eyes looking at AC. It should obviously be fixed, and a test added to the regression test suite. It'd also be nice if running the curses test didn't make reading the result impossible. Running "python -m test -u curses test_curses" leaves my terminal window cleared, with no text to scroll back to, and the result of the regression test gone. Redirecting the test to a file fails because curses complains stdio isn't a tty. (I specifically ran the curses regression test suite several times during the development of 3.4 and I don't recall it ever complaining, so I'm assuming there is no test for this function. But it's possible there is a test, but the irritating behavior of test_curses means it's impossible to see the result.) |
Here is a patch. I don't see how to write a unit test. |
You may create a the pty module for that. |
How about examining the inspect.Signature? |
Here's my version of the patch, which is like Victor's patch but adds a test. For what it's worth, I'll make sure this issue is fixed before I release 3.4.1. |
New changeset 4f26430b03fd by Larry Hastings in branch '3.4': |
New changeset 3aa5fae8c313 by Larry Hastings in branch 'default': |
Can we now close this issue? |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: