python / python/cpython

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

未关闭
#121,940 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

OS-windows topic-IO type-feature
主要语言
Python
星标
77.2k
派生
36k
PR 合并指标
PR 指标待抓取

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从 test_os 和 test_write_windows_console 中 Windows 控制台写入的覆盖情况开始,然后跟踪相关的 Windows 写入路径。在受支持的 Windows 版本上,控制台写入不再需要过时的检查或拆分、管道写入限制保持不变,并且现有的大写入测试通过后,此更改即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
operating-systems
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。