https://github.com/python/cpython/commit/822d63c2d6414020b67de3b447aaab599ab04850
commit: 822d63c2d6414020b67de3b447aaab599ab04850
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-02T15:08:30Z
summary:

[3.13] gh-144067: Document terminal leak when initscr() follows setupterm() 
(GH-152624) (GH-152894) (GH-152898)

(cherry picked from commit e471712958515b65b737ac742b294acf7de9220c)
(cherry picked from commit 46b48ff09ac9b22d558cfd74274da3ca033c9bcd)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Doc/library/curses.rst

diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index 32d328283671d7..8ed73b58996d6a 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -306,6 +306,8 @@ The module :mod:`curses` defines the following functions:
    Initialize the library. Return a :ref:`window <curses-window-objects>` 
object
    which represents the whole screen.
 
+   See :func:`setupterm` for a caveat about calling it before this function.
+
    .. note::
 
       If there is an error opening the terminal, the underlying curses library 
may
@@ -568,6 +570,13 @@ The module :mod:`curses` defines the following functions:
    terminfo database entry could not be read.  If the terminal has already
    been initialized, this function has no effect.
 
+   .. note::
+
+      Calling :func:`initscr` after :func:`setupterm`
+      leaks the terminal that :func:`setupterm` allocated:
+      the curses library keeps only a single current terminal
+      and does not free the previously allocated one.
+
 
 .. function:: start_color()
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to