[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-09-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 23377e88487b by Victor Stinner in branch 'default': Issue #15785: Modify window.get_wch() API of the curses module: return a http://hg.python.org/cpython/rev/23377e88487b -- ___ Python tracker

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-09-07 Thread Georg Brandl
Georg Brandl added the comment: Now picked into 3.3.0 release clone in 23377e88487b. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-09-03 Thread Nicolas Schodet
Changes by Nicolas Schodet nico-pyt...@ni.fr.eu.org: -- nosy: -schodet ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___ ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-09-01 Thread STINNER Victor
STINNER Victor added the comment: @georg.brandl: Can you please include the important fix c58789634d22 into Python 3.3 final? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: If the function returned either a single-character unicode string or an integer keycode, this would also make it possible to completely drop the is_key_code part of the return value. (Callers could simply check the type of the return value to see if it is a

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: New patch fixing the issue with a better API: window.get_wch()-int or str depending on the key (int for key codes, str for other keys). Oh, I realized that test_curses does also fail on my laptop without the patch. My laptop is running Fedora 11 which uses

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file27007/curses_get_wch.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps you should simply remove the new function, and re-add it in 3.4 when you've thought it out a bit more. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: window.get_wch() has been added by the issue #6755, and curses.unget_wch() by #12567. Copy the nosy of the issue #6755. -- nosy: +Nicholas.Cole, akuchling, cben, gpolo, inigoserna, jcea, phep, python-dev, r.david.murray, schodet, zeha

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file27038/curses_get_wch-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: New patch with a test for this specific issue. (It's not easy to me to write a patch because my version of libncurses doesn't work with integers bigger than 128...) -- Added file: http://bugs.python.org/file27039/curses_get_wch-3.patch

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: Perhaps you should simply remove the new function, and re-add it in 3.4 when you've thought it out a bit more. Python 3 forces somehow to use Unicode, and the Unicode support of the curses module in Python 3.2 is incomplete or broken (see . Many issues have

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file27038/curses_get_wch-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file27039/curses_get_wch-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: bitdancer tested the patch version 3 for me and it fails: unget_wch(KEY_UP) inserts the character U+0103 (259, à) instead of KEY_UP in get_wch() buffer. unget_wch() cannot be used to insert key codes, only classic keys like letters. So I removed the patch

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: @simpkins: can you please try my patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___ ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread STINNER Victor
STINNER Victor added the comment: bitdancer proposes (on IRC) a better doc for get_wch(): Get a wide character. Return a character for most keys, or an integer for function keys, keypad keys, and other special keys. We may also replace and so on by and other special keys in getkey()

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset c58789634d22 by Victor Stinner in branch 'default': Issue #15785: Modify window.get_wch() API of the curses module: return a http://hg.python.org/cpython/rev/c58789634d22 -- ___ Python tracker

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-27 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +georg.brandl, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___ ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-27 Thread Georg Brandl
Georg Brandl added the comment: Please get a review from another developer before I consider this for rc2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-27 Thread Adam Simpkins
Adam Simpkins added the comment: + Get a wide character as (is_key_code, key). *is_key_code* is True for + function keys, keypad keys and so, in this case, *key* is a multibyte string + containing the key name. Otherwise, *key* is a single character + corresponding to the key. The

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-26 Thread Adam Simpkins
New submission from Adam Simpkins: The curses.get_wch() function does not check if wget_wch() returned OK or KEY_CODE_YES. In either case, it simply returns the character code. This makes get_wch() unusable when keypad is enabled, because the caller cannot distinguish function key or arrow

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-26 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___ ___ Python-bugs-list mailing list

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-26 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15785 ___

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-26 Thread STINNER Victor
STINNER Victor added the comment: Oh, right. I agree that the current implementation of window.get_wch() is useless. I missed completly key codes. Attached patch changes the API of get_wch() from get_wch()-key:int to get_wch()-(is_key_code: bool, key: str). Examples: (True, 'KEY_UP'), (False,

[issue15785] curses.get_wch() returns keypad codes incorrectly

2012-08-26 Thread STINNER Victor
STINNER Victor added the comment: I consider this issue as a release blocker because the bug requires to change the API (of a function added to Python 3.3). If this issue cannot be fixed before Python 3.3 final, I prefer to drop the function until a better implementation is written.