classification
Title: Incorrect error handling in curses.update_lines_cols()
Type: Stage: resolved
Components: Extension Modules Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2019-04-10 19:03 by ZackerySpytz, last changed 2019-12-15 13:34 by cheryl.sabella. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12766 merged ZackerySpytz, 2019-04-10 19:09
Messages (3)
msg339881 - (view) Author: Zackery Spytz (ZackerySpytz) * (Python triager) Date: 2019-04-10 19:03
update_lines_cols() returns 0 if an error occurs, but the generated AC code checks for a return value of -1.
msg356747 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-11-16 10:12
Historically the update_lines_cols() helper returned 0 on error, and I think that it is better to keep it so.

The bug is in the Python function update_lines_cols() added in 3.5 (see issue4254). Its implementation should return NULL if the helper returns 0, and None otherwise. There is no reason to return an integer.
msg356819 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-11-17 17:10
New changeset 2bc343417a4de83fa6998ff91303877734ecd366 by Serhiy Storchaka (Zackery Spytz) in branch 'master':
bpo-36589: Fix the error handling in curses.update_lines_cols(). (GH-12766)
https://github.com/python/cpython/commit/2bc343417a4de83fa6998ff91303877734ecd366
History
Date User Action Args
2019-12-15 13:34:33cheryl.sabellasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-11-17 17:10:16serhiy.storchakasetmessages: + msg356819
2019-11-16 10:12:34serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg356747
2019-04-10 19:09:25ZackerySpytzsetkeywords: + patch
stage: patch review
pull_requests: + pull_request12694
2019-04-10 19:03:55ZackerySpytzcreate