@@ -2,7 +2,7 @@ import subprocess
2
2
import sys
3
3
from _typeshed import StrOrBytesPath
4
4
from asyncio import events , protocols , streams , transports
5
- from collections .abc import Callable
5
+ from collections .abc import Callable , Collection
6
6
from typing import IO , Any
7
7
from typing_extensions import Literal , TypeAlias
8
8
@@ -40,7 +40,7 @@ class Process:
40
40
def kill (self ) -> None : ...
41
41
async def communicate (self , input : bytes | bytearray | memoryview | None = ...) -> tuple [bytes , bytes ]: ...
42
42
43
- if sys .version_info >= (3 , 10 ):
43
+ if sys .version_info >= (3 , 11 ):
44
44
async def create_subprocess_shell (
45
45
cmd : str | bytes ,
46
46
stdin : int | IO [Any ] | None = ...,
@@ -65,7 +65,13 @@ if sys.version_info >= (3, 10):
65
65
creationflags : int = ...,
66
66
restore_signals : bool = ...,
67
67
start_new_session : bool = ...,
68
- pass_fds : Any = ...,
68
+ pass_fds : Collection [int ] = ...,
69
+ group : None | str | int = ...,
70
+ extra_groups : None | Collection [str | int ] = ...,
71
+ user : None | str | int = ...,
72
+ umask : int = ...,
73
+ process_group : int | None = ...,
74
+ pipesize : int = ...,
69
75
) -> Process : ...
70
76
async def create_subprocess_exec (
71
77
program : _ExecArg ,
@@ -91,10 +97,80 @@ if sys.version_info >= (3, 10):
91
97
creationflags : int = ...,
92
98
restore_signals : bool = ...,
93
99
start_new_session : bool = ...,
94
- pass_fds : Any = ...,
100
+ pass_fds : Collection [int ] = ...,
101
+ group : None | str | int = ...,
102
+ extra_groups : None | Collection [str | int ] = ...,
103
+ user : None | str | int = ...,
104
+ umask : int = ...,
105
+ process_group : int | None = ...,
106
+ pipesize : int = ...,
95
107
) -> Process : ...
96
108
97
- else :
109
+ elif sys .version_info >= (3 , 10 ):
110
+ async def create_subprocess_shell (
111
+ cmd : str | bytes ,
112
+ stdin : int | IO [Any ] | None = ...,
113
+ stdout : int | IO [Any ] | None = ...,
114
+ stderr : int | IO [Any ] | None = ...,
115
+ limit : int = ...,
116
+ * ,
117
+ # These parameters are forced to these values by BaseEventLoop.subprocess_shell
118
+ universal_newlines : Literal [False ] = ...,
119
+ shell : Literal [True ] = ...,
120
+ bufsize : Literal [0 ] = ...,
121
+ encoding : None = ...,
122
+ errors : None = ...,
123
+ text : Literal [False , None ] = ...,
124
+ # These parameters are taken by subprocess.Popen, which this ultimately delegates to
125
+ executable : StrOrBytesPath | None = ...,
126
+ preexec_fn : Callable [[], Any ] | None = ...,
127
+ close_fds : bool = ...,
128
+ cwd : StrOrBytesPath | None = ...,
129
+ env : subprocess ._ENV | None = ...,
130
+ startupinfo : Any | None = ...,
131
+ creationflags : int = ...,
132
+ restore_signals : bool = ...,
133
+ start_new_session : bool = ...,
134
+ pass_fds : Collection [int ] = ...,
135
+ group : None | str | int = ...,
136
+ extra_groups : None | Collection [str | int ] = ...,
137
+ user : None | str | int = ...,
138
+ umask : int = ...,
139
+ pipesize : int = ...,
140
+ ) -> Process : ...
141
+ async def create_subprocess_exec (
142
+ program : _ExecArg ,
143
+ * args : _ExecArg ,
144
+ stdin : int | IO [Any ] | None = ...,
145
+ stdout : int | IO [Any ] | None = ...,
146
+ stderr : int | IO [Any ] | None = ...,
147
+ limit : int = ...,
148
+ # These parameters are forced to these values by BaseEventLoop.subprocess_shell
149
+ universal_newlines : Literal [False ] = ...,
150
+ shell : Literal [True ] = ...,
151
+ bufsize : Literal [0 ] = ...,
152
+ encoding : None = ...,
153
+ errors : None = ...,
154
+ # These parameters are taken by subprocess.Popen, which this ultimately delegates to
155
+ text : bool | None = ...,
156
+ executable : StrOrBytesPath | None = ...,
157
+ preexec_fn : Callable [[], Any ] | None = ...,
158
+ close_fds : bool = ...,
159
+ cwd : StrOrBytesPath | None = ...,
160
+ env : subprocess ._ENV | None = ...,
161
+ startupinfo : Any | None = ...,
162
+ creationflags : int = ...,
163
+ restore_signals : bool = ...,
164
+ start_new_session : bool = ...,
165
+ pass_fds : Collection [int ] = ...,
166
+ group : None | str | int = ...,
167
+ extra_groups : None | Collection [str | int ] = ...,
168
+ user : None | str | int = ...,
169
+ umask : int = ...,
170
+ pipesize : int = ...,
171
+ ) -> Process : ...
172
+
173
+ else : # >= 3.9
98
174
async def create_subprocess_shell (
99
175
cmd : str | bytes ,
100
176
stdin : int | IO [Any ] | None = ...,
@@ -120,7 +196,11 @@ else:
120
196
creationflags : int = ...,
121
197
restore_signals : bool = ...,
122
198
start_new_session : bool = ...,
123
- pass_fds : Any = ...,
199
+ pass_fds : Collection [int ] = ...,
200
+ group : None | str | int = ...,
201
+ extra_groups : None | Collection [str | int ] = ...,
202
+ user : None | str | int = ...,
203
+ umask : int = ...,
124
204
) -> Process : ...
125
205
async def create_subprocess_exec (
126
206
program : _ExecArg ,
@@ -147,5 +227,9 @@ else:
147
227
creationflags : int = ...,
148
228
restore_signals : bool = ...,
149
229
start_new_session : bool = ...,
150
- pass_fds : Any = ...,
230
+ pass_fds : Collection [int ] = ...,
231
+ group : None | str | int = ...,
232
+ extra_groups : None | Collection [str | int ] = ...,
233
+ user : None | str | int = ...,
234
+ umask : int = ...,
151
235
) -> Process : ...
0 commit comments