Skip to content

gh-151744: Add curses.nofilter()#151747

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-nofilter
Jun 19, 2026
Merged

gh-151744: Add curses.nofilter()#151747
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-nofilter

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 19, 2026

Copy link
Copy Markdown
Member

The curses module wraps filter() but not its inverse nofilter().

filter() puts curses into single-line mode — it forces LINES to 1 at the next initscr(). nofilter(), an ncurses extension, undoes that effect.

Without it, code (or a test) that calls curses.filter() has no way to restore normal screen sizing for a later initscr() in the same process.

This wraps nofilter() as curses.nofilter(), guarded by a configure check, alongside the existing curses.filter().

Wrap the ncurses nofilter() function, which undoes the effect of
filter().  Without it there is no way to restore normal screen sizing
after a curses.filter() call in the same process.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33220964 | 📁 Comparing 23f6f39 against main (7d4a0aa)

  🔍 Preview build  

3 files changed
± library/curses.html
± whatsnew/3.16.html
± whatsnew/changelog.html

@serhiy-storchaka serhiy-storchaka merged commit 2e5843e into python:main Jun 19, 2026
57 checks passed
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-wasi 3.x (tier-2) has failed when building commit 2e5843e.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1046/builds/12130) and take a look at the build logs.
  4. Check if the failure is related to this commit (2e5843e) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1046/builds/12130

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 22, done.        
remote: Counting objects:  10% (1/10)        
remote: Counting objects:  20% (2/10)        
remote: Counting objects:  30% (3/10)        
remote: Counting objects:  40% (4/10)        
remote: Counting objects:  50% (5/10)        
remote: Counting objects:  60% (6/10)        
remote: Counting objects:  70% (7/10)        
remote: Counting objects:  80% (8/10)        
remote: Counting objects:  90% (9/10)        
remote: Counting objects: 100% (10/10)        
remote: Counting objects: 100% (10/10), done.        
remote: Compressing objects:  11% (1/9)        
remote: Compressing objects:  22% (2/9)        
remote: Compressing objects:  33% (3/9)        
remote: Compressing objects:  44% (4/9)        
remote: Compressing objects:  55% (5/9)        
remote: Compressing objects:  66% (6/9)        
remote: Compressing objects:  77% (7/9)        
remote: Compressing objects:  88% (8/9)        
remote: Compressing objects: 100% (9/9)        
remote: Compressing objects: 100% (9/9), done.        
remote: Total 22 (delta 1), reused 1 (delta 1), pack-reused 12 (from 1)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '2e5843e13fcfd768a435d82e6182af403844432c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 2e5843e13fc gh-151744: Add curses.nofilter() (GH-151747)
Switched to and reset branch 'main'

⚠️ WARNING: This script is deprecated and slated for removal in Python 3.20; execute the `Platforms/WASI/` directory instead (i.e. `python Platforms/WASI`)


⚠️ WARNING: This script is deprecated and slated for removal in Python 3.20; execute the `Platforms/WASI/` directory instead (i.e. `python Platforms/WASI`)


⚠️ WARNING: This script is deprecated and slated for removal in Python 3.20; execute the `Platforms/WASI/` directory instead (i.e. `python Platforms/WASI`)

@serhiy-storchaka serhiy-storchaka deleted the curses-nofilter branch June 19, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants