This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ncurses does not include BUTTON5_* constants
Type: crash Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: IronGrid, ZackerySpytz, michael.yoo@akunacapital.com, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-01-09 06:59 by michael.yoo@akunacapital.com, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17996 merged ZackerySpytz, 2020-01-14 06:45
Messages (3)
msg359657 - (view) Author: Michael Yoo (michael.yoo@akunacapital.com) Date: 2020-01-09 06:59
Hi,

Recently I was working with ncurses, and when handling the mouse scroll events, I noticed that the curses library does not include the BUTTON5_* macros provided by ncurses. On my system, BUTTON5 corresponds to the mouse down event.

Is there a reason for this, or has it just not been updated? If so, the expectation is that it exists.

Relevant source location: https://github.com/python/cpython/blob/2bc3434/Modules/_cursesmodule.c#L4668
msg378252 - (view) Author: Grady Martin (IronGrid) Date: 2020-10-08 15:12
This baffled me, as well.  Does the reason involve bit-field width?

By the way, look at what my Python installation does when just *pressing* button 5 (mouse wheel down) after calling `curses.mousemask()`:

```
_curses.error: getmouse() returned ERR
```

The curses program then crashes with an exit code of 1.

```
$ uname -srvmo
Linux 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux
$ python3 -V
Python 3.7.3
```
msg385065 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-01-14 09:40
New changeset 14cfa325c298ceb9eaf6b585a3cdcabf6c6378a9 by Zackery Spytz in branch 'master':
bpo-39273: Expose BUTTON5_* constants in the curses module if available (GH-17996)
https://github.com/python/cpython/commit/14cfa325c298ceb9eaf6b585a3cdcabf6c6378a9
History
Date User Action Args
2022-04-11 14:59:25adminsetgithub: 83454
2021-01-14 09:40:58serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.10, - Python 3.6, Python 3.7, Python 3.8, Python 3.9
2021-01-14 09:40:36serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg385065
2020-10-08 15:14:45IronGridsetversions: + Python 3.6, Python 3.8, Python 3.9
2020-10-08 15:12:08IronGridsetversions: + Python 3.7, - Python 3.9
nosy: + IronGrid

messages: + msg378252

type: enhancement -> crash
2020-01-14 06:46:35ZackerySpytzsetnosy: + ZackerySpytz

versions: - Python 3.6, Python 3.7, Python 3.8
2020-01-14 06:45:18ZackerySpytzsetkeywords: + patch
stage: patch review
pull_requests: + pull_request17400
2020-01-09 06:59:01michael.yoo@akunacapital.comcreate