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 — `curses.tparm()` crashes for capabilities that take string parameters · Issue #161571 · python/cpython

curses.tparm() crashes for capabilities that take string parameters #161571

New issue
Copy link
New issue
Copy link
Open
Open
curses.tparm() crashes for capabilities that take string parameters#161571
Copy link
Labels
3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-cursestype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@serhiy-storchaka
serhiy-storchaka
opened on Nov 7, 2026
Issue body actions

Bug description:

curses.tparm() passes all its parameters as integers. But ncurses treats some parameters as char *, for the few capabilities that take strings: pfkey, pfloc, pfx, pln, pfxl, and the extended Cs and Ms of xterm. So passing an integer there crashes:

import curses
curses.setupterm('xterm-256color')
curses.tparm(curses.tigetstr('Ms'), 1)    # Segmentation fault

The same happens with curses.tigetstr('Cs'). There is also no way to pass a string, so these capabilities cannot be used from Python at all.

ncurses takes as strings the parameters for which %s or %l directly follows %pN, but only in the format strings of the capabilities above of the current terminal. For other format strings with such parameters it returns NULL, so a plain b'%p1%s' does not crash: tparm() raises curses.error.

NetBSD curses takes such parameters as strings in any format string, not only in those capabilities, so with it even curses.tparm(b'x%p1%sy', 1) crashes.

Linked PRs

  • gh-161571: Fix a crash in curses.tparm() with string parameters #161601

Activity

  1. serhiy-storchaka
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    3.14bugs and security fixesbugs and security fixes
    3.15bugs and security fixesbugs and security fixes
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    topic-curses
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-cursestype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.