Skip to content

[subprocess] Restore IO[AnyStr] on Popen stream attributes - #16204

Closed
pacocartones wants to merge 1 commit into
python:mainfrom
pacocartones:fix-popen-std-anystr
Closed

[subprocess] Restore IO[AnyStr] on Popen stream attributes#16204
pacocartones wants to merge 1 commit into
python:mainfrom
pacocartones:fix-popen-std-anystr

Conversation

@pacocartones

Copy link
Copy Markdown

Fixes #15827

Restores IO[AnyStr] on Popen.stdin, Popen.stdout and Popen.stderr, which became IO[Any] in #15654, and adds a regression test case.

Agent used: Claude Opus 5 (Claude Code)

`Popen` is generic in `AnyStr`, but `stdin`, `stdout` and `stderr` were
annotated as `IO[Any]`, which dropped the type parameter. Restore
`IO[AnyStr]` and add a regression test case.
@donbarbos

Copy link
Copy Markdown
Contributor

Thank you, but existing PR already covers all needs.
About the tests: we only add regression tests for functions and classes which are known to have caused complex problems (this case doesn't look very "complex") in the past, or where stubs are difficult to get right. 100% test coverage for typeshed is neither necessary nor desirable, as it would lead to code duplication.

See tests/REGRESSION.md for more information.

@srittau srittau closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Popen.std* attributes are now IO[Any]

3 participants