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 — Replace ctypes based Windows console calls in `_pyrepl` · Issue #150582 · python/cpython

Replace ctypes based Windows console calls in _pyrepl #150582

New issue
Copy link
New issue
Copy link
Open
Open
Replace ctypes based Windows console calls in _pyrepl#150582
Copy link
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

Description

@aisk
aisk
opened on May 29, 2026
Issue body actions

My preference is still that we ought to be actively migrating from ctypes to a proper native module for these. Performance and reliability will thank us.

Originally posted by @zooba in #132888

  • GetStdHandle (already exist in _winapi)
  • WaitForSingleObject (already exist in _winapi)
  • GetConsoleMode
  • SetConsoleMode
  • GetConsoleScreenBufferInfo
  • ScrollConsoleScreenBufferW
  • ReadConsoleInputW
  • FlushConsoleInputBuffer

Linked PRs

  • gh-150582: Use _winapi for _pyrepl console handles and waits #150584
  • gh-150582: Use _winapi for _pyrepl console mode and input flush #160758
Reacted by Chris Eibl and Steve Dower

Activity

  1. aisk
    added
    OS-windows
    type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
    topic-replRelated to the interactive shellRelated to the interactive shell
    on May 29, 2026
  2. StanFromIreland
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on May 29, 2026
  3. chris-eibl commented on Sep 11, 2026

    @chris-eibl
    chris-eibl
    on Sep 11, 2026
    Member
    More actions

    @zooba I assume the things not yet in _winapi are fine to put in there?

  4. zooba commented on Sep 11, 2026

    @zooba
    zooba
    on Sep 11, 2026
    Member
    More actions

    I assume the things not yet in _winapi are fine to put in there?

    Strictly speaking, yes, but if the module already has big chunks of Windows-specific functions that use those APIs, it's probably better (and likely easier) to just move the entire function into C.

    I'm fine for a couple of higher-level functions to go into _winapi with comments that it should be moved to a REPL native module when one exists. Start their names with _pyrepl_... and there'll be no controversy.

  5. chris-eibl
    added a commit that references this issue on Oct 25, 2026

    gh-150582: Use _winapi for _pyrepl console handles and waits (#150584)

    2468c35
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

    OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

    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.