[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: I fixed the bug in 3.7, 3.8 and master (future 3.9) branches. Thanks Marius Gedminas for the bug report. In the meanwhile, you have to pass bytes strings to addch() :-( -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7eef81ee766c8df23e522b4e46a930cc1d360ad7 by Victor Stinner in branch '3.7': bpo-37738: Fix curses addch(str, color_pair) (GH-15071) (GH-15273) https://github.com/python/cpython/commit/7eef81ee766c8df23e522b4e46a930cc1d360ad7 --

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread miss-islington
miss-islington added the comment: New changeset 984226962bc35254551d92771b5c8fb074507903 by Miss Islington (bot) in branch '3.8': bpo-37738: Fix curses addch(str, color_pair) (GH-15071) https://github.com/python/cpython/commit/984226962bc35254551d92771b5c8fb074507903 -- nosy:

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +14995 pull_request: https://github.com/python/cpython/pull/15273 ___ Python tracker ___

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: On my Fedora 30 with libncursesw, A_COLOR = 0xff00. After my change, _curses uses: static inline short attr_to_color_pair(int attr) { return (short)((attr & A_COLOR) >> 8); } ... setcchar(, wstr, attr,

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: New changeset 077af8c2c93dd71086e2c5e5ff1e634b6da8f214 by Victor Stinner in branch 'master': bpo-37738: Fix curses addch(str, color_pair) (GH-15071) https://github.com/python/cpython/commit/077af8c2c93dd71086e2c5e5ff1e634b6da8f214 --

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +14994 pull_request: https://github.com/python/cpython/pull/15272 ___ Python tracker ___

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor
Change by STINNER Victor : -- versions: +Python 3.9 -Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor
STINNER Victor added the comment: I'm able to reproduce the issue on Fedora 30: Python 3.7.4 with ncurses-libs-6.1-10.20180923.fc30.x86_64. vstinner@apu$ cat /etc/fedora-release Fedora release 30 (Thirty) vstinner@apu$ python3 -VV Python 3.7.4 (default, Jul 9 2019, 16:32:37) [GCC 9.1.1

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor
STINNER Victor added the comment: stdscr.addch(str, color_pair) is implemented with: setcchar(, wstr, attr, 0, NULL); rtn = wadd_wch(self->win, ); whereas stdscr.addch(bytes, color_pair) is implemented with: rtn = waddch(self->win, cch | (attr_t) attr); The 4th argument of

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +14818 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15071 ___ Python tracker ___

[issue37738] curses.addch('a', curses.color_pair(1)) ignores the color information

2019-08-01 Thread Marius Gedminas
New submission from Marius Gedminas : curses.addch() ignores color information if I pass it a string of length one. Color works fine if I pass it a byte string or an int. Here's a reproducer: ### start of example ### import curses