]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-144067: Document terminal leak when initscr() follows setupterm() (GH-15262...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 2 Jul 2026 15:09:25 +0000 (17:09 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2026 15:09:25 +0000 (15:09 +0000)
(cherry picked from commit e471712958515b65b737ac742b294acf7de9220c)
(cherry picked from commit 46b48ff09ac9b22d558cfd74274da3ca033c9bcd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/curses.rst

index b74dfa04710740624b73a780f26467fdd90adb33..77c9397faebaf1f94a7a3aeafc069bda652b7615 100644 (file)
@@ -327,6 +327,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
@@ -596,6 +598,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()