diff --git a/stdlib/3/subprocess.pyi b/stdlib/3/subprocess.pyi index edd74d76a..797df59b3 100644 --- a/stdlib/3/subprocess.pyi +++ b/stdlib/3/subprocess.pyi @@ -1,14 +1,8 @@ -# Stubs for subprocess - -# Based on http://docs.python.org/3.6/library/subprocess.html import sys from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload from types import TracebackType - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +from typing_extensions import Literal +from _typeshed import AnyPath # We prefer to annotate inputs to methods (eg subprocess.check_call) with these # union types. @@ -26,14 +20,9 @@ else: # reveal_type(e.cmd) # Any, but morally is _CMD _FILE = Union[None, int, IO[Any]] _TXT = Union[bytes, Text] -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PATH = Union[bytes, Text, _PathLike] -else: - _PATH = Union[bytes, Text] # Python 3.6 does't support _CMD being a single PathLike. # See: https://bugs.python.org/issue31961 -_CMD = Union[_TXT, Sequence[_PATH]] +_CMD = Union[_TXT, Sequence[AnyPath]] _ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] _S = TypeVar('_S') @@ -56,14 +45,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -84,14 +73,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -112,14 +101,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -140,14 +129,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -169,14 +158,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -197,14 +186,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -227,14 +216,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -253,14 +242,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -279,14 +268,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -306,14 +295,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -332,14 +321,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -360,14 +349,14 @@ else: def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -385,14 +374,14 @@ else: def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -409,14 +398,14 @@ else: def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -433,14 +422,14 @@ else: # Same args as Popen.__init__ def call(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -454,14 +443,14 @@ def call(args: _CMD, # Same args as Popen.__init__ def check_call(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -476,13 +465,13 @@ if sys.version_info >= (3, 7): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -500,13 +489,13 @@ if sys.version_info >= (3, 7): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -524,13 +513,13 @@ if sys.version_info >= (3, 7): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -548,13 +537,13 @@ if sys.version_info >= (3, 7): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -573,13 +562,13 @@ if sys.version_info >= (3, 7): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -597,13 +586,13 @@ if sys.version_info >= (3, 7): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -623,13 +612,13 @@ elif sys.version_info >= (3, 6): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -646,13 +635,13 @@ elif sys.version_info >= (3, 6): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -669,13 +658,13 @@ elif sys.version_info >= (3, 6): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., startupinfo: Any = ..., creationflags: int = ..., @@ -692,13 +681,13 @@ elif sys.version_info >= (3, 6): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -715,13 +704,13 @@ elif sys.version_info >= (3, 6): @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -739,13 +728,13 @@ else: @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., startupinfo: Any = ..., creationflags: int = ..., @@ -760,13 +749,13 @@ else: @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -781,13 +770,13 @@ else: @overload def check_output(args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: AnyPath = ..., stdin: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -851,14 +840,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -874,14 +863,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -897,14 +886,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -921,14 +910,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -944,14 +933,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Optional[Any] = ..., @@ -967,14 +956,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -991,14 +980,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -1013,14 +1002,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -1035,14 +1024,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -1058,14 +1047,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Optional[Any] = ..., @@ -1080,14 +1069,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ..., @@ -1103,14 +1092,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -1123,14 +1112,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[False] = ..., @@ -1143,14 +1132,14 @@ class Popen(Generic[AnyStr]): def __new__(cls, args: _CMD, bufsize: int = ..., - executable: Optional[_PATH] = ..., + executable: Optional[AnyPath] = ..., stdin: Optional[_FILE] = ..., stdout: Optional[_FILE] = ..., stderr: Optional[_FILE] = ..., preexec_fn: Optional[Callable[[], Any]] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Optional[Any] = ...,