GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-160141: Curses core fixes by cdorsman · Pull Request #160142 · python/cpython

Conversation

@cdorsman

@cdorsman cdorsman commented Oct 21, 2026

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cdorsman and others added 11 commits September 25, 2023 18:42
@cdorsman
Started expansion of Curses module by adding implementation of the NC…
3cab6d8
…urses Form API
@cdorsman
oops
00a9410
@cdorsman
wMerge branch 'main' of github.com:cdorsman/cpython
c95e4b0
@cdorsman
Added Curses-form module
5500d76
@cdorsman
Merge branch 'python:main' into main
4c17c2a
@cdorsman
Merge branch 'python:main' into main
16033b0
@cdorsman
Merge branch 'python:main' into main
18ca042
@cdorsman
Merge branch 'python:main' into main
71aeb9f
cdorsman
Add remaining curses termcap bindings
2947d0b
cdorsman
Add curses ripoffline binding
ad5e8a5
cdorsman
Modernize curses ripoffline callback handling
8ef79b8
@python-cla-bot

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

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

  • [email protected]

CLA not signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Oct 21, 2026
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cdorsman
Merge branch 'main' into curses-core-fixes
9dc8dca
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@bedevere-app bedevere-app Bot mentioned this pull request Oct 21, 2026
Complete the missing core curses bindings #160141
Open
@read-the-docs-community

read-the-docs-community Bot commented Oct 21, 2026

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cdorsman
Fix termcap warnings on macOS
3bafb61
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cdorsman
Accept termcap bytes in tgoto
1cbec35
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cdorsman
Add generated curses form Clinic header
d1c0244
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz requested changes Oct 21, 2026
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

@picnixz picnixz Oct 21, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

static PyObject *

@picnixz picnixz Oct 21, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting review labels Oct 21, 2026
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz picnixz closed this Oct 21, 2026
@cdorsman

cdorsman commented Oct 22, 2026 via email

Copy link
Copy Markdown
Author
I understand that new functionality requires justification, but I think we’re overlooking a more fundamental question here. What is the long-term purpose of maintaining the _curses module if its development is largely stagnant and contributions that complete existing functionality face these barriers? My changes are not intended to introduce a new abstraction or fundamentally change the module. They expose functionality that already exists in the underlying Curses library, following the approach established by the existing implementation. I acknowledge the technical feedback provided on this PR. The relevant comments, including the accidental inclusion of Panel-related functionality, will be addressed and incorporated into a revised implementation before resubmitting the PR. Furthermore, my intention is to continue this work by implementing bindings for the Menu and Form libraries, with the goal of providing more complete coverage of the Curses ecosystem in Python. However, the response to this PR raises concerns about whether such contributions are actually welcome. If completing the existing bindings is not considered a sufficient reason for accepting these changes, what is the intended scope and future direction of this module? And would further contributions, including Menu and Form support, even be considered?
…
________________________________ From: Bénédikt Tran ***@***.***> Sent: Thursday, 22 October 2026 01:31:39 To: python/cpython ***@***.***> Cc: Chris Dorsman ***@***.***>; Author ***@***.***> Subject: Re: [python/cpython] gh-160141: Curses core fixes (PR #160142) Closed #160142<#160142>. — Reply to this email directly, view it on GitHub<#160142?email_source=notifications&email_token=AJMU4ANWH65WQEW2NDV6U2D5VFBNXA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGMZYHE4DIOBYGYYDBJTSMVQXG33OUZQXK5DIN5ZKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#event-33898488600>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJMU4AOA4EGC6YYF7RG3SDT5VFBNXAVCNFSNUABEKJSXA33TNF2G64TZHM4DCNJZHA4TMMJ3JFZXG5LFHM2TSNRZHA4TCMZRG6QXMAQ>. You are receiving this because you authored the thread.Message ID: ***@***.***>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@picnixz picnixz picnixz requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting changes type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Complete the missing core curses bindings

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@cdorsman @picnixz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.