Skip to content

gh-160141: Curses core fixes - #160142

Closed
cdorsman wants to merge 15 commits into
python:mainfrom
cdorsman:curses-core-fixes
Closed

cdorsman wants to merge 15 commits into
python:mainfrom
cdorsman:curses-core-fixes

Conversation

@cdorsman

Copy link
Copy Markdown

Summary

Complete the core curses bindings in CPython and adapt the port to the
current stateful curses module architecture.

The change covers the broader curses core API, including:

  • window and screen lifecycle operations
  • input and output operations
  • character and string handling
  • colors, attributes, and wide-character support
  • terminal and termcap functionality
  • soft-label and video operations
  • ripoffline
  • associated tests and documentation

Existing functionality already present on main is preserved and
integrated with the port. The curses form and menu APIs are intentionally
excluded from this change.

Tests

  • make -j2
  • TERM=dumb ./python -m test -u curses test_curses -v

Result:

  • 192 tests passed
  • 45 tests skipped
  • The skipped tests depend on ncurses 6.5; the development container
    provides ncurses 6.4.

Notes

The implementation uses the current CPython module-state and Argument
Clinic conventions rather than copying the older implementation
verbatim.

Closes gh-160141

@python-cla-bot

python-cla-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@cdorsman cdorsman changed the title Curses core fixes gh-160141: Curses core fixes Oct 21, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 21, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35311842 | 📁 Comparing 9dc8dca against main (4036afb)

  🔍 Preview build  

2 files changed
± library/curses.html
± whatsnew/changelog.html

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ISTM that this makes unrelated code changes and also doesn't use AC where it could be used. I also wonder whether this API is really necessayr.

Comment thread Modules/_curses_form.c
/*
* Interface to the ncurses panel library
*
* Original version by Thomas Gellekum

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this specific change. Panels are already written in _curses_panel.c. Why duplicating this?

Comment thread Modules/_cursesmodule.c
return curses_check_err(module, putp(string), "putp", NULL);
}

static PyObject *

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using Argument Clinic?

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@picnixz

picnixz commented Oct 21, 2026

Copy link
Copy Markdown
Member

I'm clsoing the PR because the feature has not been discussed by the maintainer. What are the use cases for those specific functions? panel is implemented by the _curses_panel.c file

@picnixz picnixz closed this Oct 21, 2026
@cdorsman

cdorsman commented Oct 22, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complete the missing core curses bindings

2 participants