python / python/cpython

Simplify Windows write I/O around consoles on Windows 8+

Open
#121,940 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-windows topic-IO type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

In bpo-11395 from 2011, Windows Python needed to check on every write if a write was to a tty / console object and limit the size of the write to avoid an OS error on write. With Windows 8 and above, the Windows subsystem has been updated and this check is no longer necessary. It is also not necessary to split the write into smaller pieces (which resulted in gh-110913 and gh-82052).

Based on PEP 11, the last Windows 8 support ended in 2023, so the isatty + limited write size is no longer needed on any currently supported Windows platform (Pipes are still limited write size).

That large writes work is tested in test_os, test_write_windows_console

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

https://github.com/python/cpython/issues/55604#issuecomment-1093537612

Linked PRs
  • gh-121941

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Windows console write coverage in test_os and test_write_windows_console, then trace the related Windows write path. The change is complete when console writes no longer require the obsolete checks or splitting on supported Windows versions, pipe write limits remain, and the existing large-write tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.