2 from _typeshed import Self, StrOrBytesPath
3 from types import TracebackType
4 from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Mapping, Sequence, Type, TypeVar, Union, overload
5 from typing_extensions import Literal
7 if sys.version_info >= (3, 9):
8 from types import GenericAlias
10 # We prefer to annotate inputs to methods (eg subprocess.check_call) with these
12 # For outputs we use laborious literal based overloads to try to determine
13 # which specific return types to use, and prefer to fall back to Any when
14 # this does not work, so the caller does not have to use an assertion to confirm
20 # x = subprocess.check_output(["ls", "-l"])
21 # reveal_type(x) # bytes, based on the overloads
22 # except TimeoutError as e:
23 # reveal_type(e.cmd) # Any, but morally is _CMD
24 _FILE = Union[None, int, IO[Any]]
25 _TXT = Union[bytes, str]
26 if sys.version_info >= (3, 8):
27 _CMD = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
29 # Python 3.6 doesn't support _CMD being a single PathLike.
30 # See: https://bugs.python.org/issue31961
31 _CMD = Union[_TXT, Sequence[StrOrBytesPath]]
32 if sys.platform == "win32":
33 _ENV = Mapping[str, str]
35 _ENV = Union[Mapping[bytes, StrOrBytesPath], Mapping[str, StrOrBytesPath]]
39 class CompletedProcess(Generic[_T]):
43 # These can both be None, but requiring checks for None would be tedious
44 # and writing all the overloads would be horrific.
47 def __init__(self, args: _CMD, returncode: int, stdout: _T | None = ..., stderr: _T | None = ...) -> None: ...
48 def check_returncode(self) -> None: ...
49 if sys.version_info >= (3, 9):
50 def __class_getitem__(cls, item: Any) -> GenericAlias: ...
52 if sys.version_info >= (3, 7):
53 # Nearly the same args as for 3.6, except for capture_output and text
58 executable: StrOrBytesPath | None = ...,
62 preexec_fn: Callable[[], Any] | None = ...,
63 close_fds: bool = ...,
65 cwd: StrOrBytesPath | None = ...,
66 env: _ENV | None = ...,
67 universal_newlines: bool = ...,
68 startupinfo: Any = ...,
69 creationflags: int = ...,
70 restore_signals: bool = ...,
71 start_new_session: bool = ...,
74 capture_output: bool = ...,
76 encoding: str | None = ...,
77 errors: str | None = ...,
78 input: str | None = ...,
80 timeout: float | None = ...,
81 ) -> CompletedProcess[str]: ...
86 executable: StrOrBytesPath | None = ...,
90 preexec_fn: Callable[[], Any] | None = ...,
91 close_fds: bool = ...,
93 cwd: StrOrBytesPath | None = ...,
94 env: _ENV | None = ...,
95 universal_newlines: bool = ...,
96 startupinfo: Any = ...,
97 creationflags: int = ...,
98 restore_signals: bool = ...,
99 start_new_session: bool = ...,
102 capture_output: bool = ...,
105 errors: str | None = ...,
106 input: str | None = ...,
107 text: bool | None = ...,
108 timeout: float | None = ...,
109 ) -> CompletedProcess[str]: ...
114 executable: StrOrBytesPath | None = ...,
118 preexec_fn: Callable[[], Any] | None = ...,
119 close_fds: bool = ...,
121 cwd: StrOrBytesPath | None = ...,
122 env: _ENV | None = ...,
123 universal_newlines: bool = ...,
124 startupinfo: Any = ...,
125 creationflags: int = ...,
126 restore_signals: bool = ...,
127 start_new_session: bool = ...,
130 capture_output: bool = ...,
132 encoding: str | None = ...,
134 input: str | None = ...,
135 text: bool | None = ...,
136 timeout: float | None = ...,
137 ) -> CompletedProcess[str]: ...
142 executable: StrOrBytesPath | None = ...,
146 preexec_fn: Callable[[], Any] | None = ...,
147 close_fds: bool = ...,
149 cwd: StrOrBytesPath | None = ...,
150 env: _ENV | None = ...,
152 universal_newlines: Literal[True],
153 startupinfo: Any = ...,
154 creationflags: int = ...,
155 restore_signals: bool = ...,
156 start_new_session: bool = ...,
158 # where the *real* keyword only args start
159 capture_output: bool = ...,
161 encoding: str | None = ...,
162 errors: str | None = ...,
163 input: str | None = ...,
164 text: bool | None = ...,
165 timeout: float | None = ...,
166 ) -> CompletedProcess[str]: ...
171 executable: StrOrBytesPath | None = ...,
175 preexec_fn: Callable[[], Any] | None = ...,
176 close_fds: bool = ...,
178 cwd: StrOrBytesPath | None = ...,
179 env: _ENV | None = ...,
180 universal_newlines: Literal[False] = ...,
181 startupinfo: Any = ...,
182 creationflags: int = ...,
183 restore_signals: bool = ...,
184 start_new_session: bool = ...,
187 capture_output: bool = ...,
189 encoding: None = ...,
191 input: bytes | None = ...,
192 text: Literal[None, False] = ...,
193 timeout: float | None = ...,
194 ) -> CompletedProcess[bytes]: ...
199 executable: StrOrBytesPath | None = ...,
203 preexec_fn: Callable[[], Any] | None = ...,
204 close_fds: bool = ...,
206 cwd: StrOrBytesPath | None = ...,
207 env: _ENV | None = ...,
208 universal_newlines: bool = ...,
209 startupinfo: Any = ...,
210 creationflags: int = ...,
211 restore_signals: bool = ...,
212 start_new_session: bool = ...,
215 capture_output: bool = ...,
217 encoding: str | None = ...,
218 errors: str | None = ...,
219 input: _TXT | None = ...,
220 text: bool | None = ...,
221 timeout: float | None = ...,
222 ) -> CompletedProcess[Any]: ...
225 # Nearly same args as Popen.__init__ except for timeout, input, and check
230 executable: StrOrBytesPath | None = ...,
234 preexec_fn: Callable[[], Any] | None = ...,
235 close_fds: bool = ...,
237 cwd: StrOrBytesPath | None = ...,
238 env: _ENV | None = ...,
239 universal_newlines: bool = ...,
240 startupinfo: Any = ...,
241 creationflags: int = ...,
242 restore_signals: bool = ...,
243 start_new_session: bool = ...,
248 errors: str | None = ...,
249 input: str | None = ...,
250 timeout: float | None = ...,
251 ) -> CompletedProcess[str]: ...
256 executable: StrOrBytesPath | None = ...,
260 preexec_fn: Callable[[], Any] | None = ...,
261 close_fds: bool = ...,
263 cwd: StrOrBytesPath | None = ...,
264 env: _ENV | None = ...,
265 universal_newlines: bool = ...,
266 startupinfo: Any = ...,
267 creationflags: int = ...,
268 restore_signals: bool = ...,
269 start_new_session: bool = ...,
273 encoding: str | None = ...,
275 input: str | None = ...,
276 timeout: float | None = ...,
277 ) -> CompletedProcess[str]: ...
282 executable: StrOrBytesPath | None = ...,
286 preexec_fn: Callable[[], Any] | None = ...,
287 close_fds: bool = ...,
289 cwd: StrOrBytesPath | None = ...,
290 env: _ENV | None = ...,
292 universal_newlines: Literal[True],
293 startupinfo: Any = ...,
294 creationflags: int = ...,
295 restore_signals: bool = ...,
296 start_new_session: bool = ...,
298 # where the *real* keyword only args start
300 encoding: str | None = ...,
301 errors: str | None = ...,
302 input: str | None = ...,
303 timeout: float | None = ...,
304 ) -> CompletedProcess[str]: ...
309 executable: StrOrBytesPath | None = ...,
313 preexec_fn: Callable[[], Any] | None = ...,
314 close_fds: bool = ...,
316 cwd: StrOrBytesPath | None = ...,
317 env: _ENV | None = ...,
318 universal_newlines: Literal[False] = ...,
319 startupinfo: Any = ...,
320 creationflags: int = ...,
321 restore_signals: bool = ...,
322 start_new_session: bool = ...,
326 encoding: None = ...,
328 input: bytes | None = ...,
329 timeout: float | None = ...,
330 ) -> CompletedProcess[bytes]: ...
335 executable: StrOrBytesPath | None = ...,
339 preexec_fn: Callable[[], Any] | None = ...,
340 close_fds: bool = ...,
342 cwd: StrOrBytesPath | None = ...,
343 env: _ENV | None = ...,
344 universal_newlines: bool = ...,
345 startupinfo: Any = ...,
346 creationflags: int = ...,
347 restore_signals: bool = ...,
348 start_new_session: bool = ...,
352 encoding: str | None = ...,
353 errors: str | None = ...,
354 input: _TXT | None = ...,
355 timeout: float | None = ...,
356 ) -> CompletedProcess[Any]: ...
358 # Same args as Popen.__init__
362 executable: StrOrBytesPath | None = ...,
366 preexec_fn: Callable[[], Any] | None = ...,
367 close_fds: bool = ...,
369 cwd: StrOrBytesPath | None = ...,
370 env: _ENV | None = ...,
371 universal_newlines: bool = ...,
372 startupinfo: Any = ...,
373 creationflags: int = ...,
374 restore_signals: bool = ...,
375 start_new_session: bool = ...,
378 timeout: float | None = ...,
381 # Same args as Popen.__init__
385 executable: StrOrBytesPath = ...,
389 preexec_fn: Callable[[], Any] | None = ...,
390 close_fds: bool = ...,
392 cwd: StrOrBytesPath | None = ...,
393 env: _ENV | None = ...,
394 universal_newlines: bool = ...,
395 startupinfo: Any = ...,
396 creationflags: int = ...,
397 restore_signals: bool = ...,
398 start_new_session: bool = ...,
400 timeout: float | None = ...,
403 if sys.version_info >= (3, 7):
409 executable: StrOrBytesPath | None = ...,
412 preexec_fn: Callable[[], Any] | None = ...,
413 close_fds: bool = ...,
415 cwd: StrOrBytesPath | None = ...,
416 env: _ENV | None = ...,
417 universal_newlines: bool = ...,
418 startupinfo: Any = ...,
419 creationflags: int = ...,
420 restore_signals: bool = ...,
421 start_new_session: bool = ...,
424 timeout: float | None = ...,
425 input: _TXT | None = ...,
426 encoding: str | None = ...,
427 errors: str | None = ...,
434 executable: StrOrBytesPath | None = ...,
437 preexec_fn: Callable[[], Any] | None = ...,
438 close_fds: bool = ...,
440 cwd: StrOrBytesPath | None = ...,
441 env: _ENV | None = ...,
442 universal_newlines: bool = ...,
443 startupinfo: Any = ...,
444 creationflags: int = ...,
445 restore_signals: bool = ...,
446 start_new_session: bool = ...,
449 timeout: float | None = ...,
450 input: _TXT | None = ...,
452 errors: str | None = ...,
453 text: bool | None = ...,
459 executable: StrOrBytesPath | None = ...,
462 preexec_fn: Callable[[], Any] | None = ...,
463 close_fds: bool = ...,
465 cwd: StrOrBytesPath | None = ...,
466 env: _ENV | None = ...,
467 universal_newlines: bool = ...,
468 startupinfo: Any = ...,
469 creationflags: int = ...,
470 restore_signals: bool = ...,
471 start_new_session: bool = ...,
474 timeout: float | None = ...,
475 input: _TXT | None = ...,
476 encoding: str | None = ...,
478 text: bool | None = ...,
484 executable: StrOrBytesPath | None = ...,
487 preexec_fn: Callable[[], Any] | None = ...,
488 close_fds: bool = ...,
490 cwd: StrOrBytesPath | None = ...,
491 env: _ENV | None = ...,
493 universal_newlines: Literal[True],
494 startupinfo: Any = ...,
495 creationflags: int = ...,
496 restore_signals: bool = ...,
497 start_new_session: bool = ...,
499 # where the real keyword only ones start
500 timeout: float | None = ...,
501 input: _TXT | None = ...,
502 encoding: str | None = ...,
503 errors: str | None = ...,
504 text: bool | None = ...,
510 executable: StrOrBytesPath | None = ...,
513 preexec_fn: Callable[[], Any] | None = ...,
514 close_fds: bool = ...,
516 cwd: StrOrBytesPath | None = ...,
517 env: _ENV | None = ...,
518 universal_newlines: Literal[False] = ...,
519 startupinfo: Any = ...,
520 creationflags: int = ...,
521 restore_signals: bool = ...,
522 start_new_session: bool = ...,
525 timeout: float | None = ...,
526 input: _TXT | None = ...,
527 encoding: None = ...,
529 text: Literal[None, False] = ...,
535 executable: StrOrBytesPath | None = ...,
538 preexec_fn: Callable[[], Any] | None = ...,
539 close_fds: bool = ...,
541 cwd: StrOrBytesPath | None = ...,
542 env: _ENV | None = ...,
543 universal_newlines: bool = ...,
544 startupinfo: Any = ...,
545 creationflags: int = ...,
546 restore_signals: bool = ...,
547 start_new_session: bool = ...,
550 timeout: float | None = ...,
551 input: _TXT | None = ...,
552 encoding: str | None = ...,
553 errors: str | None = ...,
554 text: bool | None = ...,
555 ) -> Any: ... # morally: -> _TXT
562 executable: StrOrBytesPath | None = ...,
565 preexec_fn: Callable[[], Any] | None = ...,
566 close_fds: bool = ...,
568 cwd: StrOrBytesPath | None = ...,
569 env: _ENV | None = ...,
570 universal_newlines: bool = ...,
571 startupinfo: Any = ...,
572 creationflags: int = ...,
573 restore_signals: bool = ...,
574 start_new_session: bool = ...,
577 timeout: float | None = ...,
578 input: _TXT | None = ...,
580 errors: str | None = ...,
586 executable: StrOrBytesPath | None = ...,
589 preexec_fn: Callable[[], Any] | None = ...,
590 close_fds: bool = ...,
592 cwd: StrOrBytesPath | None = ...,
593 env: _ENV | None = ...,
594 universal_newlines: bool = ...,
595 startupinfo: Any = ...,
596 creationflags: int = ...,
597 restore_signals: bool = ...,
598 start_new_session: bool = ...,
601 timeout: float | None = ...,
602 input: _TXT | None = ...,
603 encoding: str | None = ...,
610 executable: StrOrBytesPath | None = ...,
613 preexec_fn: Callable[[], Any] | None = ...,
614 close_fds: bool = ...,
616 cwd: StrOrBytesPath | None = ...,
617 env: _ENV | None = ...,
618 startupinfo: Any = ...,
619 creationflags: int = ...,
620 restore_signals: bool = ...,
621 start_new_session: bool = ...,
624 universal_newlines: Literal[True],
625 timeout: float | None = ...,
626 input: _TXT | None = ...,
627 encoding: str | None = ...,
628 errors: str | None = ...,
634 executable: StrOrBytesPath | None = ...,
637 preexec_fn: Callable[[], Any] | None = ...,
638 close_fds: bool = ...,
640 cwd: StrOrBytesPath | None = ...,
641 env: _ENV | None = ...,
642 universal_newlines: Literal[False] = ...,
643 startupinfo: Any = ...,
644 creationflags: int = ...,
645 restore_signals: bool = ...,
646 start_new_session: bool = ...,
649 timeout: float | None = ...,
650 input: _TXT | None = ...,
651 encoding: None = ...,
658 executable: StrOrBytesPath | None = ...,
661 preexec_fn: Callable[[], Any] | None = ...,
662 close_fds: bool = ...,
664 cwd: StrOrBytesPath | None = ...,
665 env: _ENV | None = ...,
666 universal_newlines: bool = ...,
667 startupinfo: Any = ...,
668 creationflags: int = ...,
669 restore_signals: bool = ...,
670 start_new_session: bool = ...,
673 timeout: float | None = ...,
674 input: _TXT | None = ...,
675 encoding: str | None = ...,
676 errors: str | None = ...,
677 ) -> Any: ... # morally: -> _TXT
683 class SubprocessError(Exception): ...
685 class TimeoutExpired(SubprocessError):
686 def __init__(self, cmd: _CMD, timeout: float, output: _TXT | None = ..., stderr: _TXT | None = ...) -> None: ...
690 # morally: _TXT | None
695 class CalledProcessError(SubprocessError):
699 # morally: _TXT | None
702 # morally: _TXT | None
705 def __init__(self, returncode: int, cmd: _CMD, output: _TXT | None = ..., stderr: _TXT | None = ...) -> None: ...
707 class Popen(Generic[AnyStr]):
709 stdin: IO[AnyStr] | None
710 stdout: IO[AnyStr] | None
711 stderr: IO[AnyStr] | None
714 universal_newlines: bool
716 # Technically it is wrong that Popen provides __new__ instead of __init__
717 # but this shouldn't come up hopefully?
719 if sys.version_info >= (3, 7):
720 # text is added in 3.7
726 executable: StrOrBytesPath | None = ...,
727 stdin: _FILE | None = ...,
728 stdout: _FILE | None = ...,
729 stderr: _FILE | None = ...,
730 preexec_fn: Callable[[], Any] | None = ...,
731 close_fds: bool = ...,
733 cwd: StrOrBytesPath | None = ...,
734 env: _ENV | None = ...,
735 universal_newlines: bool = ...,
736 startupinfo: Any | None = ...,
737 creationflags: int = ...,
738 restore_signals: bool = ...,
739 start_new_session: bool = ...,
742 text: bool | None = ...,
744 errors: str | None = ...,
751 executable: StrOrBytesPath | None = ...,
752 stdin: _FILE | None = ...,
753 stdout: _FILE | None = ...,
754 stderr: _FILE | None = ...,
755 preexec_fn: Callable[[], Any] | None = ...,
756 close_fds: bool = ...,
758 cwd: StrOrBytesPath | None = ...,
759 env: _ENV | None = ...,
760 universal_newlines: bool = ...,
761 startupinfo: Any | None = ...,
762 creationflags: int = ...,
763 restore_signals: bool = ...,
764 start_new_session: bool = ...,
767 text: bool | None = ...,
768 encoding: str | None = ...,
776 executable: StrOrBytesPath | None = ...,
777 stdin: _FILE | None = ...,
778 stdout: _FILE | None = ...,
779 stderr: _FILE | None = ...,
780 preexec_fn: Callable[[], Any] | None = ...,
781 close_fds: bool = ...,
783 cwd: StrOrBytesPath | None = ...,
784 env: _ENV | None = ...,
786 universal_newlines: Literal[True],
787 startupinfo: Any | None = ...,
788 creationflags: int = ...,
789 restore_signals: bool = ...,
790 start_new_session: bool = ...,
792 # where the *real* keyword only args start
793 text: bool | None = ...,
794 encoding: str | None = ...,
795 errors: str | None = ...,
802 executable: StrOrBytesPath | None = ...,
803 stdin: _FILE | None = ...,
804 stdout: _FILE | None = ...,
805 stderr: _FILE | None = ...,
806 preexec_fn: Callable[[], Any] | None = ...,
807 close_fds: bool = ...,
809 cwd: StrOrBytesPath | None = ...,
810 env: _ENV | None = ...,
811 universal_newlines: bool = ...,
812 startupinfo: Any | None = ...,
813 creationflags: int = ...,
814 restore_signals: bool = ...,
815 start_new_session: bool = ...,
819 encoding: str | None = ...,
820 errors: str | None = ...,
827 executable: StrOrBytesPath | None = ...,
828 stdin: _FILE | None = ...,
829 stdout: _FILE | None = ...,
830 stderr: _FILE | None = ...,
831 preexec_fn: Callable[[], Any] | None = ...,
832 close_fds: bool = ...,
834 cwd: StrOrBytesPath | None = ...,
835 env: _ENV | None = ...,
836 universal_newlines: Literal[False] = ...,
837 startupinfo: Any | None = ...,
838 creationflags: int = ...,
839 restore_signals: bool = ...,
840 start_new_session: bool = ...,
843 text: Literal[None, False] = ...,
844 encoding: None = ...,
846 ) -> Popen[bytes]: ...
852 executable: StrOrBytesPath | None = ...,
853 stdin: _FILE | None = ...,
854 stdout: _FILE | None = ...,
855 stderr: _FILE | None = ...,
856 preexec_fn: Callable[[], Any] | None = ...,
857 close_fds: bool = ...,
859 cwd: StrOrBytesPath | None = ...,
860 env: _ENV | None = ...,
861 universal_newlines: bool = ...,
862 startupinfo: Any | None = ...,
863 creationflags: int = ...,
864 restore_signals: bool = ...,
865 start_new_session: bool = ...,
868 text: bool | None = ...,
869 encoding: str | None = ...,
870 errors: str | None = ...,
878 executable: StrOrBytesPath | None = ...,
879 stdin: _FILE | None = ...,
880 stdout: _FILE | None = ...,
881 stderr: _FILE | None = ...,
882 preexec_fn: Callable[[], Any] | None = ...,
883 close_fds: bool = ...,
885 cwd: StrOrBytesPath | None = ...,
886 env: _ENV | None = ...,
887 universal_newlines: bool = ...,
888 startupinfo: Any | None = ...,
889 creationflags: int = ...,
890 restore_signals: bool = ...,
891 start_new_session: bool = ...,
895 errors: str | None = ...,
902 executable: StrOrBytesPath | None = ...,
903 stdin: _FILE | None = ...,
904 stdout: _FILE | None = ...,
905 stderr: _FILE | None = ...,
906 preexec_fn: Callable[[], Any] | None = ...,
907 close_fds: bool = ...,
909 cwd: StrOrBytesPath | None = ...,
910 env: _ENV | None = ...,
911 universal_newlines: bool = ...,
912 startupinfo: Any | None = ...,
913 creationflags: int = ...,
914 restore_signals: bool = ...,
915 start_new_session: bool = ...,
918 encoding: str | None = ...,
926 executable: StrOrBytesPath | None = ...,
927 stdin: _FILE | None = ...,
928 stdout: _FILE | None = ...,
929 stderr: _FILE | None = ...,
930 preexec_fn: Callable[[], Any] | None = ...,
931 close_fds: bool = ...,
933 cwd: StrOrBytesPath | None = ...,
934 env: _ENV | None = ...,
936 universal_newlines: Literal[True],
937 startupinfo: Any | None = ...,
938 creationflags: int = ...,
939 restore_signals: bool = ...,
940 start_new_session: bool = ...,
942 # where the *real* keyword only args start
943 encoding: str | None = ...,
944 errors: str | None = ...,
951 executable: StrOrBytesPath | None = ...,
952 stdin: _FILE | None = ...,
953 stdout: _FILE | None = ...,
954 stderr: _FILE | None = ...,
955 preexec_fn: Callable[[], Any] | None = ...,
956 close_fds: bool = ...,
958 cwd: StrOrBytesPath | None = ...,
959 env: _ENV | None = ...,
960 universal_newlines: Literal[False] = ...,
961 startupinfo: Any | None = ...,
962 creationflags: int = ...,
963 restore_signals: bool = ...,
964 start_new_session: bool = ...,
967 encoding: None = ...,
969 ) -> Popen[bytes]: ...
975 executable: StrOrBytesPath | None = ...,
976 stdin: _FILE | None = ...,
977 stdout: _FILE | None = ...,
978 stderr: _FILE | None = ...,
979 preexec_fn: Callable[[], Any] | None = ...,
980 close_fds: bool = ...,
982 cwd: StrOrBytesPath | None = ...,
983 env: _ENV | None = ...,
984 universal_newlines: bool = ...,
985 startupinfo: Any | None = ...,
986 creationflags: int = ...,
987 restore_signals: bool = ...,
988 start_new_session: bool = ...,
991 encoding: str | None = ...,
992 errors: str | None = ...,
994 def poll(self) -> int | None: ...
995 if sys.version_info >= (3, 7):
996 def wait(self, timeout: float | None = ...) -> int: ...
998 def wait(self, timeout: float | None = ..., endtime: float | None = ...) -> int: ...
1002 input: AnyStr | None = ...,
1003 timeout: float | None = ...,
1004 # morally this should be optional
1005 ) -> tuple[AnyStr, AnyStr]: ...
1006 def send_signal(self, sig: int) -> None: ...
1007 def terminate(self) -> None: ...
1008 def kill(self) -> None: ...
1009 def __enter__(self: Self) -> Self: ...
1011 self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
1013 if sys.version_info >= (3, 9):
1014 def __class_getitem__(cls, item: Any) -> GenericAlias: ...
1016 # The result really is always a str.
1017 def getstatusoutput(cmd: _TXT) -> tuple[int, str]: ...
1018 def getoutput(cmd: _TXT) -> str: ...
1020 if sys.version_info >= (3, 8):
1021 def list2cmdline(seq: Iterable[StrOrBytesPath]) -> str: ... # undocumented
1024 def list2cmdline(seq: Iterable[str]) -> str: ... # undocumented
1026 if sys.platform == "win32":
1028 if sys.version_info >= (3, 7):
1033 hStdInput: Any | None = ...,
1034 hStdOutput: Any | None = ...,
1035 hStdError: Any | None = ...,
1036 wShowWindow: int = ...,
1037 lpAttributeList: Mapping[str, Any] | None = ...,
1040 hStdInput: Any | None
1041 hStdOutput: Any | None
1042 hStdError: Any | None
1044 if sys.version_info >= (3, 7):
1045 lpAttributeList: Mapping[str, Any]
1046 STD_INPUT_HANDLE: Any
1047 STD_OUTPUT_HANDLE: Any
1048 STD_ERROR_HANDLE: Any
1050 STARTF_USESTDHANDLES: int
1051 STARTF_USESHOWWINDOW: int
1052 CREATE_NEW_CONSOLE: int
1053 CREATE_NEW_PROCESS_GROUP: int
1054 if sys.version_info >= (3, 7):
1055 ABOVE_NORMAL_PRIORITY_CLASS: int
1056 BELOW_NORMAL_PRIORITY_CLASS: int
1057 HIGH_PRIORITY_CLASS: int
1058 IDLE_PRIORITY_CLASS: int
1059 NORMAL_PRIORITY_CLASS: int
1060 REALTIME_PRIORITY_CLASS: int
1061 CREATE_NO_WINDOW: int
1062 DETACHED_PROCESS: int
1063 CREATE_DEFAULT_ERROR_MODE: int
1064 CREATE_BREAKAWAY_FROM_JOB: int