Skip to content

[subprocess] Consistency between text and universal_newlines#15654

Merged
JelleZijlstra merged 3 commits intopython:mainfrom
srittau:subprocess-doc
May 2, 2026
Merged

[subprocess] Consistency between text and universal_newlines#15654
JelleZijlstra merged 3 commits intopython:mainfrom
srittau:subprocess-doc

Conversation

@srittau
Copy link
Copy Markdown
Collaborator

@srittau srittau commented Apr 20, 2026

text can't be False if universal_newlines is True.

Also document the overloads.

`text` can't be `False` if `universal_newlines` is `True`.

Also document the overloads.
@github-actions

This comment has been minimized.

@srittau
Copy link
Copy Markdown
Collaborator Author

srittau commented Apr 20, 2026

Errors are due to #15653.

@github-actions

This comment has been minimized.

@JelleZijlstra
Copy link
Copy Markdown
Member

Looks good but I'm going to update the branch to see what's going on with that mypy internal error in mypy-primer.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Diff from mypy_primer, showing the effect of this PR on open source code:

dulwich (https://github.com/dulwich/dulwich)
+ dulwich/filters.py:190: error: Returning Any from function declared to return "bytes"  [no-any-return]

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/shell.py:76: note:     def [AnyStr: (str, bytes)] Popen(args: str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]], bufsize: int = ..., executable: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., stdin: int | IO[Any] | None = ..., stdout: int | IO[Any] | None = ..., stderr: int | IO[Any] | None = ..., preexec_fn: Callable[[], object] | None = ..., close_fds: bool = ..., shell: bool = ..., cwd: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., env: Mapping[bytes, str | bytes | PathLike[str] | PathLike[bytes]] | Mapping[str, str | bytes | PathLike[str] | PathLike[bytes]] | None = ..., universal_newlines: bool | None = ..., startupinfo: Any | None = ..., creationflags: int = ..., restore_signals: bool = ..., start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, text: Literal[True], encoding: str | None = ..., errors: str | None = ..., user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., umask: int = ..., pipesize: int = ...) -> Popen[str]
+ src/prefect/cli/shell.py:76: note:     def [AnyStr: (str, bytes)] Popen(args: str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]], bufsize: int = ..., executable: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., stdin: int | IO[Any] | None = ..., stdout: int | IO[Any] | None = ..., stderr: int | IO[Any] | None = ..., preexec_fn: Callable[[], object] | None = ..., close_fds: bool = ..., shell: bool = ..., cwd: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., env: Mapping[bytes, str | bytes | PathLike[str] | PathLike[bytes]] | Mapping[str, str | bytes | PathLike[str] | PathLike[bytes]] | None = ..., universal_newlines: Literal[True] | None = ..., startupinfo: Any | None = ..., creationflags: int = ..., restore_signals: bool = ..., start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, text: Literal[True], encoding: str | None = ..., errors: str | None = ..., user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., umask: int = ..., pipesize: int = ...) -> Popen[str]

@JelleZijlstra JelleZijlstra merged commit ad18156 into python:main May 2, 2026
51 checks passed
@srittau srittau deleted the subprocess-doc branch May 3, 2026 00:32
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.

2 participants