Skip to content
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

Incorrect error handling in curses.update_lines_cols() #80770

Closed
ZackerySpytz mannequin opened this issue Apr 10, 2019 · 4 comments
Closed

Incorrect error handling in curses.update_lines_cols() #80770

ZackerySpytz mannequin opened this issue Apr 10, 2019 · 4 comments
Labels
3.8 only security fixes extension-modules C modules in the Modules dir

Comments

@ZackerySpytz
Copy link
Mannequin

ZackerySpytz mannequin commented Apr 10, 2019

BPO 36589
Nosy @serhiy-storchaka, @ZackerySpytz
PRs
  • bpo-36589: Fix the error handling in curses.update_lines_cols() #12766
  • [3.8] bpo-36589: Fix the error handling in curses.update_lines_cols() (GH-12766) #24023
  • 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:

    assignee = None
    closed_at = <Date 2019-12-15.13:34:33.216>
    created_at = <Date 2019-04-10.19:03:55.752>
    labels = ['extension-modules', '3.8']
    title = 'Incorrect error handling in curses.update_lines_cols()'
    updated_at = <Date 2021-01-01.17:40:41.778>
    user = 'https://github.com/ZackerySpytz'

    bugs.python.org fields:

    activity = <Date 2021-01-01.17:40:41.778>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-12-15.13:34:33.216>
    closer = 'cheryl.sabella'
    components = ['Extension Modules']
    creation = <Date 2019-04-10.19:03:55.752>
    creator = 'ZackerySpytz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36589
    keywords = ['patch']
    message_count = 4.0
    messages = ['339881', '356747', '356819', '384189']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'ZackerySpytz']
    pr_nums = ['12766', '24023']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36589'
    versions = ['Python 3.8']

    @ZackerySpytz
    Copy link
    Mannequin Author

    ZackerySpytz mannequin commented Apr 10, 2019

    update_lines_cols() returns 0 if an error occurs, but the generated AC code checks for a return value of -1.

    @ZackerySpytz ZackerySpytz mannequin added 3.8 only security fixes extension-modules C modules in the Modules dir labels Apr 10, 2019
    @serhiy-storchaka
    Copy link
    Member

    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 bpo-4254). Its implementation should return NULL if the helper returns 0, and None otherwise. There is no reason to return an integer.

    @serhiy-storchaka
    Copy link
    Member

    New changeset 2bc3434 by Serhiy Storchaka (Zackery Spytz) in branch 'master':
    bpo-36589: Fix the error handling in curses.update_lines_cols(). (GH-12766)
    2bc3434

    @serhiy-storchaka
    Copy link
    Member

    New changeset 187785e by Serhiy Storchaka in branch '3.8':
    [3.8] bpo-36589: Fix the error handling in curses.update_lines_cols(). (GH-12766) (GH-24023)
    187785e

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants